From 1d2f37bfe138fcbfa316d817a8b8fbccdf0ba2be Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期一, 15 八月 2022 12:07:45 +0800
Subject: [PATCH] 修复图片预览组件src属性为null值控制台报错问题(I5KBAS)
---
src/views/tool/gen/index.vue | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue
index a500b9b..262edee 100644
--- a/src/views/tool/gen/index.vue
+++ b/src/views/tool/gen/index.vue
@@ -161,8 +161,9 @@
v-for="(value, key) in preview.data"
:label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
:name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
- :key="key"
+ :key="value"
>
+ <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