fix: 真流量虚流量权限
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m42s

This commit is contained in:
sexygoat
2026-05-14 10:52:11 +08:00
parent 1690252740
commit 38cf7d12e9
29 changed files with 859 additions and 198 deletions

View File

@@ -298,6 +298,7 @@
defineOptions({ name: 'Shop' })
const { hasAuth } = useAuth()
const canModifyShopStatus = hasAuth('shop:modify_status')
const router = useRouter()
const dialogType = ref('add')
@@ -467,7 +468,7 @@
{ label: '所在地区', prop: 'region' },
{ label: '联系人', prop: 'contact_name' },
{ label: '联系电话', prop: 'contact_phone' },
{ label: '状态', prop: 'status' },
...(canModifyShopStatus ? [{ label: '状态', prop: 'status' }] : []),
{ label: '创建时间', prop: 'created_at' },
{ label: '操作', prop: 'operation' }
]
@@ -596,24 +597,27 @@
label: '联系电话',
width: 130
},
{
prop: 'status',
label: '状态',
width: 80,
formatter: (row: ShopResponse) => {
return h(ElSwitch, {
modelValue: row.status,
activeValue: CommonStatus.ENABLED,
inactiveValue: CommonStatus.DISABLED,
activeText: getStatusText(CommonStatus.ENABLED),
inactiveText: getStatusText(CommonStatus.DISABLED),
inlinePrompt: true,
disabled: !hasAuth('shop:modify_status'),
'onUpdate:modelValue': (val: string | number | boolean) =>
handleStatusChange(row, val as number)
})
}
},
...(canModifyShopStatus
? [
{
prop: 'status',
label: '状态',
width: 80,
formatter: (row: ShopResponse) => {
return h(ElSwitch, {
modelValue: row.status,
activeValue: CommonStatus.ENABLED,
inactiveValue: CommonStatus.DISABLED,
activeText: getStatusText(CommonStatus.ENABLED),
inactiveText: getStatusText(CommonStatus.DISABLED),
inlinePrompt: true,
'onUpdate:modelValue': (val: string | number | boolean) =>
handleStatusChange(row, val as number)
})
}
}
]
: []),
{
prop: 'created_at',
label: '创建时间',