From 5179e6773b45ee9782855de2b49cd5d28c01565c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Mon, 17 Oct 2022 16:01:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=BC=96=E8=BE=91=E4=BF=A1=E6=81=AF=E5=90=8E=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=97=E8=A1=A8=E4=B8=8D=E5=88=B7=E6=96=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/gen/index.vue | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue index 3e43e63..6d1c623 100644 --- a/src/views/tool/gen/index.vue +++ b/src/views/tool/gen/index.vue @@ -78,7 +78,7 @@ import importTable from './importTable' import hljs from 'highlight.js' import 'highlight.js/styles/dark.css' // 这里有多个样式,自己可以根据需要切换 import { useClipboard } from '@vueuse/core' -// const route = useRoute() +const route = useRoute() const router = useRouter() const { proxy } = getCurrentInstance() @@ -98,17 +98,28 @@ const data = reactive({ pageNum: 1, pageSize: 10, tableName: undefined, + t: 0 }, preview: { open: false, title: '代码预览', data: {}, - activeName: '0', - }, + activeName: '0' + } }) const { queryParams, preview } = toRefs(data) - +watch( + route, + (val) => { + if (val) { + getList() + } + }, + { + immediate: true + } +) /** 查询表集合 */ function getList() { tableloading.value = true @@ -137,7 +148,7 @@ function handleGenTable(row) { codeGenerator({ tableId: currentSelected.value.tableId, tableName: currentSelected.value.name, - VueVersion: 3, + VueVersion: 3 }) .then((res) => { const { data } = res @@ -205,7 +216,7 @@ function handleEditTable(row) { router.push({ path: '/gen/editTable', - query: { tableId: row.tableId }, + query: { tableId: row.tableId } }) } /** 删除按钮操作 */ @@ -215,7 +226,7 @@ function handleDelete(row) { .$confirm('此操作将永久删除该文件, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', - type: 'warning', + type: 'warning' }) .then(() => { delTable(Ids.toString()).then((res) => { @@ -229,7 +240,7 @@ function handleDelete(row) { .catch(() => { proxy.$message({ type: 'info', - message: '已取消删除', + message: '已取消删除' }) }) }