From 092f67b26c5ab06a479341f5af80ea8e1642d43e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 16:08:24 +0800
Subject: [PATCH] 劳保、售后管理-添加导出功能
---
src/plugins/tab.js | 47 +++++++++++++++++++++++++++--------------------
1 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/src/plugins/tab.js b/src/plugins/tab.js
index e1ebcec..16755f0 100644
--- a/src/plugins/tab.js
+++ b/src/plugins/tab.js
@@ -1,64 +1,71 @@
-import store from '@/store'
+import useTagsViewStore from '@/store/modules/tagsView'
import router from '@/router'
export default {
// 鍒锋柊褰撳墠tab椤电
refreshPage(obj) {
- const { path, matched } = router.currentRoute.value;
+ const { path, query, matched } = router.currentRoute.value
if (obj === undefined) {
matched.forEach((m) => {
if (m.components && m.components.default && m.components.default.name) {
if (!['Layout', 'ParentView'].includes(m.components.default.name)) {
- obj = { name: m.components.default.name, path: path };
+ obj = { name: m.components.default.name, path: path, query: query }
}
}
- });
+ })
}
- return store.dispatch('tagsView/delCachedView', obj).then(() => {
- const { path } = obj
+ return useTagsViewStore().delCachedView(obj).then(() => {
+ const { path, query } = obj
router.replace({
- path: '/redirect' + path
+ path: '/redirect' + path,
+ query: query
})
})
},
// 鍏抽棴褰撳墠tab椤电锛屾墦寮�鏂伴〉绛�
closeOpenPage(obj) {
- store.dispatch("tagsView/delView", router.currentRoute.value);
+ useTagsViewStore().delView(router.currentRoute.value)
if (obj !== undefined) {
- return router.push(obj);
+ return router.push(obj)
}
},
// 鍏抽棴鎸囧畾tab椤电
closePage(obj) {
if (obj === undefined) {
- return store.dispatch('tagsView/delView', router.currentRoute.value).then(({ lastPath }) => {
- return router.push(lastPath || '/index');
- });
+ return useTagsViewStore().delView(router.currentRoute.value).then(({ visitedViews }) => {
+ const latestView = visitedViews.slice(-1)[0]
+ if (latestView) {
+ return router.push(latestView.fullPath)
+ }
+ return router.push('/')
+ })
}
- return store.dispatch('tagsView/delView', obj);
+ return useTagsViewStore().delView(obj)
},
// 鍏抽棴鎵�鏈塼ab椤电
closeAllPage() {
- return store.dispatch('tagsView/delAllViews');
+ return useTagsViewStore().delAllViews()
},
// 鍏抽棴宸︿晶tab椤电
closeLeftPage(obj) {
- return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute.value);
+ return useTagsViewStore().delLeftTags(obj || router.currentRoute.value)
},
// 鍏抽棴鍙充晶tab椤电
closeRightPage(obj) {
- return store.dispatch('tagsView/delRightTags', obj || router.currentRoute.value);
+ return useTagsViewStore().delRightTags(obj || router.currentRoute.value)
},
// 鍏抽棴鍏朵粬tab椤电
closeOtherPage(obj) {
- return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute.value);
+ 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) {
- return store.dispatch('tagsView/updateVisitedView', obj);
+ return useTagsViewStore().updateVisitedView(obj)
}
}
--
Gitblit v1.9.3