Преглед на файлове

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-bm-guide into develop

YaolongHan преди 4 години
родител
ревизия
0028059506
променени са 6 файла, в които са добавени 60 реда и са изтрити 51 реда
  1. 3 2
      src/components/Legend/src/legend.vue
  2. 54 45
      src/components/floorMap/index.vue
  3. 0 1
      src/components/menuList.vue
  4. 1 1
      src/views/equipment/index.vue
  5. 1 1
      src/views/floorFunc/index.vue
  6. 1 1
      vue.config.js

+ 3 - 2
src/components/Legend/src/legend.vue

@@ -93,7 +93,7 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['plazaId'])
+        ...mapGetters(['plazaId','fmapID'])
     },
     props: ['systemName'],
     components: { lengendView, legendRemarks, lengendEdit },
@@ -162,9 +162,10 @@ export default {
         goToEditer() {
             let FloorID = this.$cookie.get('floorMapId') || 'f1'
             let categoryId = this.$cookie.get('categoryId') || 'LCGN'
+            console.log(this.fmapID)
             const { conf } = window.__systemConf,
                 { editerUrl } = conf
-            let data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}'`
+            let data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}&fmapId=${this.fmapID}'`
             let url = editerUrl + 'editer?' + encodeURIComponent(data)
             window.open(url, true)
         },

+ 54 - 45
src/components/floorMap/index.vue

@@ -19,7 +19,8 @@ import RoomBox from '@/views/room/index'
 import canvasFun from '@/components/floorMap/canvasFun'
 import { readGroup } from '@/api/public'
 import { STopologyParser } from '@/lib/parsers/STopologyParser'
-import { mapGetters } from 'vuex'
+import { mapGetters, mapActions } from 'vuex'
+import { SImageItem } from '@saga-web/graph/lib'
 // import { uuid } from "@/components/mapClass/until";
 let fengmap = null
 
