This commit is contained in:
@@ -23,7 +23,10 @@
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div style="margin: 10px 0">
|
||||
<ElButton @click="showAddAccountDialog">
|
||||
<ElButton
|
||||
v-if="hasAuth(isShopType ? 'shop_account:add' : 'enterprise_account:add')"
|
||||
@click="showAddAccountDialog"
|
||||
>
|
||||
{{ isShopType ? '新增店铺账号' : '新增企业账号' }}
|
||||
</ElButton>
|
||||
</div>
|
||||
@@ -91,10 +94,17 @@
|
||||
<ElDialog v-model="roleDialogVisible" width="900px">
|
||||
<template #header>
|
||||
<div class="dialog-header">
|
||||
<span class="dialog-title">分配角色</span>
|
||||
<span class="dialog-title">{{
|
||||
isShopType ? '分配店铺账号角色' : '分配企业客户角色'
|
||||
}}</span>
|
||||
<div class="account-info">
|
||||
<span class="account-name">{{ currentAccountName }}</span>
|
||||
<ElTag v-if="currentAccountType === 3" type="warning" size="small" style="margin-left: 8px">
|
||||
<ElTag
|
||||
v-if="currentAccountType === 3"
|
||||
type="warning"
|
||||
size="small"
|
||||
style="margin-left: 8px"
|
||||
>
|
||||
代理账号只能分配一个客户角色
|
||||
</ElTag>
|
||||
</div>
|
||||
@@ -208,11 +218,13 @@
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import type { PlatformAccount, PlatformRole } from '@/types/api'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
|
||||
defineOptions({ name: 'CommonAccountList' })
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const { hasAuth } = useAuth()
|
||||
|
||||
// 判断页面类型:通过 query 参数判断
|
||||
const isShopType = computed(() => route.query.type === 'shop')
|
||||
@@ -373,11 +385,20 @@
|
||||
{
|
||||
prop: 'operation',
|
||||
label: '操作',
|
||||
width: 120,
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
formatter: (row: PlatformAccount) => {
|
||||
// 根据类型检查权限
|
||||
const permission = isShopType.value
|
||||
? 'shop_account:patch_role'
|
||||
: 'customer_accounts:patch_role'
|
||||
|
||||
if (!hasAuth(permission)) {
|
||||
return h('span', '-')
|
||||
}
|
||||
|
||||
return h(ArtButtonTable, {
|
||||
text: '分配角色',
|
||||
text: isShopType.value ? '分配店铺账号角色' : '分配企业客户角色',
|
||||
onClick: () => showRoleDialog(row)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user