|
@@ -38,7 +38,8 @@ export default {
|
|
|
urlMsg: {},
|
|
|
canvasID: 'canvas',
|
|
|
floorid: '', //楼层id
|
|
|
- topologyParser: null // 解析器数据
|
|
|
+ topologyParser: null, // 解析器数据
|
|
|
+ fParser: null // 底图解析器
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
@@ -100,24 +101,23 @@ export default {
|
|
|
console.log('errr', res.err)
|
|
|
return
|
|
|
}
|
|
|
- const fParser = new SFloorParser(null)
|
|
|
- fParser.parseData(res)
|
|
|
- fParser.spaceList.forEach(t => {
|
|
|
+ this.fParser = new SFloorParser(null)
|
|
|
+ this.fParser.parseData(res)
|
|
|
+ this.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.fParser.wallList.forEach(t => this.scene.addItem(t))
|
|
|
+ this.fParser.virtualWallList.forEach(t => this.scene.addItem(t))
|
|
|
+ this.fParser.doorList.forEach(t => this.scene.addItem(t))
|
|
|
+ this.fParser.columnList.forEach(t => this.scene.addItem(t))
|
|
|
+ this.fParser.casementList.forEach(t => this.scene.addItem(t))
|
|
|
this.view.scene = this.scene
|
|
|
this.view.minScale = this.view.scale
|
|
|
if (this.$refs.canvasFun) {
|
|
|
this.$refs.canvasFun.everyScale = this.view.scale
|
|
|
}
|
|
|
this.view.fitSceneToView()
|
|
|
- //console.log('success')
|
|
|
})
|
|
|
} else {
|
|
|
console.log('楼层不正确')
|
|
@@ -126,23 +126,20 @@ export default {
|
|
|
this.readGroup(this.floorid).then(data => {
|
|
|
this.loading = false
|
|
|
if (data.Result == 'failure') {
|
|
|
- // 取消 失败时的提示: 图不存在
|
|
|
- /* this.$message({
|
|
|
- message: data.Message,
|
|
|
- type: 'warning'
|
|
|
- }) */
|
|
|
this.$store.commit('SETISMESSAGE', false)
|
|
|
return
|
|
|
- // 一会回来存这个
|
|
|
} else {
|
|
|
this.$store.commit('SETISMESSAGE', true)
|
|
|
}
|
|
|
- // FIXME: Cannot read property '0' of undefined
|
|
|
// 无返回Data处理
|
|
|
if (!(data.Data && data.Data.length)) {
|
|
|
return false
|
|
|
- //console.log(data.data.Data[0].ID)
|
|
|
- // this.$cookie.set('graphId', data.Data[0].ID, 3)
|
|
|
+ }
|
|
|
+ if (this.$cookie.get('categoryId') == 'SCPZ') {
|
|
|
+ let scpzTable = []
|
|
|
+ scpzTable = data.Data[0].Elements.Nodes || []
|
|
|
+ console.log(scpzTable)
|
|
|
+ this.$store.commit('SETSCPZTABLE', scpzTable)
|
|
|
}
|
|
|
// 放到后边 $cookie graphId
|
|
|
this.$cookie.set('graphId', data.Data[0].ID, 3)
|
|
@@ -215,8 +212,11 @@ export default {
|
|
|
this.view.scaleByPoint(val / scale, this.canvasWidth / 2, this.canvasHeight / 2)
|
|
|
},
|
|
|
showText(val) {
|
|
|
- this.topologyParser.zoneLegendList.forEach(t => {
|
|
|
- t.showText = val
|
|
|
+ // this.topologyParser.zoneLegendList.forEach(t => {
|
|
|
+ // t.showText = val
|
|
|
+ // })
|
|
|
+ this.fParser.spaceList.forEach(t => {
|
|
|
+ t.showBaseName = val
|
|
|
})
|
|
|
},
|
|
|
// 读取数据
|