From d150475efb77c5b6177a7de518feaa4efa1656c6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 7 Oct 2025 09:40:52 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90antd=E3=80=91=E3=80=90ele?= =?UTF-8?q?=E3=80=91=E3=80=90member=20=E4=BC=9A=E5=91=98=E3=80=91group=20?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=20antd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/views/member/group/data.ts | 39 +++++++++++++++++-- .../web-antd/src/views/member/group/index.vue | 13 +++---- .../src/views/member/group/modules/form.vue | 6 +-- 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/apps/web-antd/src/views/member/group/data.ts b/apps/web-antd/src/views/member/group/data.ts index 938774138..7f8c1afcd 100644 --- a/apps/web-antd/src/views/member/group/data.ts +++ b/apps/web-antd/src/views/member/group/data.ts @@ -10,17 +10,18 @@ import { z } from '#/adapter/form'; export function useFormSchema(): VbenFormSchema[] { return [ { - component: 'Input', fieldName: 'id', + component: 'Input', dependencies: { triggerFields: [''], show: () => false, }, }, { - component: 'Input', fieldName: 'name', label: '分组名称', + component: 'Input', + rules: 'required', }, { fieldName: 'status', @@ -33,6 +34,14 @@ export function useFormSchema(): VbenFormSchema[] { }, rules: z.number().default(CommonStatusEnum.ENABLE), }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + }, + }, ]; } @@ -43,14 +52,28 @@ export function useGridFormSchema(): VbenFormSchema[] { fieldName: 'name', label: '分组名称', component: 'Input', + componentProps: { + placeholder: '请输入分组名称', + allowClear: true, + }, }, { fieldName: 'status', label: '状态', component: 'Select', componentProps: { - allowClear: true, options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + placeholder: '请选择状态', + allowClear: true, + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + placeholder: ['开始日期', '结束日期'], + allowClear: true, }, }, ]; @@ -62,14 +85,23 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'id', title: '编号', + minWidth: 100, }, { field: 'name', title: '分组名称', + minWidth: 150, + }, + { + field: 'remark', + title: '备注', + minWidth: 200, + showOverflow: 'tooltip', }, { field: 'status', title: '状态', + minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.COMMON_STATUS }, @@ -78,6 +110,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'createTime', title: '创建时间', + minWidth: 180, formatter: 'formatDateTime', }, { diff --git a/apps/web-antd/src/views/member/group/index.vue b/apps/web-antd/src/views/member/group/index.vue index b7da6c8cd..095a95d56 100644 --- a/apps/web-antd/src/views/member/group/index.vue +++ b/apps/web-antd/src/views/member/group/index.vue @@ -19,7 +19,7 @@ const [FormModal, formModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } @@ -40,11 +40,9 @@ async function handleDelete(row: MemberGroupApi.Group) { duration: 0, }); try { - await deleteGroup(row.id as number); - message.success({ - content: $t('ui.actionMessage.deleteSuccess', [row.name]), - }); - onRefresh(); + await deleteGroup(row.id!); + message.success($t('ui.actionMessage.deleteSuccess', [row.name])); + handleRefresh(); } finally { hideLoading(); } @@ -71,6 +69,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -82,7 +81,7 @@ const [Grid, gridApi] = useVbenVxeGrid({