From 69a99ee693d14706a05ffc477c55a014e59861e2 Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Mon, 11 Aug 2025 11:25:43 +0800 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20=E5=AE=A2=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=A1=A8=E6=A0=BC=E6=8C=89=E9=92=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/license/customer/data.ts | 31 ++----------- .../src/views/license/customer/index.vue | 46 ++++++++++--------- 2 files changed, 27 insertions(+), 50 deletions(-) diff --git a/apps/web-antd/src/views/license/customer/data.ts b/apps/web-antd/src/views/license/customer/data.ts index d8aaf73..14515d1 100644 --- a/apps/web-antd/src/views/license/customer/data.ts +++ b/apps/web-antd/src/views/license/customer/data.ts @@ -1,11 +1,9 @@ import type { VbenFormSchema } from '#/adapter/form'; -import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { CustomerApi } from '#/api/license/customer'; import { ref } from 'vue'; -import { useAccess } from '@vben/access'; - import { z } from '#/adapter/form'; import { isCustomerCodeUnique, @@ -15,8 +13,6 @@ import { getAreaTree } from '#/api/system/area'; import { $t } from '#/locales'; import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; -const { hasAccessByCodes } = useAccess(); - export const formData = ref(); /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { @@ -193,9 +189,7 @@ export function useGridFormSchema(): VbenFormSchema[] { } /** 列表的字段 */ -export function useGridColumns( - onActionClick?: OnActionClickFn, -): VxeTableGridOptions['columns'] { +export function useGridColumns(): VxeTableGridOptions['columns'] { return [ { field: 'name', @@ -258,26 +252,7 @@ export function useGridColumns( minWidth: 200, align: 'center', fixed: 'right', - headerAlign: 'center', - showOverflow: false, - cellRender: { - attrs: { - nameField: 'name', - nameTitle: $t('customer.customer'), - onClick: onActionClick, - }, - name: 'CellOperation', - options: [ - { - code: 'edit', - show: hasAccessByCodes(['license:customer:update']), - }, - { - code: 'delete', - show: hasAccessByCodes(['license:customer:delete']), - }, - ], - }, + slots: { default: 'actions' }, }, ]; } diff --git a/apps/web-antd/src/views/license/customer/index.vue b/apps/web-antd/src/views/license/customer/index.vue index 10c1371..60aa055 100644 --- a/apps/web-antd/src/views/license/customer/index.vue +++ b/apps/web-antd/src/views/license/customer/index.vue @@ -1,8 +1,5 @@