panxiandiao_i 5 жил өмнө
parent
commit
e741f42290

+ 12 - 9
src/views/quality/qualityMeasurement.vue

@@ -22,7 +22,7 @@
       </el-aside>
       <el-main class="combine-table">
         <el-tabs v-model="activeIndexSecondary" @tab-click="handleClick">
-          <el-tab-pane label="质量大盘" name="first">
+          <el-tab-pane :label="guild" name="first">
             <!-- 上线过程 -->
             <h4>1.上线过程</h4>
             <el-table
@@ -480,6 +480,7 @@ export default {
     return {
       handlerData: [],
       onlineProcess: '',
+      guild: '',
       businessData: [],
       DefeatData: [],
       problemData: '',
@@ -523,7 +524,6 @@ export default {
         this.dealWithBusinessDate = JSON.parse(JSON.stringify(this.businessData)) // 深拷贝
         this.dealWithBusinessDate = processFunc(this.dealWithBusinessDate)
         this.pauseTreeNode = this.businessData[0] ? this.businessData[0] : ''
-        this.treeGuide(this.businessData, this.pauseTreeNode.id)
         this.pauseKey = 0
       })
       this.allCountAndProlemGet()
@@ -541,6 +541,7 @@ export default {
     },
     // 部门table数据不需要缺陷数据
     deleteAfter() {
+      this.guild = this.treeGuide(this.dealWithBusinessDate, this.pauseTreeNode.id, this.pauseTreeNode.type).join('/')
       const pretermitSearch = { id: this.pauseTreeNode.id, type: this.pauseKey, startTime: this.timeInterval[0], endTime: this.timeInterval[1] }
       axios.all([getOnlineAllCount(pretermitSearch), getOnlineProblem({ id: this.pauseTreeNode.id })]).then(axios.spread((resAllCount, resProblem) => {
         this.onlineProcess = resAllCount.code === 0 ? resAllCount.data : ''
@@ -551,6 +552,7 @@ export default {
     },
     // 业务线table数据
     allCountAndProlemGet() {
+      this.guild = this.treeGuide(this.dealWithBusinessDate, this.pauseTreeNode.id, this.pauseTreeNode.type).join('/')
       const pretermitSearch = { id: this.pauseTreeNode.id, type: this.pauseKey, startTime: this.timeInterval[0], endTime: this.timeInterval[1] }
       axios.all([getOnlineAllCount(pretermitSearch), getOnlineProblem({ id: this.pauseTreeNode.id }), getOnlineVitium(pretermitSearch)]).then(axios.spread((resAllCount, resProblem, resDefeat) => {
         this.onlineProcess = resAllCount.code === 0 ? resAllCount.data : ''
@@ -623,21 +625,21 @@ export default {
       window.open(href, '_blank')
     },
     // 树形结构导航
-    treeGuide(myArr, id) {
+    treeGuide(myArr, id, type) {
       let res
       // path,存储路径
-      const getPath = (arr, id, path = []) => {
+      const getPath = (arr, id, type, path = []) => {
         return arr.reduce((a, c) => {
-          if (c.id === id) {
+          if (c.id === id && c.type === type) {
             res = [...path, c.name]
           }
-          if (c.children) {
-            return getPath(c.children, id, [...path, c.name])
+          if (c.child) {
+            return getPath(c.child, id, type, [...path, c.name])
           }
         }, [])
       }
-      getPath(myArr, id)
-      console.log(res)
+      getPath(myArr, id, type)
+      return res
     },
     // 业务树
     handleNodeClick(data) {
@@ -649,6 +651,7 @@ export default {
         this.deleteAfter()
         return
       } else if (this.pauseKey === 3 && this.activeIndexSecondary === 'second') {
+        this.guild = this.treeGuide(this.dealWithBusinessDate, this.pauseTreeNode.id, this.pauseTreeNode.type).join('/')
         this.handleClick()
         return
       }