Browse Source

页面优化

lilei 3 years ago
parent
commit
4497a763d2

+ 2 - 0
src/components/MultiTab/MultiTab.vue

@@ -65,6 +65,7 @@ export default {
       if (!this.tabsList.includes(this.activeKey)) {
       if (!this.tabsList.includes(this.activeKey)) {
         this.selectedLastPath()
         this.selectedLastPath()
       }
       }
+      this.$store.state.app.isCloseTab = true
     },
     },
     selectedLastPath () {
     selectedLastPath () {
       this.activeKey = this.tabsList[this.tabsList.length - 1]
       this.activeKey = this.tabsList[this.tabsList.length - 1]
@@ -220,6 +221,7 @@ export default {
         }
         }
         this.activeKey = newVal.name
         this.activeKey = newVal.name
       }
       }
+      this.$store.state.app.isCloseTab = false
     },
     },
     activeKey: function (newPathKey) {
     activeKey: function (newPathKey) {
       const pages = this.pages.find(item => item.name == newPathKey)
       const pages = this.pages.find(item => item.name == newPathKey)

+ 2 - 1
src/store/getters.js

@@ -17,7 +17,8 @@ const getters = {
   nowRoute: state => state.app.nowRoute,
   nowRoute: state => state.app.nowRoute,
   isShowVideo: state => state.app.isShowVideo,
   isShowVideo: state => state.app.isShowVideo,
   isNewTab: state => state.app.isNewTab,
   isNewTab: state => state.app.isNewTab,
-  isNewSubTab: state => state.app.isNewSubTab
+  isNewSubTab: state => state.app.isNewSubTab,
+  isCloseTab: state => state.app.isCloseTab
 }
 }
 
 
 export default getters
 export default getters

+ 1 - 0
src/store/modules/app.js

@@ -28,6 +28,7 @@ const app = {
     nowRoute: '', // 当前路由
     nowRoute: '', // 当前路由
     isShowVideo: false, // 是否显示视频弹窗
     isShowVideo: false, // 是否显示视频弹窗
     isNewTab: false,
     isNewTab: false,
+    isCloseTab: false, // 是否关闭了当前页签
     isNewSubTab: false,
     isNewSubTab: false,
     updateList: false,
     updateList: false,
     winHeight: 0 //  窗口高度
     winHeight: 0 //  窗口高度

+ 1 - 0
src/views/reportData/stockIncomeReport/list.vue

@@ -284,6 +284,7 @@ export default {
     }
     }
   },
   },
   deactivated () {
   deactivated () {
+    console.log('deactivated', this.$store.state.app.isCloseTab)
     off(window, 'resize', this.chartResize)
     off(window, 'resize', this.chartResize)
   },
   },
   beforeDestroy () {
   beforeDestroy () {