|
@@ -23,6 +23,7 @@ import { Loading } from 'element-ui'
|
|
|
import { Message } from 'element-ui'
|
|
|
// import { SEquipParser } from "../../../sagacloud-web/saga-web-big/src";
|
|
|
import { SEquipmentParser } from '../lib/parsers/SEquipmentParser'
|
|
|
+import { SInfoParser } from '../lib/parsers/SInfoParser'
|
|
|
import { saveJSON } from '../utils/util'
|
|
|
import { SEquipmentItem } from '@/lib/items/SEquipmentItem' // 设备类
|
|
|
|
|
@@ -162,8 +163,8 @@ export default {
|
|
|
const itemMap = {}
|
|
|
// 使用 SEquipmentParser 解析器增加设备
|
|
|
let parserData1 = new SEquipmentParser(null)
|
|
|
- let Equipmnet = Nodes.filter((node) => node.GraphElementType === 'Equipment')
|
|
|
- parserData1.parseData(Equipmnet)
|
|
|
+ let Equipment = Nodes.filter((node) => node.GraphElementType === 'Equipment')
|
|
|
+ parserData1.parseData(Equipment)
|
|
|
parserData1.equipmentItem.map((item) => {
|
|
|
item.selectable = true
|
|
|
item.connect('equipImgLoadOver', this, () => {
|
|
@@ -175,6 +176,17 @@ export default {
|
|
|
console.log(item)
|
|
|
itemMap[item.id] = item
|
|
|
})
|
|
|
+ // 使用信息点解析器,解析信息点数据, 添加信息点
|
|
|
+ let InfoParser = new SInfoParser(null)
|
|
|
+ let InfoItem = Nodes.filter((node) => node.GraphElementType === 'Info')
|
|
|
+ InfoParser.parseData(InfoItem)
|
|
|
+ InfoParser.infoItem.map((item) => {
|
|
|
+ item.selectable = true
|
|
|
+ item.moveable = true
|
|
|
+ this.scene.addItem(item)
|
|
|
+ this.scene.Nodes.push(item)
|
|
|
+ itemMap[item.id] = item
|
|
|
+ })
|
|
|
// 使用STopologyParser 解析器 增加直线,管线桥线
|
|
|
// 多边形(此item需在直线item添加之前添加)
|
|
|
parserData.zoneLegendList.forEach((t) => {
|
|
@@ -417,7 +429,7 @@ export default {
|
|
|
},
|
|
|
// 监听变化
|
|
|
emitChange(itemMsg) {
|
|
|
- console.log('itemMsg', itemMsg)
|
|
|
+ // console.log('itemMsg', itemMsg)
|
|
|
this.chiceItemList = itemMsg.itemList
|
|
|
this.$emit('changeFocusItem', itemMsg)
|
|
|
bus2.$emit('FocusItemChanged', itemMsg)
|
|
@@ -641,9 +653,9 @@ export default {
|
|
|
console.log('%c========', 'color:blue')
|
|
|
// 保存json文件到本地
|
|
|
let jsonData = JSON.stringify(data, null, 2)
|
|
|
- console.log(jsonData)
|
|
|
+ // console.log(jsonData)
|
|
|
let name = `${new Date().getTime()}.json`
|
|
|
- // saveJSON(jsonData, name)
|
|
|
+ saveJSON(jsonData, name)
|
|
|
return true
|
|
|
saveGroup(data)
|
|
|
.then((res) => {
|
|
@@ -750,6 +762,12 @@ export default {
|
|
|
bus.$on('changeInfoProperties', (Properties) => {
|
|
|
this.scene.updateInfoProperties(Properties)
|
|
|
})
|
|
|
+ bus.$on('addInfoAttachObjectIds', () => {
|
|
|
+ this.scene.addInfoAttachObjectIds()
|
|
|
+ })
|
|
|
+ bus.$on('deleteInfoAttachObjectIds', () => {
|
|
|
+ this.scene.deleteInfoAttachObjectIds()
|
|
|
+ })
|
|
|
/** ---------------------信息点Item属性修改--------------------- */
|
|
|
|
|
|
// 改变图例名称
|