zhulizhen1111 4 vuotta sitten
vanhempi
commit
185074890b
1 muutettua tiedostoa jossa 38 lisäystä ja 16 poistoa
  1. 38 16
      src/views/equipment/eqDialog.vue

+ 38 - 16
src/views/equipment/eqDialog.vue

@@ -133,7 +133,7 @@ export default {
             tabCount: [],
             sizePic: '',
             imgInfo: {},
-            showFenbuPic: false //显示楼层分布组件
+            showFenbuPic: false, //显示楼层分布组件
         }
     },
     mounted() {},
@@ -141,6 +141,7 @@ export default {
     methods: {
         //打开弹窗
         showModal(item) {
+            debugger
             console.log(item)
             this.visible = true
             this.dialogInfo = item
@@ -156,6 +157,17 @@ 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
@@ -182,6 +194,16 @@ export default {
                 this.diff = this.dialogInfo.children[`${tab.index}`].param.diff
                 this.difference = this.dialogInfo.children[`${tab.index}`].param.difference
             }
+            if (this.dialogInfo.children.length > 0) {
+                this.dialogInfo.children.forEach((el) => {
+                    if (el.label == '分水器支路分布图' || el.label == '消防泵房引出管路分布图') {
+                        this.showFenbuPic = true
+                        this.$nextTick(() => {
+                            this.$refs.fenbutu[0] && this.$refs.fenbutu[0].openFloorMap()
+                        })
+                    }
+                })
+            }
             if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL' && this.typecode.slice(0, 3) != 'FBT') {
                 this.initImage(this.typecode)
             }
@@ -206,7 +228,7 @@ export default {
                 plazaId: this.$store.state.plazaId,
                 module: '1002',
                 neTypename: '位置布置图',
-                typecode: typecode
+                typecode: typecode,
             }
             switch (this.systemName) {
                 case '暖通系统':
@@ -234,12 +256,12 @@ export default {
             if (this.systemName == '供电系统') {
                 getParams.system = '1001'
             }
-            queryPic({ getParams }).then(res => {
+            queryPic({ getParams }).then((res) => {
                 this.rotationImg = res.data || []
                 let img = new Image()
-                img.src = this.rotationImg[0].url
+                img.src = this.rotationImg && this.rotationImg[0] ? this.rotationImg[0].url : ''
                 const vm = this
-                img.onload = function() {
+                img.onload = function () {
                     vm.$set(vm.imgInfo, 'width', img.width)
                     vm.$set(vm.imgInfo, 'height', img.height)
                     if (vm.imgInfo.width > vm.imgInfo.height) {
@@ -255,7 +277,7 @@ export default {
         isShowTab() {
             let data = {
                 plazaId: this.$store.state.plazaId,
-                major: this.systemName.slice(0, 2)
+                major: this.systemName.slice(0, 2),
             }
             let postParams = []
             if (this.dialogInfo.children.length == 0) {
@@ -263,30 +285,30 @@ export default {
                     params: {
                         typecode: this.dialogInfo.param.type_code,
                         system: this.smsxt,
-                        module: '1002'
+                        module: '1002',
                     },
-                    tableName: 'glsms_proimgup'
+                    tableName: 'glsms_proimgup',
                 })
             } else {
-                this.dialogInfo.children.forEach(el => {
+                this.dialogInfo.children.forEach((el) => {
                     postParams.push({
                         params: {
                             typecode: el.param.type_code,
                             system: this.smsxt,
-                            module: '1002'
+                            module: '1002',
                         },
-                        tableName: 'glsms_proimgup'
+                        tableName: 'glsms_proimgup',
                     })
                 })
             }
-            queryTab({ data, postParams }).then(res => {
+            queryTab({ data, postParams }).then((res) => {
                 this.tabCount = []
                 let data = res.data.data || []
-                data.forEach(el => {
+                data.forEach((el) => {
                     this.tabCount.push({
                         count: el.count,
                         system: el.params.system,
-                        typecode: el.params.typecode
+                        typecode: el.params.typecode,
                     })
                 })
                 this.$emit('emitCount', this.tabCount)
@@ -298,8 +320,8 @@ export default {
         closeModal() {
             this.showFenbuPic = false
             this.$emit('closeModal', true)
-        }
-    }
+        },
+    },
 }
 </script>
 <style lang="less" scoped>