From 477c5dcfbfb48637ca73f01541fa13e272e46f77 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Fri, 7 Feb 2025 16:03:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=20router.push=20=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=20useGo=20=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=81=A5=E5=A3=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/templates/modules/gen/vue/vueList.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/core/src/main/resources/templates/modules/gen/vue/vueList.xml b/modules/core/src/main/resources/templates/modules/gen/vue/vueList.xml index 3f23c2ba..64c0443f 100644 --- a/modules/core/src/main/resources/templates/modules/gen/vue/vueList.xml +++ b/modules/core/src/main/resources/templates/modules/gen/vue/vueList.xml @@ -105,6 +105,9 @@ if(table.isTreeEntity){ import { useGlobSetting } from '/@/hooks/setting'; import { downloadByUrl } from '/@/utils/file/download'; <% } %> + <% if(@StringUtils.contains(table.tplCategory, '_route')) { %> + import { useGo } from '/@/hooks/web/usePage'; + <% } %> import { router } from '/@/router'; import { Icon } from '/@/components/Icon'; import { BasicTable, BasicColumn, useTable } from '/@/components/Table'; @@ -176,6 +179,9 @@ if(table.isTreeEntity){ icon: meta.icon || 'i-ant-design:book-outlined', value: meta.title || t('${functionNameSimple}管理'), }; + <% if(@StringUtils.contains(table.tplCategory, '_route')) { %> + const go = useGo(); + <% } %> <% if(toBoolean(table.optionMap['isImportExport'])){ %> const loading = ref(false); <% } %> @@ -462,7 +468,7 @@ for(c in table.columnList){ <% if(!@StringUtils.contains(table.tplCategory, '_route')) { %> open${modalOrDrawer}(true, record); <% } else { %> - router.push({ + go({ path: '/${urlPrefix}/formRoute', query: record, });