fetch(modify):完善按钮权限
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m25s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m25s
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
@refresh="handleRefresh"
|
||||
>
|
||||
<template #left>
|
||||
<ElButton @click="showDialog('add')">新增企业客户</ElButton>
|
||||
<ElButton @click="showDialog('add')" v-permission="'enterprise_customer:add'">新增企业客户</ElButton>
|
||||
</template>
|
||||
</ArtTableHeader>
|
||||
|
||||
@@ -213,6 +213,7 @@
|
||||
import type { EnterpriseItem, ShopResponse } from '@/types/api'
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import ArtButtonTable from '@/components/core/forms/ArtButtonTable.vue'
|
||||
import CustomerAccountDialog from '@/components/business/CustomerAccountDialog.vue'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
@@ -220,6 +221,8 @@
|
||||
|
||||
defineOptions({ name: 'EnterpriseCustomer' })
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
@@ -450,28 +453,49 @@
|
||||
width: 340,
|
||||
fixed: 'right',
|
||||
formatter: (row: EnterpriseItem) => {
|
||||
return h('div', { style: 'display: flex; gap: 8px;' }, [
|
||||
h(ArtButtonTable, {
|
||||
text: '编辑',
|
||||
iconClass: BgColorEnum.SECONDARY,
|
||||
onClick: () => showDialog('edit', row)
|
||||
}),
|
||||
h(ArtButtonTable, {
|
||||
text: '查看客户',
|
||||
iconClass: BgColorEnum.PRIMARY,
|
||||
onClick: () => viewCustomerAccounts(row)
|
||||
}),
|
||||
h(ArtButtonTable, {
|
||||
text: '卡授权',
|
||||
iconClass: BgColorEnum.PRIMARY,
|
||||
onClick: () => manageCards(row)
|
||||
}),
|
||||
h(ArtButtonTable, {
|
||||
text: '修改密码',
|
||||
iconClass: BgColorEnum.WARNING,
|
||||
onClick: () => showPasswordDialog(row)
|
||||
})
|
||||
])
|
||||
const buttons = []
|
||||
|
||||
if (hasAuth('enterprise_customer:edit')) {
|
||||
buttons.push(
|
||||
h(ArtButtonTable, {
|
||||
text: '编辑',
|
||||
iconClass: BgColorEnum.SECONDARY,
|
||||
onClick: () => showDialog('edit', row)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (hasAuth('enterprise_customer:look_customer')) {
|
||||
buttons.push(
|
||||
h(ArtButtonTable, {
|
||||
text: '查看客户',
|
||||
iconClass: BgColorEnum.PRIMARY,
|
||||
onClick: () => viewCustomerAccounts(row)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (hasAuth('enterprise_customer:card_authorization')) {
|
||||
buttons.push(
|
||||
h(ArtButtonTable, {
|
||||
text: '卡授权',
|
||||
iconClass: BgColorEnum.PRIMARY,
|
||||
onClick: () => manageCards(row)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (hasAuth('enterprise_customer:update_pwd')) {
|
||||
buttons.push(
|
||||
h(ArtButtonTable, {
|
||||
text: '修改密码',
|
||||
iconClass: BgColorEnum.WARNING,
|
||||
onClick: () => showPasswordDialog(row)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
return h('div', { style: 'display: flex; gap: 8px;' }, buttons)
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user