|
@@ -31,14 +31,15 @@ export default {
|
|
|
appName: '万达可视化系统',
|
|
|
key: '23f30a832a862c58637a4aadbf50a566',
|
|
|
mapServerURL: `http://map.wanda.cn/editor`,
|
|
|
- canvasWidth: 1100,
|
|
|
+ canvasWidth: 600,
|
|
|
canvasHeight: 800,
|
|
|
loading: false, // 限制重复查询
|
|
|
view: null,
|
|
|
urlMsg: {},
|
|
|
canvasID: 'canvas',
|
|
|
floorid: '', //楼层id
|
|
|
- topologyParser: null // 解析器数据
|
|
|
+ topologyParser: null, // 解析器数据
|
|
|
+ fParser: null // 底图解析器
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
@@ -50,7 +51,11 @@ export default {
|
|
|
default: '',
|
|
|
type: String
|
|
|
},
|
|
|
-
|
|
|
+ // 弹窗高度,适配底图高度使用
|
|
|
+ modalHeight: {
|
|
|
+ type: [Number, undefined],
|
|
|
+ default: undefined
|
|
|
+ },
|
|
|
loadName: null,
|
|
|
type: null
|
|
|
},
|
|
@@ -63,6 +68,7 @@ export default {
|
|
|
init(floorid) {
|
|
|
this.loading = true
|
|
|
this.floorid = floorid
|
|
|
+ this.mapSize()
|
|
|
setTimeout(() => {
|
|
|
if (this.haveFengMap) {
|
|
|
this.clearGraphy()
|
|
@@ -95,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('楼层不正确')
|
|
@@ -121,19 +126,23 @@ 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)
|
|
|
}
|
|
|
- if (data.Data.length > 0) {
|
|
|
- //console.log(data.data.Data[0].ID)
|
|
|
- this.$cookie.set('graphId', data.Data[0].ID, 3)
|
|
|
+ // 无返回Data处理
|
|
|
+ if (!(data.Data && data.Data.length)) {
|
|
|
+ return false
|
|
|
}
|
|
|
+ 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)
|
|
|
this.topologyParser = new STopologyParser(null)
|
|
|
this.topologyParser.parseData(data.Data[0].Elements)
|
|
|
// 多边形
|
|
@@ -203,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
|
|
|
})
|
|
|
},
|
|
|
// 读取数据
|
|
@@ -219,13 +231,16 @@ export default {
|
|
|
},
|
|
|
// 地图尺寸
|
|
|
mapSize() {
|
|
|
+ this.canvasWidth = this.$refs.graphy.offsetWidth
|
|
|
if (window.screen.height == '768') {
|
|
|
- this.canvasWidth = this.$refs.graphy.offsetWidth
|
|
|
this.canvasHeight = this.$refs.graphy.offsetHeight - 100
|
|
|
} else {
|
|
|
- this.canvasWidth = this.$refs.graphy.offsetWidth
|
|
|
this.canvasHeight = 900
|
|
|
}
|
|
|
+ // 弹窗中底图高度适配
|
|
|
+ if (this.modalHeight) {
|
|
|
+ this.canvasHeight = this.modalHeight
|
|
|
+ }
|
|
|
},
|
|
|
getEvent() {
|
|
|
bus.$on('changeShow', res => {
|
|
@@ -289,6 +304,7 @@ export default {
|
|
|
<style lang="less" scoped>
|
|
|
#floor_base {
|
|
|
position: relative;
|
|
|
+ height: 100%;
|
|
|
.fengMap {
|
|
|
position: fixed;
|
|
|
width: 100px;
|