|
@@ -12,7 +12,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import { SFengParser } from '@saga-web/feng-map'
|
|
|
-import { SFloorParser, ItemOrder } from '@saga-web/big'
|
|
|
+import { SFloorParser, ItemOrder, ItemColor } from '@saga-web/big'
|
|
|
import { FloorView } from '@/lib/FloorView'
|
|
|
import { FloorScene } from '@/lib/FloorScene'
|
|
|
import RoomBox from '@/views/room/index'
|
|
@@ -22,6 +22,7 @@ import { queryShops } from '@/api/equipmentList.js'
|
|
|
import { STopologyParser } from '@/lib/parsers/STopologyParser'
|
|
|
import { mapGetters, mapActions } from 'vuex'
|
|
|
import { SImageItem, SImageShowType } from '@saga-web/graph/lib'
|
|
|
+import { SColor } from '@saga-web/draw/lib'
|
|
|
import bus from '@/utils/bus.js'
|
|
|
|
|
|
// import { uuid } from "@/components/mapClass/until";
|
|
@@ -71,7 +72,7 @@ export default {
|
|
|
this.loading = true
|
|
|
this.floorid = floorid
|
|
|
this.mapSize()
|
|
|
- this.$refs.canvasFun.isShow = false;
|
|
|
+ this.$refs.canvasFun.isShow = false
|
|
|
setTimeout(() => {
|
|
|
this.clearGraphy()
|
|
|
this.scene = new FloorScene()
|
|
@@ -81,11 +82,11 @@ export default {
|
|
|
this.canvasID = `canvas${this.id}`
|
|
|
}
|
|
|
this.parserData(floorid)
|
|
|
- }else if(this.haveFengMap == 0){
|
|
|
- this.view.scene = this.scene;
|
|
|
- this.readGraph()
|
|
|
- }else{
|
|
|
- this.loading = false
|
|
|
+ } else if (this.haveFengMap == 0) {
|
|
|
+ this.view.scene = this.scene
|
|
|
+ this.readGraph()
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
}, 100)
|
|
|
},
|
|
@@ -94,9 +95,9 @@ export default {
|
|
|
// 屋顶
|
|
|
if (window.fengmapData.frImg) {
|
|
|
let imgItem = new SImageItem(null, `${this.mapServerURL}/webtheme/${this.fmapID}/${window.fengmapData.frImg}`)
|
|
|
- imgItem.showType = SImageShowType.AutoFit;
|
|
|
- imgItem.connect('imgLoadOver',this,()=> {
|
|
|
- this.readGraph();
|
|
|
+ imgItem.showType = SImageShowType.AutoFit
|
|
|
+ imgItem.connect('imgLoadOver', this, () => {
|
|
|
+ this.readGraph()
|
|
|
})
|
|
|
this.scene.addItem(imgItem)
|
|
|
this.view.scene = this.scene
|
|
@@ -114,7 +115,7 @@ export default {
|
|
|
this.fParser.spaceList.forEach(t => {
|
|
|
this.scene.addItem(t)
|
|
|
t.nameSize = 12
|
|
|
- t.nameColor = '#2a2a2a';
|
|
|
+ t.nameColor = '#2a2a2a'
|
|
|
if (t.data.Name && this.bunkObj[t.data.Name]) {
|
|
|
t.name = this.bunkObj[t.data.Name].brandname
|
|
|
} else {
|
|
@@ -136,105 +137,107 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- readGraph(){
|
|
|
- this.readGroup(this.floorid).then(data => {
|
|
|
- if (data.Result == 'failure') {
|
|
|
- this.$store.commit('SETISMESSAGE', false)
|
|
|
- this.view.fitSceneToView()
|
|
|
- this.view.minScale = this.view.scale
|
|
|
- if (this.$refs.canvasFun) {
|
|
|
- this.$refs.canvasFun.everyScale = this.view.scale
|
|
|
- }
|
|
|
- this.loading = false;
|
|
|
- return
|
|
|
- } else {
|
|
|
- if (
|
|
|
- data.Data[0].Elements.Nodes.length === 0 &&
|
|
|
- data.Data[0].Elements.Markers.length === 0 &&
|
|
|
- data.Data[0].Elements.Relations.length === 0
|
|
|
- ) {
|
|
|
+ readGraph() {
|
|
|
+ this.readGroup(this.floorid)
|
|
|
+ .then(data => {
|
|
|
+ if (data.Result == 'failure') {
|
|
|
this.$store.commit('SETISMESSAGE', false)
|
|
|
+ this.view.fitSceneToView()
|
|
|
+ this.view.minScale = this.view.scale
|
|
|
+ if (this.$refs.canvasFun) {
|
|
|
+ this.$refs.canvasFun.everyScale = this.view.scale
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
} else {
|
|
|
- this.$store.commit('SETISMESSAGE', true)
|
|
|
+ if (
|
|
|
+ data.Data[0].Elements.Nodes.length === 0 &&
|
|
|
+ data.Data[0].Elements.Markers.length === 0 &&
|
|
|
+ data.Data[0].Elements.Relations.length === 0
|
|
|
+ ) {
|
|
|
+ this.$store.commit('SETISMESSAGE', false)
|
|
|
+ } else {
|
|
|
+ this.$store.commit('SETISMESSAGE', true)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- // 无返回Data处理
|
|
|
- if (!(data.Data && data.Data.length)) {
|
|
|
+ // 无返回Data处理
|
|
|
+ if (!(data.Data && data.Data.length)) {
|
|
|
+ this.view.fitSceneToView()
|
|
|
+ this.view.minScale = this.view.scale
|
|
|
+ if (this.$refs.canvasFun) {
|
|
|
+ this.$refs.canvasFun.everyScale = this.view.scale
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ // 请求回来的备注
|
|
|
+ if (data.Data && data.Data[0].Note) {
|
|
|
+ let note = data.Data[0].Note
|
|
|
+ bus.$emit('queryRemarksMethods', note)
|
|
|
+ } else {
|
|
|
+ bus.$emit('queryRemarksMethods', '')
|
|
|
+ }
|
|
|
+ //土建装饰的图例展示
|
|
|
+ if (this.$cookie.get('categoryId') == 'SCPZ') {
|
|
|
+ let scpzTable = [],
|
|
|
+ arr = []
|
|
|
+ scpzTable = data.Data[0].Elements.Nodes || []
|
|
|
+ console.log(scpzTable)
|
|
|
+ if (scpzTable.length > 0) {
|
|
|
+ scpzTable.forEach(e => {
|
|
|
+ if (e.Properties.ItemExplain) {
|
|
|
+ let obj = e
|
|
|
+ arr.push(obj)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log(arr)
|
|
|
+ this.$store.commit('SETSCPZTABLE', arr)
|
|
|
+ }
|
|
|
+ // 放到后边 $cookie graphId
|
|
|
+ this.$cookie.set('graphId', data.Data[0].ID, 3)
|
|
|
+ if (this.$cookie.get('graphId')) {
|
|
|
+ // 得到graphId 就请求图例
|
|
|
+ // 除土建装饰之外的图例展示 包括楼层功能
|
|
|
+ bus.$emit('queryViewMethods')
|
|
|
+ }
|
|
|
+ this.topologyParser = new STopologyParser(null)
|
|
|
+ this.topologyParser.parseData(data.Data[0].Elements)
|
|
|
+ // 多边形
|
|
|
+ this.topologyParser.zoneLegendList.forEach(t => {
|
|
|
+ this.scene.addItem(t)
|
|
|
+ })
|
|
|
+ // 增加文字
|
|
|
+ this.topologyParser.textMarkerList.forEach(t => {
|
|
|
+ this.scene.addItem(t)
|
|
|
+ })
|
|
|
+ // 增加图片
|
|
|
+ this.topologyParser.imageMarkerList.forEach(t => {
|
|
|
+ this.scene.addItem(t)
|
|
|
+ })
|
|
|
+ // 增加直线
|
|
|
+ this.topologyParser.lineMarkerList.forEach(t => {
|
|
|
+ this.scene.addItem(t)
|
|
|
+ })
|
|
|
+ // 增加图标类图例
|
|
|
+ this.topologyParser.imageLegendList.forEach(t => {
|
|
|
+ this.scene.addItem(t)
|
|
|
+ })
|
|
|
+ // 增加管线类
|
|
|
+ // 增加图标类图例
|
|
|
+ this.topologyParser.relationList.forEach(t => {
|
|
|
+ t.selectable = true
|
|
|
+ this.scene.addItem(t)
|
|
|
+ })
|
|
|
this.view.fitSceneToView()
|
|
|
this.view.minScale = this.view.scale
|
|
|
if (this.$refs.canvasFun) {
|
|
|
this.$refs.canvasFun.everyScale = this.view.scale
|
|
|
}
|
|
|
- return false
|
|
|
- }
|
|
|
- // 请求回来的备注
|
|
|
- if (data.Data && data.Data[0].Note) {
|
|
|
- let note = data.Data[0].Note
|
|
|
- bus.$emit('queryRemarksMethods', note)
|
|
|
- } else {
|
|
|
- bus.$emit('queryRemarksMethods', '')
|
|
|
- }
|
|
|
- //土建装饰的图例展示
|
|
|
- if (this.$cookie.get('categoryId') == 'SCPZ') {
|
|
|
- let scpzTable = [],
|
|
|
- arr = []
|
|
|
- scpzTable = data.Data[0].Elements.Nodes || []
|
|
|
- console.log(scpzTable)
|
|
|
- if (scpzTable.length > 0) {
|
|
|
- scpzTable.forEach(e => {
|
|
|
- if (e.Properties.ItemExplain) {
|
|
|
- let obj = e
|
|
|
- arr.push(obj)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- console.log(arr)
|
|
|
- this.$store.commit('SETSCPZTABLE', arr)
|
|
|
- }
|
|
|
- // 放到后边 $cookie graphId
|
|
|
- this.$cookie.set('graphId', data.Data[0].ID, 3)
|
|
|
- if (this.$cookie.get('graphId')) {
|
|
|
- // 得到graphId 就请求图例
|
|
|
- // 除土建装饰之外的图例展示 包括楼层功能
|
|
|
- bus.$emit('queryViewMethods')
|
|
|
- }
|
|
|
- this.topologyParser = new STopologyParser(null)
|
|
|
- this.topologyParser.parseData(data.Data[0].Elements)
|
|
|
- // 多边形
|
|
|
- this.topologyParser.zoneLegendList.forEach(t => {
|
|
|
- this.scene.addItem(t)
|
|
|
- })
|
|
|
- // 增加文字
|
|
|
- this.topologyParser.textMarkerList.forEach(t => {
|
|
|
- this.scene.addItem(t)
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
- // 增加图片
|
|
|
- this.topologyParser.imageMarkerList.forEach(t => {
|
|
|
- this.scene.addItem(t)
|
|
|
- })
|
|
|
- // 增加直线
|
|
|
- this.topologyParser.lineMarkerList.forEach(t => {
|
|
|
- this.scene.addItem(t)
|
|
|
- })
|
|
|
- // 增加图标类图例
|
|
|
- this.topologyParser.imageLegendList.forEach(t => {
|
|
|
- this.scene.addItem(t)
|
|
|
+ .catch(() => {
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
- // 增加管线类
|
|
|
- // 增加图标类图例
|
|
|
- this.topologyParser.relationList.forEach(t => {
|
|
|
- t.selectable = true
|
|
|
- this.scene.addItem(t)
|
|
|
- })
|
|
|
- this.view.fitSceneToView()
|
|
|
- this.view.minScale = this.view.scale
|
|
|
- if (this.$refs.canvasFun) {
|
|
|
- this.$refs.canvasFun.everyScale = this.view.scale
|
|
|
- }
|
|
|
- this.loading = false;
|
|
|
- }).catch(()=>{
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
},
|
|
|
clearGraphy() {
|
|
|
if (this.view) {
|
|
@@ -318,6 +321,7 @@ export default {
|
|
|
},
|
|
|
// 清除电井关联商铺的高亮状态
|
|
|
clearHightLight() {
|
|
|
+ ItemColor.spaceHighColor = new SColor('#FBF2CC')
|
|
|
for (let key in this.wellMap) {
|
|
|
this.wellMap[key].forEach(item => {
|
|
|
item.highLightFlag = false
|