From 9f89f167710f9996a8c119ffd10669606c9191be Mon Sep 17 00:00:00 2001 From: zhouz <> Date: Wed, 15 Jul 2026 19:57:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A2=84=E8=A7=88=E6=94=B9=E4=B8=BAmess?= =?UTF-8?q?age=E6=8F=90=E7=A4=BA=EF=BC=8C=E4=BF=AE=E5=A4=8DModal=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E9=97=AE=E9=A2=98=E5=92=8C=E6=9D=83=E9=99=90key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/base/codeGen/index.vue | 41 +++++-------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/codeGen/index.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/codeGen/index.vue index ed0b38ef..3bf6899e 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/codeGen/index.vue +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/codeGen/index.vue @@ -7,6 +7,7 @@ import { ref } from 'vue'; import { confirm, Page, useVbenModal } from '@vben/common-ui'; import { isEmpty } from '@vben/utils'; +import { message } from 'antdv-next'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { deleteCodeRule, getCodeRulePage, previewCode } from '#/api/base/codegen'; @@ -70,19 +71,17 @@ async function handleDeleteBatch() { } /** 预览下一个编码 */ -const previewVisible = ref(false); const previewLoading = ref(false); -const previewCodeValue = ref(''); -const previewTitle = ref(''); async function handlePreview(row: BaseCodeRuleApi.CodeRule) { - previewTitle.value = row.ruleName; previewLoading.value = true; - previewVisible.value = true; try { const result = await previewCode(row.ruleCode); - previewCodeValue.value = result ?? ''; + message.success({ + content: `【${row.ruleName}】下一个编码:${result}`, + duration: 5, + }); } catch { - previewCodeValue.value = '预览失败'; + message.error('预览失败'); } finally { previewLoading.value = false; } @@ -145,7 +144,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ label: $t('ui.actionTitle.create', ['编码规则']), type: 'primary', icon: ACTION_ICON.ADD, - auth: ['base:codeGen:create'], + auth: ['base:code-rule:create'], onClick: handleCreate, }, { @@ -153,7 +152,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ type: 'primary', danger: true, icon: ACTION_ICON.DELETE, - auth: ['base:codeGen:delete'], + auth: ['base:code-rule:delete'], disabled: isEmpty(checkedIds), onClick: handleDeleteBatch, }, @@ -167,14 +166,14 @@ const [Grid, gridApi] = useVbenVxeGrid({ label: '预览', type: 'link', icon: ACTION_ICON.SEARCH, - auth: ['base:codeGen:query'], + auth: ['base:code-rule:query'], onClick: handlePreview.bind(null, row), }, { label: $t('common.edit'), type: 'link', icon: ACTION_ICON.EDIT, - auth: ['base:codeGen:update'], + auth: ['base:code-rule:update'], onClick: handleEdit.bind(null, row), }, { @@ -182,7 +181,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ type: 'link', danger: true, icon: ACTION_ICON.DELETE, - auth: ['base:codeGen:delete'], + auth: ['base:code-rule:delete'], popConfirm: { title: $t('ui.actionMessage.deleteConfirm', [row.ruleName]), confirm: handleDelete.bind(null, row), @@ -192,23 +191,5 @@ const [Grid, gridApi] = useVbenVxeGrid({ /> - - - -
- 加载中... -
-
-

规则:{{ previewTitle }}

-

- {{ previewCodeValue }} -

-
-