diff --git a/apps/web-antd/src/views/system/dept/data.ts b/apps/web-antd/src/views/system/dept/data.ts index 1bba82c44..2fd458407 100644 --- a/apps/web-antd/src/views/system/dept/data.ts +++ b/apps/web-antd/src/views/system/dept/data.ts @@ -9,6 +9,9 @@ import { getSimpleUserList } from '#/api/system/user'; import { DICT_TYPE, getDictOptions } from '#/utils/dict'; import { CommonStatusEnum } from '#/utils/constants'; import { handleTree } from '#/utils/tree'; +import { useAccess } from '@vben/access'; + +const { hasAccessByCodes } = useAccess(); /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { @@ -180,10 +183,15 @@ export function useGridColumns( { code: 'append', text: '新增下级', + show: hasAccessByCodes(['system:dept:create']), }, - 'edit', // 默认的编辑按钮 { - code: 'delete', // 默认的删除按钮 + code: 'edit', + show: hasAccessByCodes(['system:dept:update']), + }, + { + code: 'delete', + show: hasAccessByCodes(['system:dept:delete']), disabled: (row: SystemDeptApi.SystemDept) => { return !!(row.children && row.children.length > 0); }, diff --git a/apps/web-antd/src/views/system/dept/index.vue b/apps/web-antd/src/views/system/dept/index.vue index 1ac2afeda..ba5d22eda 100644 --- a/apps/web-antd/src/views/system/dept/index.vue +++ b/apps/web-antd/src/views/system/dept/index.vue @@ -123,7 +123,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ - \ No newline at end of file + diff --git a/apps/web-antd/src/views/system/mail/account/data.ts b/apps/web-antd/src/views/system/mail/account/data.ts index 750143ce5..ba90f4ac0 100644 --- a/apps/web-antd/src/views/system/mail/account/data.ts +++ b/apps/web-antd/src/views/system/mail/account/data.ts @@ -4,6 +4,9 @@ import type { SystemMailAccountApi } from '#/api/system/mail/account'; import { z } from '#/adapter/form'; import { DICT_TYPE, getDictOptions } from '#/utils/dict'; +import { useAccess } from '@vben/access'; + +const { hasAccessByCodes } = useAccess(); /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { @@ -187,7 +190,17 @@ export function useGridColumns( nameTitle: '邮箱账号', onClick: onActionClick, }, - name: 'CellOperation' + name: 'CellOperation', + options: [ + { + code: 'edit', + show: hasAccessByCodes(['system:mail-account:update']), + }, + { + code: 'delete', + show: hasAccessByCodes(['system:mail-account:delete']), + } + ], }, }, ]; diff --git a/apps/web-antd/src/views/system/mail/account/index.vue b/apps/web-antd/src/views/system/mail/account/index.vue index f687fefdc..bf42f0108 100644 --- a/apps/web-antd/src/views/system/mail/account/index.vue +++ b/apps/web-antd/src/views/system/mail/account/index.vue @@ -103,7 +103,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ diff --git a/apps/web-antd/src/views/system/notify/message/data.ts b/apps/web-antd/src/views/system/notify/message/data.ts index 3249e23e7..187bfc869 100644 --- a/apps/web-antd/src/views/system/notify/message/data.ts +++ b/apps/web-antd/src/views/system/notify/message/data.ts @@ -4,6 +4,9 @@ import type { SystemNotifyMessageApi } from '#/api/system/notify/message'; import { DICT_TYPE, getDictOptions } from '#/utils/dict'; import { getRangePickerDefaultProps } from '#/utils/date'; +import { useAccess } from '@vben/access'; + +const { hasAccessByCodes } = useAccess(); /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { @@ -153,6 +156,7 @@ export function useGridColumns( { code: 'view', text: '查看', + show: hasAccessByCodes(['system:notify-message:query']), }, ], }, diff --git a/apps/web-antd/src/views/system/notify/my/data.ts b/apps/web-antd/src/views/system/notify/my/data.ts index 67040034c..aeb10d0f1 100644 --- a/apps/web-antd/src/views/system/notify/my/data.ts +++ b/apps/web-antd/src/views/system/notify/my/data.ts @@ -2,7 +2,11 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; import type { SystemNotifyMessageApi } from '#/api/system/notify/message'; +import { getRangePickerDefaultProps } from '#/utils/date'; import { DICT_TYPE, getDictOptions } from '#/utils/dict'; +import { useAccess } from '@vben/access'; + +const { hasAccessByCodes } = useAccess(); /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { @@ -23,6 +27,7 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'RangePicker', componentProps: { allowClear: true, + ...getRangePickerDefaultProps(), }, }, ]; @@ -90,6 +95,7 @@ export function useGridColumns( { code: 'view', text: '查看', + show: hasAccessByCodes(['system:notify-message:query']), }, ], }, diff --git a/apps/web-antd/src/views/system/notify/my/index.vue b/apps/web-antd/src/views/system/notify/my/index.vue index ea0000de8..5b9524a79 100644 --- a/apps/web-antd/src/views/system/notify/my/index.vue +++ b/apps/web-antd/src/views/system/notify/my/index.vue @@ -150,11 +150,11 @@ const [Grid, gridApi] = useVbenVxeGrid({