guoxiaohuan 4 years ago
parent
commit
ed13470d1b
2 changed files with 55 additions and 38 deletions
  1. 20 6
      src/components/floorMap/index.vue
  2. 35 32
      src/views/equipment/eqDialog.vue

+ 20 - 6
src/components/floorMap/index.vue

@@ -128,6 +128,10 @@ export default {
                     this.scene.addItem(imgItem)
                     this.view.scene = this.scene
                     this.view.fitSceneToView()
+                    this.view.minScale = this.view.scale
+                    if (this.$refs.canvasFun) {
+                        this.$refs.canvasFun.everyScale = this.view.scale
+                    }
                     this.loading = false
                 }
             } else {
@@ -150,6 +154,10 @@ export default {
                         fParser.casementList.forEach(t => this.scene.addItem(t))
                         this.view.scene = this.scene
                         this.view.fitSceneToView()
+                        this.view.minScale = this.view.scale
+                        if (this.$refs.canvasFun) {
+                            this.$refs.canvasFun.everyScale = this.view.scale
+                        }
                         this.loading = false
                         //console.log('success')
                     })
@@ -167,8 +175,6 @@ export default {
         },
         listChange(item, ev) {
             let name = ev[0][0].data.Name
-            console.log(item, ev)
-
             if (name.slice(name.length - 2, name.length) == '机房') {
                 this.$refs.boxRoom.open({ name: name, type: this.type })
             }
@@ -196,6 +202,7 @@ export default {
                 return
             }
             let scale = this.view.scale
+            console.log(val / scale, this.canvasWidth / 2, this.canvasHeight / 2)
             this.view.scaleByPoint(val / scale, this.canvasWidth / 2, this.canvasHeight / 2)
         },
         // 读取数据
@@ -214,24 +221,31 @@ export default {
                 this.canvasHeight = this.$refs.graphy.offsetHeight - 100
             } else {
                 this.canvasWidth = this.$refs.graphy.offsetWidth
-                this.canvasHeight = 900 + 'px'
+                this.canvasHeight = 900
+            }
+        }
+    },
+    watch: {
+        'view.scale': {
+            handler(n) {
+                if (this.$refs.canvasFun) {
+                    let s = (n * 10) / this.view.minScale
+                    this.$refs.canvasFun.sliderVal = s > 1000 ? 1000 : s
+                }
             }
         }
     },
-    watch: {},
     mounted() {
         this.mapSize()
     },
     created() {
         this.urlMsg = {
-            // categoryId: this.$cookie.get('categoryId') || 'LCGN',
             categoryId: this.$cookie.get('categoryId'),
             ProjectID: this.plazaId,
             BuildingID: '1',
             FloorID: this.$cookie.get('floorMapId') || 'f1',
             fmapID: this.fmapID
         }
-        //console.log('this.urlMsg', this.urlMsg)
     }
 }
 </script>

+ 35 - 32
src/views/equipment/eqDialog.vue

@@ -116,6 +116,7 @@ export default {
         },
         //打开弹窗
         showModal(item) {
+            console.log(item)
             this.visible = true
             this.dialogInfo = item
             if (Object.keys(this.dialogInfo).length > 0 && this.dialogInfo.children.length > 0) {
@@ -169,35 +170,36 @@ export default {
                 system: this.systemName,
                 siteid: '1000423',
                 module: '1002',
-                neTypename: '位置布置图'
+                neTypename: '位置布置图',
+                typecode: typecode
             }
-            switch (this.systemName) {
-                case '暖通系统':
-                    getParams.system = '1002'
-                    break
-                case '消防系统':
-                    getParams.system = '1003'
-                    break
-                case '弱电系统':
-                    getParams.system = '1004'
-                    break
-                case '电梯系统':
-                    getParams.system = '1006'
-                    break
-                case '燃气系统':
-                    getParams.system = '1007'
-                    break
-                case '土建系统':
-                    getParams.system = '1008'
-                    break
-            }
-            if (this.systemName == '给排水系统') {
-                getParams.system = '1005'
-            }
-            if (this.systemName == '供电系统') {
-                getParams.system = '1001'
-            }
-
+            // switch (this.systemName) {
+            //     case '暖通系统':
+            //         getParams.system = '1002'
+            //         break
+            //     case '消防系统':
+            //         getParams.system = '1003'
+            //         break
+            //     case '弱电系统':
+            //         getParams.system = '1004'
+            //         break
+            //     case '电梯系统':
+            //         getParams.system = '1006'
+            //         break
+            //     case '燃气系统':
+            //         getParams.system = '1007'
+            //         break
+            //     case '土建系统':
+            //         getParams.system = '1008'
+            //         break
+            // }
+            // if (this.systemName == '给排水系统') {
+            //     getParams.system = '1005'
+            // }
+            // if (this.systemName == '供电系统') {
+            //     getParams.system = '1001'
+            // }
+            console.log(getParams)
             queryPic({ getParams }).then(res => {
                 this.rotationImg = res.data || []
             })
@@ -212,7 +214,8 @@ export default {
             if (this.dialogInfo.children.length == 0) {
                 postParams.push({
                     params: {
-                        tyepcode: this.dialogInfo.param.type_code
+                        typecode: this.dialogInfo.param.type_code,
+                        module: '1002'
                     },
                     tableName: 'glsms_proimgup'
                 })
@@ -220,15 +223,15 @@ export default {
                 this.dialogInfo.children.forEach(el => {
                     postParams.push({
                         params: {
-                            tyepcode: el.param.type_code
+                            typecode: el.param.type_code,
+                            module: '1002'
                         },
                         tableName: 'glsms_proimgup'
                     })
                 })
             }
-
             queryTab({ data, postParams }).then(res => {
-                //console.log(res)
+                console.log('res', res)
             })
         }
     }