Ver código fonte

跳转任务页面

wangcahngsheng 11 meses atrás
pai
commit
732c4c5689
3 arquivos alterados com 44 adições e 27 exclusões
  1. 7 2
      src/components/gatewaynNewPage.vue
  2. 7 1
      src/views/Login.vue
  3. 30 24
      src/views/homePage.vue

+ 7 - 2
src/components/gatewaynNewPage.vue

@@ -373,8 +373,13 @@
             ]
         },
         mounted() {
-            this.getYearSeasonData()
-            this.getDeptNoticeData()
+            if (!this.$route?.query?.taskInfo) {
+                this.getYearSeasonData()
+                this.getDeptNoticeData()
+            } else {
+                this.$router.push({ path: "/taskCenter", query: this.$route.query})
+            }
+            
         },
         methods: {
             // 获取首页年份和季度数据

+ 7 - 1
src/views/Login.vue

@@ -97,6 +97,7 @@ export default {
                 this.ememberMe = false
             }
         }
+        
     },
     methods:{
         handleLogin() {
@@ -191,7 +192,12 @@ export default {
                     // setToken('purview', JSON.stringify(datas.data.data))
                     window.localStorage.setItem('purview', JSON.stringify(datas.data.data))
                     if (that.isMobile === 'PC') {
-                        that.$router.push({ path: "/home"})
+                        if (!that.$route?.query?.taskInfo) {
+                            that.$router.push({ path: "/home"})
+                            
+                        } else {
+                            that.$router.push({ path: "/taskCenter", query: that.$route.query})
+                        }
                     } else {
                         that.$router.push({ path: "/mobeil"})
                     }

+ 30 - 24
src/views/homePage.vue

@@ -75,8 +75,35 @@
             }
         },
         created() {
-            this.getMenuData()
-
+            if (!this.$route?.query?.taskInfo) {
+                this.getMenuData()
+                if (window.sessionStorage.getItem('routeTags')) {
+                    this.routeTags = JSON.parse(window.sessionStorage.getItem('routeTags'))
+                    if (this.$route?.path === '/') {
+                        this.$router.push({
+                            path: this.routeTags[0].index
+                        })
+                    }
+                } else {
+                    this.routeTags = [{
+                        index: '/home',
+                        name: '考评首页'
+                    }]
+                    this.$router.push({
+                        path: this.routeTags[0].index
+                    })
+                    window.sessionStorage.setItem('routeTags', JSON.stringify(this.routeTags))
+                }
+                if (window.sessionStorage.getItem('user')) {
+                    let obj = JSON.parse(window.sessionStorage.getItem('user'))
+                    this.userName = obj.name
+                    this.getPersonMsg(obj.id)
+                }
+            } else {
+                this.$router.push({ path: "/taskCenter", query: this.$route.query})
+            }
+            
+            
             // this.forecastDatas = [{
             //         index: '/home',
             //         name: '考评首页',
@@ -253,28 +280,7 @@
             //         ]
             //     },
             // ]
-            if (window.sessionStorage.getItem('routeTags')) {
-                this.routeTags = JSON.parse(window.sessionStorage.getItem('routeTags'))
-                if (this.$route?.path === '/') {
-                    this.$router.push({
-                        path: this.routeTags[0].index
-                    })
-                }
-            } else {
-                this.routeTags = [{
-                    index: '/home',
-                    name: '考评首页'
-                }]
-                this.$router.push({
-                    path: this.routeTags[0].index
-                })
-                window.sessionStorage.setItem('routeTags', JSON.stringify(this.routeTags))
-            }
-            if (window.sessionStorage.getItem('user')) {
-                let obj = JSON.parse(window.sessionStorage.getItem('user'))
-                this.userName = obj.name
-                this.getPersonMsg(obj.id)
-            }
+            
         },
         mounted() {