diff --git a/apps/web-antd/src/views/system/dict/data.ts b/apps/web-antd/src/views/system/dict/data.ts index 48ab6c72..531531bc 100644 --- a/apps/web-antd/src/views/system/dict/data.ts +++ b/apps/web-antd/src/views/system/dict/data.ts @@ -1,16 +1,10 @@ import type { VbenFormSchema } from '#/adapter/form'; -import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { SystemDictDataApi } from '#/api/system/dict/data'; -import type { SystemDictTypeApi } from '#/api/system/dict/type'; - -import { useAccess } from '@vben/access'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { z } from '#/adapter/form'; import { getSimpleDictTypeList } from '#/api/system/dict/type'; import { CommonStatusEnum, DICT_TYPE, getDictOptions } from '#/utils'; -const { hasAccessByCodes } = useAccess(); - // ============================== 字典类型 ============================== /** 类型新增/修改的表单 */ @@ -96,9 +90,7 @@ export function useTypeGridFormSchema(): VbenFormSchema[] { } /** 类型列表的字段 */ -export function useTypeGridColumns( - onActionClick: OnActionClickFn, -): VxeTableGridOptions['columns'] { +export function useTypeGridColumns(): VxeTableGridOptions['columns'] { return [ { field: 'id', @@ -136,29 +128,10 @@ export function useTypeGridColumns( formatter: 'formatDateTime', }, { - minWidth: 120, title: '操作', - field: 'operation', + width: 160, fixed: 'right', - align: 'center', - cellRender: { - attrs: { - nameField: 'type', - nameTitle: '字典类型', - onClick: onActionClick, - }, - name: 'CellOperation', - options: [ - { - code: 'edit', - show: hasAccessByCodes(['system:dict:update']), - }, - { - code: 'delete', - show: hasAccessByCodes(['system:dict:delete']), - }, - ], - }, + slots: { default: 'actions' }, }, ]; } @@ -310,9 +283,7 @@ export function useDataGridFormSchema(): VbenFormSchema[] { /** * 字典数据表格列 */ -export function useDataGridColumns( - onActionClick: OnActionClickFn, -): VxeTableGridOptions['columns'] { +export function useDataGridColumns(): VxeTableGridOptions['columns'] { return [ { field: 'id', @@ -360,29 +331,10 @@ export function useDataGridColumns( formatter: 'formatDateTime', }, { - minWidth: 120, title: '操作', - field: 'operation', + width: 160, fixed: 'right', - align: 'center', - cellRender: { - attrs: { - nameField: 'label', - nameTitle: '字典数据', - onClick: onActionClick, - }, - name: 'CellOperation', - options: [ - { - code: 'edit', - show: hasAccessByCodes(['system:dict:update']), - }, - { - code: 'delete', - show: hasAccessByCodes(['system:dict:delete']), - }, - ], - }, + slots: { default: 'actions' }, }, ]; } diff --git a/apps/web-antd/src/views/system/dict/modules/data-grid.vue b/apps/web-antd/src/views/system/dict/modules/data-grid.vue index 0725a0b5..151c8a9c 100644 --- a/apps/web-antd/src/views/system/dict/modules/data-grid.vue +++ b/apps/web-antd/src/views/system/dict/modules/data-grid.vue @@ -1,8 +1,5 @@