Ver código fonte

Merge branch 'http_mock' of git.xiaojukeji.com:jacklijiajia/thoth-frontend into http_mock

qinzhipeng_v@didiglobal.com 4 anos atrás
pai
commit
67112fa931

+ 1 - 0
src/views/business/bizIdSelect.vue

@@ -74,6 +74,7 @@ export default {
     },
     enter(biz) {
       this.$store.dispatch('data/setBizId', biz.code)
+      localStorage.setItem('bizId', biz.code)
       this.settingUserSetBiz(biz.code)
       if (!fromRoute || !fromRoute.name) {
         this.$router.push({ name: '项目', query: { bizId: EncryptId(biz.code) }})

+ 16 - 2
src/views/home/index.vue

@@ -254,6 +254,7 @@ img.img-arrow {
 import { mapGetters } from 'vuex'
 import FloatMenu from './floatMenu'
 import { logoutUrl } from '@/apiConfig/requestIP.js'
+import { settingUserGetBiz } from '@/api/projectIndex'
 
 export default {
   components: {
@@ -288,7 +289,17 @@ export default {
       })()
     }
   },
+  created() {
+    this.settingUserGetBiz()
+  },
   methods: {
+    async settingUserGetBiz() { // 获取人员默认业务线
+      const res = await settingUserGetBiz()
+      if (res.code === 200 && res.data) {
+        this.$store.dispatch('data/setBizId', res.data.bizId)
+        localStorage.setItem('bizId', res.data.bizId)
+      }
+    },
     handleSelect(key, keyPath) {
       switch (key) {
         case '1':
@@ -301,8 +312,11 @@ export default {
           this.$router.push({ name: 'jar包管理' })
           break
         case '4' :
-          if (this.bizId === -1) this.$router.push({ name: '业务线选择' })
-          this.$router.push({ name: '项目' })
+          if (!this.bizId || this.bizId === -1) {
+            this.$router.push({ name: '业务线选择' })
+          } else {
+            this.$router.push({ name: '项目' })
+          }
           break
         case '6':
           this.$router.push({ name: '单车' })

+ 5 - 4
src/views/projectManage/taskList/components/reportList.vue

@@ -233,7 +233,7 @@
 </template>
 <script>
 import { mapGetters } from 'vuex'
-import { analysisBizId_id } from '@/utils/crypto-js.js'
+import { EncryptId, analysisBizId_id } from '@/utils/crypto-js.js'
 import {
   dailyReport,
   projectTestReport,
@@ -473,15 +473,16 @@ export default {
     },
 
     toReportView(ele, index) { // 进入报告详情页
+      const bizId_id = EncryptId(`${this.bizId}_${ele.id}`)
       switch (index) {
         case 0:
-          this.$router.push({ name: '日报详情', query: { id: ele.id }})
+          this.$router.push({ name: '日报详情', query: { bizId_id: bizId_id }})
           break
         case 1:
-          this.$router.push({ name: '准出详情', query: { id: ele.id }})
+          this.$router.push({ name: '准出详情', query: { bizId_id: bizId_id }})
           break
         case 2:
-          this.$router.push({ name: '提测详情', query: { id: ele.id }})
+          this.$router.push({ name: '提测详情', query: { bizId_id: bizId_id }})
           break
       }
     },