This commit is contained in:
@@ -35,20 +35,24 @@
|
||||
根据提供的权限JSON,需要添加权限控制的模块包括:
|
||||
|
||||
1. **套餐管理** (`/package-management`)
|
||||
|
||||
- 套餐系列 (`package-series`)
|
||||
- 套餐列表 (`package-list`)
|
||||
- 单套餐分配 (`package-assign`)
|
||||
- 套餐系列分配 (`series-assign`)
|
||||
|
||||
2. **店铺管理** (`/shop-management`)
|
||||
|
||||
- 店铺列表 (`list`)
|
||||
|
||||
3. **账号管理** (`/account-management`)
|
||||
|
||||
- 账号列表 (`account`)
|
||||
- 平台账号 (`platform-account`)
|
||||
- 代理账号 (`shop-account`)
|
||||
|
||||
4. **资产管理** (`/asset-management`)
|
||||
|
||||
- IoT卡管理 (`iot-card-management`)
|
||||
- IoT卡任务 (`iot-card-task`)
|
||||
- 设备任务 (`device-task`)
|
||||
@@ -67,9 +71,9 @@
|
||||
|
||||
```vue
|
||||
<script setup>
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
const { hasAuth } = useAuth()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -79,29 +83,28 @@ const { hasAuth } = useAuth()
|
||||
</template>
|
||||
|
||||
<!-- 2. 表格列中的状态切换 -->
|
||||
<ElSwitch
|
||||
:disabled="!hasAuth('module:update_status')"
|
||||
v-model="row.status"
|
||||
/>
|
||||
<ElSwitch :disabled="!hasAuth('module:update_status')" v-model="row.status" />
|
||||
|
||||
<!-- 3. 表格列中的操作按钮 -->
|
||||
<script>
|
||||
const columns = [{
|
||||
prop: 'operation',
|
||||
formatter: (row) => {
|
||||
const buttons = []
|
||||
const columns = [
|
||||
{
|
||||
prop: 'operation',
|
||||
formatter: (row) => {
|
||||
const buttons = []
|
||||
|
||||
if (hasAuth('module:edit')) {
|
||||
buttons.push(h(ArtButtonTable, { type: 'edit', onClick: () => edit(row) }))
|
||||
if (hasAuth('module:edit')) {
|
||||
buttons.push(h(ArtButtonTable, { type: 'edit', onClick: () => edit(row) }))
|
||||
}
|
||||
|
||||
if (hasAuth('module:delete')) {
|
||||
buttons.push(h(ArtButtonTable, { type: 'delete', onClick: () => del(row) }))
|
||||
}
|
||||
|
||||
return h('div', { style: 'display: flex; gap: 8px;' }, buttons)
|
||||
}
|
||||
}
|
||||
|
||||
if (hasAuth('module:delete')) {
|
||||
buttons.push(h(ArtButtonTable, { type: 'delete', onClick: () => del(row) }))
|
||||
}
|
||||
|
||||
return h('div', { style: 'display: flex; gap: 8px;' }, buttons)
|
||||
}
|
||||
}]
|
||||
]
|
||||
</script>
|
||||
</template>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user