ソースを参照

分支图不出来

zhulizhen1111 4 年 前
コミット
c6d6042565

+ 5 - 8
src/components/Legend/src/legend.vue

@@ -128,7 +128,7 @@ export default {
     props: {
         floors: {
             default: () => {
-                []
+                ;[]
             },
             type: Array
         },
@@ -221,8 +221,8 @@ export default {
                 { editerUrl } = conf
             let floorName = this.floorName ? this.floorName : this.$cookie.get('floorNow')
             let data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}&FloorName=${floorName}&fmapID=${this.fmapID}`
-            console.log('data',data);
-            console.log('this.categoryId',this.categoryId,this.$cookie.get('categoryId'))
+            console.log('data', data)
+            console.log('this.categoryId', this.categoryId, this.$cookie.get('categoryId'))
             let url = editerUrl + 'editer?' + encodeURIComponent(data)
             window.open(url, true)
         },
@@ -306,6 +306,7 @@ export default {
         },
         addFloor() {
             this.isFloor = true
+            this.formatFloor()
         },
         // 新增楼层取消
         cancel() {
@@ -317,11 +318,7 @@ export default {
             this.goToEditer()
         }
     },
-    mounted() {
-        if (this.floors.length > 0) {
-            this.formatFloor()
-        }
-    }
+    mounted() {}
 }
 </script>
 <style lang="less" scoped>

+ 2 - 1
src/components/floorMap/index.vue

@@ -31,7 +31,7 @@ export default {
             appName: '万达可视化系统',
             key: '23f30a832a862c58637a4aadbf50a566',
             mapServerURL: `/wdfn`,
-            canvasWidth: 1100,
+            canvasWidth: 600,
             canvasHeight: 800,
             loading: false, // 限制重复查询
             view: null,
@@ -63,6 +63,7 @@ export default {
         init(floorid) {
             this.loading = true
             this.floorid = floorid
+            this.mapSize()
             setTimeout(() => {
                 if (this.haveFengMap) {
                     this.clearGraphy()

+ 11 - 3
src/views/equipment/eqDialog.vue

@@ -72,7 +72,7 @@
                                     :name='`${value.param.type_code}`'
                                     v-if='value.id.slice(2,4)=="YL" && value.param.type_code.slice(0,3)=="FBT"'
                                 >
-                                    <fenbuPic ref='fenbutu' :typecode='value.param.type_code'></fenbuPic>
+                                    <fenbuPic ref='fenbutu' @openFloorMap='openFloor' :typecode='value.param.type_code'></fenbuPic>
                                 </el-tab-pane>
                             </template>
                         </template>
@@ -154,12 +154,20 @@ export default {
                 this.typecode = this.dialogInfo.children[`${tab.index}`].param.type_code
                 this.diff = this.dialogInfo.children[`${tab.index}`].param.diff
             }
-            if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL' && this.typecode != 'FBT') {
+            if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL' && this.typecode.slice(0, 3) != 'FBT') {
                 this.initImage(this.typecode)
             }
-           
+            if (this.typecode.slice(0, 3) == 'FBT') {
+                this.openFloor()
+            }
+
             this.tabLabel = tab.label
         },
+        // 打开底图
+        openFloor() {
+            console.log(';wwwww')
+            this.$emit('openFloorMap')
+        },
         visibalBox() {
             this.$refs.Dialog.open(this.dialogInfo.id)
         },

+ 13 - 4
src/views/equipment/fenbuPic.vue

@@ -5,7 +5,7 @@
             <Legend :floors='floors' type='0' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`'></Legend>
         </div>
         <floor-list v-if='floors.length>0' :floorsArr='floors' :type='1' @emitFloor='emitFloor' :id='"floor"'></floor-list>
-        <div v-if='floors.length>0'>
+        <div v-show='floors.length>0' class='canvas-box'>
             <floorMap ref='floorMap' :loadName='""' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`' :type='"floor"'></floorMap>
         </div>
         <div class='nodata' v-show='floors.length==0'>
@@ -81,15 +81,20 @@ export default {
                         })
                     })
                 }
-                console.log(this.floors)
+
                 this.floorInfo = this.floors[0]
-                console.log(this.floorInfo.gname)
-                this.$refs.floorMap.init(this.floorInfo.gname)
+
                 this.init()
             })
         },
         init() {
             this.loadName = `${this.floorInfo.code}`
+        },
+        openFloorMap() {
+            console.log('openFloorMap --------------')
+
+            this.getFloorData()
+            this.$refs.floorMap.init(this.floorInfo.gname)
         }
     },
     mounted() {
@@ -110,6 +115,10 @@ export default {
         right: 32px;
         top: 155px;
     }
+    .canvas-box {
+        width: 100%;
+        height: 800px;
+    }
     .nodata {
         height: calc(100%-50px);
         .img1 {