添加页签openPage支持传递参数

This commit is contained in:
RuoYi
2025-04-27 13:43:28 +08:00
parent 2f8a257efd
commit 2d0fc59fc7
2 changed files with 7 additions and 3 deletions

View File

@@ -59,8 +59,10 @@ export default {
return useTagsViewStore().delOthersViews(obj || router.currentRoute.value) return useTagsViewStore().delOthersViews(obj || router.currentRoute.value)
}, },
// 打开tab页签 // 打开tab页签
openPage(url) { openPage(title, url, params) {
return router.push(url) const obj = { path: url, meta: { title: title } }
useTagsViewStore().addView(obj)
return router.push({ path: url, query: params })
}, },
// 修改tab页签 // 修改tab页签
updatePage(obj) { updatePage(obj) {

View File

@@ -288,7 +288,9 @@ function handleSortChange(column, prop, order) {
/** 修改按钮操作 */ /** 修改按钮操作 */
function handleEditTable(row) { function handleEditTable(row) {
const tableId = row.tableId || ids.value[0] 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)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */