Преглед изворни кода

Merge branch 'http_test' into qz_daily_0.0.4

qinzhipeng_v@didiglobal.com пре 4 година
родитељ
комит
617eee9bdd
3 измењених фајлова са 31 додато и 4 уклоњено
  1. 10 0
      src/App.vue
  2. 15 2
      src/components/newLayout/Main.vue
  3. 6 2
      src/views/projectManage/taskList/taskIndex.vue

+ 10 - 0
src/App.vue

@@ -33,8 +33,18 @@ export default {
   created() {
     this.initRoutes()
     this.initOmegaTracker()
+    // this.settingUserGetBiz()
   },
   methods: {
+    // async settingUserGetBiz() { // 刷新页面
+    //   if (this.$store.state.global.bizId === -1) {
+    //     const res = await settingUserGetBiz()
+    //     if (res.code === 200) {
+    //       console.log(res.data)
+    //       this.$store.dispatch('global/setBizId', res.data.bizId)
+    //     }
+    //   }
+    // },
     initOmegaTracker() {
       try {
         window.log = OmegaTracker.getTracker(config)

+ 15 - 2
src/components/newLayout/Main.vue

@@ -8,7 +8,7 @@
       'no-sidebar': !showNavTag
     }"
   >
-    <div class="main-wrapper" @click="listenClick">
+    <div v-if="showpage" class="main-wrapper" @click="listenClick">
       <router-view />
     </div>
   </div>
@@ -21,7 +21,8 @@ import { settingGetBizList, settingUserGetBiz } from '@/api/projectIndex'
 export default {
   data() {
     return {
-      bizIdList: [] // 业务线列表
+      bizIdList: [], // 业务线列表
+      showpage: false
     }
   },
   computed: {
@@ -35,7 +36,19 @@ export default {
       immediate: true
     }
   },
+  created() {
+    this.settingUserGetBiz()
+  },
   methods: {
+    async settingUserGetBiz() { // 刷新页面
+      if (this.$store.state.global.bizId === -1) {
+        const res = await settingUserGetBiz()
+        if (res.code === 200) {
+          this.showpage = true
+          this.$store.dispatch('global/setBizId', res.data.bizId)
+        }
+      }
+    },
     // 获取业务线列表
     async settingGetBizList() {
       const res = await settingGetBizList({})

+ 6 - 2
src/views/projectManage/taskList/taskIndex.vue

@@ -349,6 +349,11 @@ export default {
     this.bugDataGet()
     this.$store.state.data.status = true
   },
+  mounted() {
+    this.$nextTick(() => {
+      this.bugDataGet()
+    })
+  },
   destroyed() {
     this.$store.state.data.status = false
   },
@@ -499,10 +504,9 @@ export default {
       }
     },
     bugDataGet() { // 所属模块
-      console.log(this.$store.state.global)
       this.biz = this.bizId
       if (this.bizId === -1) {
-        this.biz = localStorage.getItem('bizId')
+        this.biz = this.$store.state.global.bizId
       }
       settingQueryBizModuleList(this.biz).then(res => {
         this.business_platform_Modular = this.getRequireData(res.data)