Procházet zdrojové kódy

优化全局业务线

qinzhipeng_v před 5 roky
rodič
revize
392cc7ad92

+ 22 - 8
src/layout/components/Navbar.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="navbar">
-    <div>
+    <div class="bizIdSet">
       <!-- <hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> -->
       <!-- <breadcrumb class="breadcrumb-container" /> -->
       <el-dropdown v-show="status" placement="bottom" trigger="click" @command="sumTypeCkeck">
-        <el-button type="primary">
+        <el-button :disabled="bizId" type="primary">
           {{ sumType }}<i class="el-icon-arrow-down el-icon--right" />
         </el-button>
         <el-dropdown-menu slot="dropdown">
@@ -79,7 +79,8 @@ export default {
     ...mapGetters([
       'sidebar',
       'avatar',
-      'status'
+      'status',
+      'bizId'
     ]),
     username() {
       return localStorage.getItem('realname')
@@ -88,6 +89,17 @@ export default {
   created() {
     this.get_bizArr()
   },
+  mounted() {
+    Utils.$on('demo', msg => {
+      const bizId = {}
+      bizId.code = msg
+
+      this.$message({ message: '提示:任务业务线与当前任务业务线不符,系统自动在“3秒后”变更任务业务线为当前业务线!', type: 'error', duration: 10000, offset: 150 })
+      setTimeout(() => {
+        this.sumTypeCkeck(bizId)
+      }, 3000)
+    })
+  },
   methods: {
     remoteMethod(query) {
       if (query !== '') {
@@ -146,11 +158,6 @@ export default {
         })
       })
     },
-    bizchnage(ele) {
-      Utils.$emit('demo', ele)
-      localStorage.setItem('key', ele)
-      window.location.reload()
-    },
     visibleChange(e) {
       if (!e) {
         this.show2 = false
@@ -162,6 +169,13 @@ export default {
   }
 }
 </script>
+<style lang="stylus">
+.bizIdSet .el-button--primary.is-disabled, .el-button--primary.is-disabled:active, .el-button--primary.is-disabled:focus, .el-button--primary.is-disabled:hover {
+    color: #FFF;
+    background-color: #409EFF;
+    border-color: #409EFF;
+}
+</style>
 
 <style lang="scss" scoped>
 .navbar .rotateNone {

+ 1 - 0
src/store/getters.js

@@ -9,6 +9,7 @@ const getters = {
   subMenu: state => state.data.subMenu,
   project: state => state.project.project,
   status: state => state.data.status,
+  bizId: state => state.data.bizId,
   routes: state => state.data.routes
 }
 export default getters

+ 5 - 1
src/store/modules/data.js

@@ -2,7 +2,8 @@ const state = {
   routes: [],
   menu: '',
   subMenu: '',
-  status: false
+  status: false,
+  bizId: false
 }
 
 const mutations = {
@@ -17,6 +18,9 @@ const mutations = {
   },
   SETROUTES(state, value) {
     state.routes = value
+  },
+  SETBIZID: (state, value) => {
+    state.bizId = value
   }
 }
 

+ 8 - 2
src/views/newWeb/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div>
     <iframe :src="envUrl" style="width:100%;" scrolling="no" frameborder="0" :height="iframeHeight" />
+    {{ envUrl }}
   </div>
 </template>
 
@@ -16,8 +17,13 @@ export default {
     }
   },
   computed: {
-    envUrl() {
-      return envTag === 'test' ? 'http://cp-stable.intra.xiaojukeji.com/project/' : ' http://cp-pre.intra.xiaojukeji.com/project/'
+    envUrl: {
+      get() {
+        return envTag === 'test' ? 'http://cp-stable.intra.xiaojukeji.com/project/' : ' http://cp-pre.intra.xiaojukeji.com/project/'
+      },
+      set(newValue) {
+        return envTag === 'test' ? 'http://cp-stable.intra.xiaojukeji.com/project/' : ' http://cp-pre.intra.xiaojukeji.com/project/'
+      }
     }
   },
   mounted() {

+ 11 - 2
src/views/projectManage/taskList/taskViewDetails.vue

@@ -391,6 +391,7 @@ import {
   launchTest
 } from '@/api/taskIndex' // ajax
 import openDialog from '@/views/projectManage/dialog_vue'
+import Utils from '../../../util.js'
 import { launchTestUpdate } from '@/api/projectPage.js'
 import { bugList, bugGetEnum } from '@/api/defectManage'
 import echarts from 'echarts'
@@ -529,10 +530,16 @@ export default {
   },
   created() {
     this.get_list()
+    this.$store.state.data.status = true
+    this.$store.state.data.bizId = true
   },
   mounted() {
     this.get_echarts()
   },
+  destroyed() {
+    this.$store.state.data.status = false
+    this.$store.state.data.bizId = false
+  },
   methods: {
     click_launchTestInfoDOS(e) {
       var url = window.location.href // 获取url中"?"符后的字
@@ -603,6 +610,9 @@ export default {
         this.bugStatus.unshift({ code: -1, msg: '全部' })
       })
       taskGet(this.taskId[1]).then(res => {
+        if (res.data.bizId !== Number(localStorage.getItem('bizId'))) {
+          Utils.$emit('demo', res.data.bizId)
+        }
         this.pauseName = res.data.involveAppString === null ? '' : res.data.involveAppString
         this.task_form = res.data
         this.total = res.total
@@ -1061,8 +1071,7 @@ export default {
           break
         case 4:
           this.modalShow = true
-          console.log(ele, 'dddddd')
-          // this.$nextTick(() => { this.$resfs.createdBug.init(1, ele) })
+          this.$nextTick(() => { this.$refs.createdBug.init(1, ele) })
           break
       }
     }