From 6d63e6450580de465e5ed3561e0e5bc17a9ca169 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 12 Feb 2022 11:36:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9=E5=90=8E=E5=90=8C=E6=AD=A5=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 2 +- src/views/tool/gen/editTable.vue | 2 +- src/views/tool/gen/index.vue | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index a99b3a5..5fb13c0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -139,7 +139,7 @@ export const constantRoutes = [ hidden: true, children: [ { - path: 'index', + path: 'index/:tableId(\\d+)', component: () => import('@/views/tool/gen/editTable'), name: 'GenEdit', meta: { title: '修改生成配置', activeMenu: '/tool/gen' } diff --git a/src/views/tool/gen/editTable.vue b/src/views/tool/gen/editTable.vue index b53a381..74304df 100644 --- a/src/views/tool/gen/editTable.vue +++ b/src/views/tool/gen/editTable.vue @@ -181,7 +181,7 @@ function close() { } (() => { - const tableId = route.query && route.query.tableId; + const tableId = route.params && route.params.tableId; if (tableId) { // 获取表详细信息 getGenTable(tableId).then(res => { diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue index a500b9b..d37e0bb 100644 --- a/src/views/tool/gen/index.vue +++ b/src/views/tool/gen/index.vue @@ -176,6 +176,7 @@ import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/ import router from "@/router"; import importTable from "./importTable"; +const route = useRoute(); const { proxy } = getCurrentInstance(); const tableList = ref([]); @@ -187,6 +188,7 @@ const multiple = ref(true); const total = ref(0); const tableNames = ref([]); const dateRange = ref([]); +const uniqueId = ref(""); const data = reactive({ queryParams: { @@ -205,6 +207,17 @@ const data = reactive({ const { queryParams, preview } = toRefs(data); +onActivated(() => { + const time = route.query.t; + if (time != null && time != uniqueId.value) { + uniqueId.value = time; + queryParams.value.pageNum = Number(route.query.pageNum); + dateRange.value = []; + proxy.resetForm("queryForm"); + getList(); + } +}) + /** 查询表集合 */ function getList() { loading.value = true; @@ -271,7 +284,7 @@ function handleSelectionChange(selection) { /** 修改按钮操作 */ function handleEditTable(row) { const tableId = row.tableId || ids.value[0]; - router.push({ path: "/tool/gen-edit/index", query: { tableId: tableId, pageNum: queryParams.value.pageNum } }); + router.push({ path: "/tool/gen-edit/index/" + tableId, query: { pageNum: queryParams.value.pageNum } }); } /** 删除按钮操作 */ function handleDelete(row) {