diff --git a/apps/web-antd/src/views/system/dept/data.ts b/apps/web-antd/src/views/system/dept/data.ts index 1b112a59..f5728740 100644 --- a/apps/web-antd/src/views/system/dept/data.ts +++ b/apps/web-antd/src/views/system/dept/data.ts @@ -1,8 +1,7 @@ import type { VbenFormSchema } from '#/adapter/form'; -import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { SystemDeptApi } from '#/api/system/dept'; -import { useAccess } from '@vben/access'; import { handleTree } from '@vben/utils'; import { z } from '#/adapter/form'; @@ -10,8 +9,6 @@ import { getDeptList } from '#/api/system/dept'; import { getSimpleUserList } from '#/api/system/user'; import { CommonStatusEnum, DICT_TYPE, getDictOptions } from '#/utils'; -const { hasAccessByCodes } = useAccess(); - /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ @@ -113,7 +110,6 @@ export function useFormSchema(): VbenFormSchema[] { /** 列表的字段 */ export function useGridColumns( - onActionClick?: OnActionClickFn, getLeaderName?: (userId: number) => string | undefined, ): VxeTableGridOptions['columns'] { return [ @@ -154,39 +150,10 @@ export function useGridColumns( formatter: 'formatDateTime', }, { - field: 'operation', title: '操作', - minWidth: 200, - align: 'right', + width: 220, fixed: 'right', - headerAlign: 'center', - showOverflow: false, - cellRender: { - attrs: { - nameField: 'name', - nameTitle: '部门', - onClick: onActionClick, - }, - name: 'CellOperation', - options: [ - { - code: 'append', - text: '新增下级', - show: hasAccessByCodes(['system:dept:create']), - }, - { - code: 'edit', - show: hasAccessByCodes(['system:dept:update']), - }, - { - code: 'delete', - show: hasAccessByCodes(['system:dept:delete']), - disabled: (row: SystemDeptApi.Dept) => { - return !!(row.children && row.children.length > 0); - }, - }, - ], - }, + slots: { default: 'actions' }, }, ]; } diff --git a/apps/web-antd/src/views/system/dept/index.vue b/apps/web-antd/src/views/system/dept/index.vue index 10c1d41e..eb977130 100644 --- a/apps/web-antd/src/views/system/dept/index.vue +++ b/apps/web-antd/src/views/system/dept/index.vue @@ -1,21 +1,18 @@