소스 검색

修复选项卡点击右键刷新丢失参数问题

RuoYi 4 년 전
부모
커밋
fa75346763
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      ruoyi-ui/src/plugins/tab.js

+ 5 - 4
ruoyi-ui/src/plugins/tab.js

@@ -4,20 +4,21 @@ import router from '@/router';
4 4
 export default {
5 5
   // 刷新当前tab页签
6 6
   refreshPage(obj) {
7
-    const { path, matched } = router.currentRoute;
7
+    const { path, query, matched } = router.currentRoute;
8 8
     if (obj === undefined) {
9 9
       matched.forEach((m) => {
10 10
         if (m.components && m.components.default && m.components.default.name) {
11 11
           if (!['Layout', 'ParentView'].includes(m.components.default.name)) {
12
-            obj = { name: m.components.default.name, path: path };
12
+            obj = { name: m.components.default.name, path: path, query: query };
13 13
           }
14 14
         }
15 15
       });
16 16
     }
17 17
     return store.dispatch('tagsView/delCachedView', obj).then(() => {
18
-      const { path } = obj
18
+      const { path, query } = obj
19 19
       router.replace({
20
-        path: '/redirect' + path
20
+        path: '/redirect' + path,
21
+        query: query
21 22
       })
22 23
     })
23 24
   },