From 2becb1b09d00139209e343edeaa1f5ce5272c4ff Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 8 Sep 2025 22:53:18 +0800 Subject: [PATCH] =?UTF-8?q?reactor=EF=BC=9A=E3=80=90system=20=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=AE=A1=E7=90=86=E3=80=91menu=20=E8=BF=9B=E4=B8=80?= =?UTF-8?q?=E6=AD=A5=E7=BB=9F=E4=B8=80=E4=BB=A3=E7=A0=81=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/views/system/menu/data.ts | 7 +++ apps/web-antd/src/views/system/menu/index.vue | 24 +++++----- .../src/views/system/menu/modules/form.vue | 23 +++++----- apps/web-antd/src/views/system/user/data.ts | 2 - apps/web-ele/src/views/system/menu/data.ts | 2 - apps/web-ele/src/views/system/menu/index.vue | 45 ++----------------- 6 files changed, 33 insertions(+), 70 deletions(-) diff --git a/apps/web-antd/src/views/system/menu/data.ts b/apps/web-antd/src/views/system/menu/data.ts index 209c1a7e7..477c91f7b 100644 --- a/apps/web-antd/src/views/system/menu/data.ts +++ b/apps/web-antd/src/views/system/menu/data.ts @@ -271,6 +271,7 @@ export function useGridColumns(): VxeTableGridOptions['colum { field: 'name', title: '菜单名称', + minWidth: 250, align: 'left', fixed: 'left', slots: { default: 'name' }, @@ -279,6 +280,7 @@ export function useGridColumns(): VxeTableGridOptions['colum { field: 'type', title: '菜单类型', + minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_MENU_TYPE }, @@ -287,22 +289,27 @@ export function useGridColumns(): VxeTableGridOptions['colum { field: 'sort', title: '显示排序', + minWidth: 100, }, { field: 'permission', title: '权限标识', + minWidth: 200, }, { field: 'path', title: '组件路径', + minWidth: 200, }, { field: 'componentName', title: '组件名称', + minWidth: 200, }, { field: 'status', title: '状态', + minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.COMMON_STATUS }, diff --git a/apps/web-antd/src/views/system/menu/index.vue b/apps/web-antd/src/views/system/menu/index.vue index 2e9cf8f5f..3ff14471a 100644 --- a/apps/web-antd/src/views/system/menu/index.vue +++ b/apps/web-antd/src/views/system/menu/index.vue @@ -23,7 +23,7 @@ const [FormModal, formModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } @@ -34,7 +34,7 @@ function handleCreate() { /** 添加下级菜单 */ function handleAppend(row: SystemMenuApi.Menu) { - formModalApi.setData({ pid: row.id }).open(); + formModalApi.setData({ parentId: row.id }).open(); } /** 编辑菜单 */ @@ -46,15 +46,12 @@ function handleEdit(row: SystemMenuApi.Menu) { async function handleDelete(row: SystemMenuApi.Menu) { const hideLoading = message.loading({ content: $t('ui.actionMessage.deleting', [row.name]), - key: 'action_key_msg', + duration: 0, }); try { await deleteMenu(row.id as number); - message.success({ - content: $t('ui.actionMessage.deleteSuccess', [row.name]), - key: 'action_key_msg', - }); - onRefresh(); + message.success($t('ui.actionMessage.deleteSuccess', [row.name])); + handleRefresh(); } finally { hideLoading(); } @@ -62,7 +59,7 @@ async function handleDelete(row: SystemMenuApi.Menu) { /** 切换树形展开/收缩状态 */ const isExpanded = ref(false); -function toggleExpand() { +function handleExpand() { isExpanded.value = !isExpanded.value; gridApi.grid.setAllTreeExpand(isExpanded.value); } @@ -84,6 +81,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -94,7 +92,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ transform: true, reserve: true, }, - } as VxeTableGridOptions, + } as VxeTableGridOptions, }); @@ -108,8 +106,8 @@ const [Grid, gridApi] = useVbenVxeGrid({ - - + +