Browse Source

update 分支图 more选中

zhulizhen1111 4 years ago
parent
commit
1c24ab45c1
1 changed files with 10 additions and 12 deletions
  1. 10 12
      src/views/equipment/eqDialog.vue

+ 10 - 12
src/views/equipment/eqDialog.vue

@@ -141,7 +141,6 @@ export default {
     methods: {
         //打开弹窗
         showModal(item) {
-            debugger
             console.log(item)
             this.visible = true
             this.dialogInfo = item
@@ -157,17 +156,6 @@ export default {
                     this.activeName = this.typecode
                     this.isShowTab()
                     this.initImage(this.typecode)
-                    // if (
-                    //     this.dialogInfo.children[0].id.slice(2, 4) == 'YL' &&
-                    //     this.dialogInfo.children[this.dialogInfo.children.length - 1].param.type_code.slice(0, 3) == 'FBT'
-                    // ) {
-                    //     this.typecode = this.dialogInfo.children[this.dialogInfo.children.length - 1].param.type_code
-                    //     this.activeName = this.typecode
-                    //     // this.showFenbuPic = true
-                    //     // this.$nextTick(() => {
-                    //     //     this.$refs.fenbutu[0] && this.$refs.fenbutu[0].openFloorMap()
-                    //     // })
-                    // }
                 }
             } else {
                 this.activeName = this.dialogInfo.param.tab_code
@@ -304,14 +292,24 @@ export default {
             queryTab({ data, postParams }).then((res) => {
                 this.tabCount = []
                 let data = res.data.data || []
+                let counts = []
                 data.forEach((el) => {
                     this.tabCount.push({
                         count: el.count,
                         system: el.params.system,
                         typecode: el.params.typecode,
                     })
+                    counts.push(el.count)
                 })
                 this.$emit('emitCount', this.tabCount)
+                if (counts.every((el) => el == 0)) {
+                    this.typecode = this.dialogInfo.children[this.dialogInfo.children.length - 1].param.type_code
+                    this.activeName = this.typecode
+                    this.showFenbuPic = true
+                    this.$nextTick(() => {
+                        this.$refs.fenbutu[0] && this.$refs.fenbutu[0].openFloorMap()
+                    })
+                }
             })
         },
         /**