From 2d0fc59fc78276112a74ecefed87b5f8f14763c2 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期日, 27 四月 2025 13:43:28 +0800
Subject: [PATCH] 添加页签openPage支持传递参数

---
 src/views/tool/gen/index.vue |    4 +++-
 src/plugins/tab.js           |    6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/plugins/tab.js b/src/plugins/tab.js
index 440271e..16755f0 100644
--- a/src/plugins/tab.js
+++ b/src/plugins/tab.js
@@ -59,8 +59,10 @@
     return useTagsViewStore().delOthersViews(obj || router.currentRoute.value)
   },
   // 鎵撳紑tab椤电
-  openPage(url) {
-    return router.push(url)
+  openPage(title, url, params) {
+    const obj = { path: url, meta: { title: title } }
+    useTagsViewStore().addView(obj)
+    return router.push({ path: url, query: params })
   },
   // 淇敼tab椤电
   updatePage(obj) {
diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue
index e83d286..d179f09 100644
--- a/src/views/tool/gen/index.vue
+++ b/src/views/tool/gen/index.vue
@@ -288,7 +288,9 @@
 /** 淇敼鎸夐挳鎿嶄綔 */
 function handleEditTable(row) {
   const tableId = row.tableId || ids.value[0]
-  router.push({ path: "/tool/gen-edit/index/" + tableId, query: { pageNum: queryParams.value.pageNum } })
+  const tableName = row.tableName || tableNames.value[0]
+  const params = { pageNum: queryParams.value.pageNum }
+  proxy.$tab.openPage("淇敼[" + tableName + "]鐢熸垚閰嶇疆", '/tool/gen-edit/index/' + tableId, params)
 }
 
 /** 鍒犻櫎鎸夐挳鎿嶄綔 */

--
Gitblit v1.9.3