From 17950a3254f2367dea76f978c6e862341ce50306 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期一, 25 四月 2022 17:50:08 +0800 Subject: [PATCH] 代码生成预览支持复制内容 --- src/views/tool/gen/index.vue | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue index a500b9b..8487547 100644 --- a/src/views/tool/gen/index.vue +++ b/src/views/tool/gen/index.vue @@ -163,6 +163,7 @@ :name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))" :key="key" > + <el-link :underline="false" icon="DocumentCopy" v-copyText="value" v-copyText:callback="copyTextSuccess" style="float:right"> 澶嶅埗</el-link> <pre>{{ value }}</pre> </el-tab-pane> </el-tabs> @@ -176,6 +177,7 @@ import router from "@/router"; import importTable from "./importTable"; +const route = useRoute(); const { proxy } = getCurrentInstance(); const tableList = ref([]); @@ -187,6 +189,7 @@ const total = ref(0); const tableNames = ref([]); const dateRange = ref([]); +const uniqueId = ref(""); const data = reactive({ queryParams: { @@ -204,6 +207,17 @@ }); 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() { @@ -261,6 +275,10 @@ preview.value.activeName = "domain.java"; }); } +/** 澶嶅埗浠g爜鎴愬姛 */ +function copyTextSuccess() { + proxy.$modal.msgSuccess("澶嶅埗鎴愬姛"); +} // 澶氶�夋閫変腑鏁版嵁 function handleSelectionChange(selection) { ids.value = selection.map(item => item.tableId); @@ -271,7 +289,7 @@ /** 淇敼鎸夐挳鎿嶄綔 */ 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) { -- Gitblit v1.9.3