@@ -34,31 +35,45 @@ export default {
             loading: false,
             view: null,
             isQuerying: false, // 限制重复查询
-            urlMsg: {}
+            urlMsg: {},
+            // fmapID:'1001012_42'
         }
     },
     components: { RoomBox, canvasFun },
     computed: {
-        ...mapGetters(['plazaId', 'fmapID'])
+        ...mapGetters(['plazaId','fmapID']),
     },
     methods: {
+        ...mapActions(['getfmapID']),
         init(floorid) {
+            if(!this.fmapID){
+                this.getfmapID().then(()=>{
+                    this.urlMsg.fmapID = this.fmapID
+                    this.getMap(floorid)
+                })
+                return
+            }
+            this.getMap(floorid)
+        },
+        getMap(floorid){
             if (this.isQuerying) {
                 console.log('正在查询...')
                 return
             }
-            console.log(this.fmapID)
             this.isQuerying = true
             this.clearGraphy()
             this.scene = new FloorScene()
             this.scene.selectContainer.connect('listChange', this, this.listChange)
             if (!fengmap) {
-                fengmap = new SFengParser('fengMap', `${this.mapServerURL}/${this.fmapID}`, this.key, this.appName, null)
-
+                fengmap = new SFengParser('fengMap', `${this.mapServerURL}/fmap/${this.fmapID}`, this.key, this.appName, null)
                 fengmap.loadMap(this.fmapID, res => {
                     this.floorList = res
                     this.parserData(floorid)
                 })
+                // 获取主题数据
+                fengmap.loadTheme(`${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`).then(res => {
+                    console.log('获取rf成功', res)
+                })
                 this.readGroup().then(data => {
                     const parserData = new STopologyParser(null)
                     parserData.parseData(data.data.Data[0].Elements)
@@ -100,36 +115,46 @@ export default {
             }
         },
         parserData(floor) {
-            if (this.floorList[floor]) {
-                console.log(this.floorList[floor])
-                fengmap.parseData(this.floorList[floor], res => {
-                    if (res.err) {
-                        console.log(res.err)
-                        return
-                    }
-                    const fParser = new SFloorParser(null)
-                    fParser.parseData(res)
-                    fParser.spaceList.forEach(t => {
-                        t.selectable = true
-                        this.scene.addItem(t)
-                    })
-                    fParser.wallList.forEach(t => this.scene.addItem(t))
-                    fParser.virtualWallList.forEach(t => this.scene.addItem(t))
-                    fParser.doorList.forEach(t => this.scene.addItem(t))
-                    fParser.columnList.forEach(t => this.scene.addItem(t))
-                    fParser.casementList.forEach(t => this.scene.addItem(t))
+            if (floor == 'g80') {
+                // 屋顶
+                if (fengmap.frImg) {
+                    let imgItem = new SImageItem(null,`${this.mapServerURL}/webtheme/${this.fmapID}/${fengmap.frImg}`)
+                    this.scene.addItem(imgItem)
                     this.view.scene = this.scene
                     this.view.fitSceneToView()
                     this.loading = false
                     this.isQuerying = false
-                    console.log('success')
-                })
+                }
             } else {
-                console.log('楼层不正确')
+                if (this.floorList[floor]) {
+                    fengmap.parseData(this.floorList[floor], res => {
+                        if (res.err) {
+                            console.log(res.err)
+                            return
+                        }
+                        const fParser = new SFloorParser(null)
+                        fParser.parseData(res)
+                        fParser.spaceList.forEach(t => {
+                            t.selectable = true
+                            this.scene.addItem(t)
+                        })
+                        fParser.wallList.forEach(t => this.scene.addItem(t))
+                        fParser.virtualWallList.forEach(t => this.scene.addItem(t))
+                        fParser.doorList.forEach(t => this.scene.addItem(t))
+                        fParser.columnList.forEach(t => this.scene.addItem(t))
+                        fParser.casementList.forEach(t => this.scene.addItem(t))
+                        this.view.scene = this.scene
+                        this.view.fitSceneToView()
+                        this.loading = false
+                        this.isQuerying = false
+                        console.log('success')
+                    })
+                } else {
+                    console.log('楼层不正确')
+                }
             }
         },
         clearGraphy() {
-            console.log(new FloorView('canvas'))
             if (this.view) {
                 this.view.scene = null
                 return
@@ -156,7 +181,6 @@ export default {
         },
         // 保存为json
         saveJson() {
-            console.log(2222)
             this.view.saveFloorJson(`1.json`)
         },
         // 缩放
@@ -175,24 +199,9 @@ export default {
             }
             return readGroup(data)
         }
-        // handleFmapID(fmapID) {
-        //     if (fmapID) {
-        //         this.fmapID = fmapID
-        //     }
-        // }
-    },
-    watch: {
-        // '$store.state.fmapID': 'handleFmapID'
     },
+    watch: { },
     mounted() {
-        this.$nextTick(() => {
-            // console.log('-------------')
-            // console.log(this.$store.state.fmapID)
-            // console.log('-------------')
-        })
-        setTimeout(() => {
-            console.log(this.$store.state.fmapID)
-        }, 50000)
         if (window.screen.height == '768') {
             this.canvasWidth = this.$refs.graphy.offsetWidth
             this.canvasHeight = this.$refs.graphy.offsetHeight - 100

+ 0 - 1
src/components/menuList.vue

@@ -56,7 +56,6 @@ export default {
     },
     created() {},
     mounted() {
-        this.$store.dispatch('getfmapID')
         let val = ''
         if (location.pathname.split('/')[3] == 'first') {
             this.modelNum(1)

+ 1 - 1
src/views/equipment/index.vue

@@ -92,7 +92,7 @@ export default {
         emitFloor(item) {
             console.log('item', item)
             this.floorInfo = item
-            // this.$refs.floorMap.init(this.floorInfo.gname)
+            this.$refs.floorMap.init(this.floorInfo.gname)
         },
         dialogVisible(eve) {
             console.log(eve)

+ 1 - 1
src/views/floorFunc/index.vue

@@ -36,7 +36,7 @@ export default {
     methods: {
         emitFloor(item) {
             this.floorInfo = item
-            // this.$refs.floorMap.init(this.floorInfo.gname)
+            this.$refs.floorMap.init(this.floorInfo.gname)
         },
         additionalColl() {
             this.show = !this.show

+ 1 - 1
vue.config.js

@@ -13,7 +13,7 @@ module.exports = {
                 target: 'http://map.wanda.cn',
                 changeOrigin: true,
                 pathRewrite: {
-                    '^/wdfn': '/editor/fmap',
+                    '^/wdfn': '/editor',
                 },
             },
             '/serve': {