Parcourir la source

说明书底图调整

haojianlong il y a 4 ans
Parent
commit
7b6c21909b
2 fichiers modifiés avec 26 ajouts et 8 suppressions
  1. 23 5
      src/components/floorMap/index.vue
  2. 3 3
      vue.config.js

+ 23 - 5
src/components/floorMap/index.vue

@@ -23,24 +23,40 @@ export default {
         return {
             appName: '万达可视化系统',
             key: '23f30a832a862c58637a4aadbf50a566',
-            mapServerURL: '/wanda',
-            fmapID: '1001724_29',
+            mapServerURL: `/wdfn`,
+            fmapID: '1000423_120', // 2020-6-18 磊哥发 1000423 大连高新万达
             fmap: null,
             canvasWidth: 1100,
             canvasHeight: 800,
             fParser: null,
             loading: true,
-            view: null
+            view: null,
+            isQuerying: false, // 限制重复查询
         }
     },
     components: { RoomBox, canvasFun },
     methods: {
         init(floorid) {
+            if (this.isQuerying) {
+                console.log("正在查询");
+                // this.$message.warning('正在查询')
+                return
+            }
+            this.isQuerying = true;
             this.clearGraphy()
             this.scene = new FloorScene()
             this.scene.selectContainer.connect('listChange', this, this.listChange)
-            this.fmap = new SFengParser('fengMap', this.mapServerURL, this.key, this.appName, null)
-            this.fmap.parseData('1001724_29', Number(floorid), res => {
+            this.fmap = new SFengParser('fengMap', `${this.mapServerURL}/${this.fmapID}`, this.key, this.appName, null)
+            if (isNaN(Number(floorid))) {
+                console.log('楼层id错误')
+                // this.$message.warning("楼层id错误");
+                floorid = 1;
+            }
+            this.fmap.parseData(this.fmapID, Number(floorid), res => {
+                if (res.err) {
+                    console.log(res.err);
+                    return;
+                }
                 this.fParser = new SFloorParser(null)
                 this.fParser.parseData(res)
                 this.fParser.spaceList.forEach(t => {
@@ -55,6 +71,8 @@ export default {
                 this.view.scene = this.scene
                 this.view.fitSceneToView()
                 this.loading = false
+                this.isQuerying = false;
+                console.log('success')
             })
         },
         clearGraphy() {

+ 3 - 3
vue.config.js

@@ -9,11 +9,11 @@ module.exports = {
                     "^/data": "",
                 },
             },
-            "/wanda": {
-                target: "http://map.wanda.cn/editor/fmap/1001724_29",
+            '/wdfn': {
+                target: 'http://map.wanda.cn',
                 changeOrigin: true,
                 pathRewrite: {
-                    "^/wanda": "",
+                    '^/wdfn': '/editor/fmap',
                 },
             },
             "/serve": {