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