|
@@ -20,6 +20,8 @@ import { SPainter, SColor, SFont, SPoint } from "@saga-web/draw";
|
|
|
import store from "../store";
|
|
|
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";
|
|
|
let fengmap = null;
|
|
|
//// 底图空间增加字段 isExtracted:boolean true 已被提取过
|
|
|
export default {
|
|
@@ -235,17 +237,124 @@ export default {
|
|
|
getBus() {
|
|
|
// 添加设备
|
|
|
bus.$on("addEquip", () => {
|
|
|
+ console.log(11111);
|
|
|
// console.log("addEquip");
|
|
|
- console.log('get bus addEquip')
|
|
|
+ console.log("get bus addEquip");
|
|
|
console.log(event);
|
|
|
- this.scene.addEquipment(event);
|
|
|
+ const parserData = new SEquipmentParser(null);
|
|
|
+ // 14d978b7edd346f088d6cfb53ada4070`; //冷冻泵
|
|
|
+ // 4fde075cdafe4e4ea46e876276feab9d`; //水冷螺杆机组
|
|
|
+ // 4aa6051e025d4193a776a5b2d2604ed8 //冷却塔1
|
|
|
+ // ece9f93ffc754035bcec2e8f27d66a59 //冷却塔2
|
|
|
+ let Nodes = [
|
|
|
+ {
|
|
|
+ ID: "", // ID
|
|
|
+ id2: "",
|
|
|
+ Name: "1#冷冻泵", // 名称
|
|
|
+ AttachObjectIds: ["Eq001", "Eq002"], // 返回工程信息化对象 ID 列表
|
|
|
+ Pos: { X: 1770, Y: 1288 }, // 位置
|
|
|
+ Size: { Width: 0, Height: 0 }, // 大小
|
|
|
+ InfoList: [
|
|
|
+ {
|
|
|
+ Code: "", // 对应设备的信息点
|
|
|
+ Name: "温度", //信息点名称
|
|
|
+ X: 770,
|
|
|
+ Y: 288,
|
|
|
+ Width: 100,
|
|
|
+ Height: 25,
|
|
|
+ FontSize: 12,
|
|
|
+ Background: "#000000",
|
|
|
+ TextAlign: "",
|
|
|
+ Color: "#FFFFFF"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Code: "", // 对应设备的信息点
|
|
|
+ Name: "湿度", //信息点名称
|
|
|
+ X: 770,
|
|
|
+ Y: 288,
|
|
|
+ Width: 100,
|
|
|
+ Height: 25,
|
|
|
+ FontSize: 12,
|
|
|
+ Background: "#000000",
|
|
|
+ TextAlign: "",
|
|
|
+ Color: "#FFFFFF"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ Properties: {
|
|
|
+ StatusImage: [
|
|
|
+ {
|
|
|
+ Status: "Running", // 运行
|
|
|
+ ImageKey: "14d978b7edd346f088d6cfb53ada4070"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Status: "Stop", // 停止
|
|
|
+ ImageKey: ""
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Status: "Selected", // 选择
|
|
|
+ ImageKey: ""
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Status: "Warning", // 报警
|
|
|
+ ImageKey: ""
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ } // 由应用自己定义
|
|
|
+ },
|
|
|
+ {
|
|
|
+ ID: "", // ID
|
|
|
+ Name: "2#冷冻泵", // 名称
|
|
|
+ AttachObjectIds: ["Eq001", "Eq002"], // 返回工程信息化对象 ID 列表
|
|
|
+ Pos: { X: 2770, Y: 2288 },
|
|
|
+ Size: { Width: 0, Height: 0 }, // 大小
|
|
|
+ AnchorList: [
|
|
|
+ {
|
|
|
+ ID: "", // 锚点ID
|
|
|
+ Pos: "" // 锚点的坐标
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ OutLine: [
|
|
|
+ [{ X: 0, Y: 0, Z: 0 }] // 外轮廓
|
|
|
+ // 内轮廓
|
|
|
+ ], // 轮廓线
|
|
|
+ InfoList: [
|
|
|
+ {
|
|
|
+ Code: "", // 对应设备的信息点
|
|
|
+ Name: "2#冷冻泵", //信息点名称
|
|
|
+ X: 516,
|
|
|
+ Y: 347,
|
|
|
+ Width: 100,
|
|
|
+ Height: 25,
|
|
|
+ FontSize: 12,
|
|
|
+ Background: "#000000",
|
|
|
+ TextAlign: "",
|
|
|
+ Color: "#FFFFFF"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ Properties: {
|
|
|
+ StatusImage: [
|
|
|
+ {
|
|
|
+ Status: "Running", // 运行
|
|
|
+ ImageKey: "4fde075cdafe4e4ea46e876276feab9d"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ } // 由应用自己定义
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ parserData.parseData(Nodes);
|
|
|
+ parserData.equipmentItem.map(item => {
|
|
|
+ this.scene.addItem(item);
|
|
|
+ });
|
|
|
+ // this.scene.addEquipment(event);
|
|
|
});
|
|
|
// TODO: 修改底图
|
|
|
bus.$on("changeImgUrl", val => {
|
|
|
window.vm = this;
|
|
|
let url = "/serve/topology-wanda/Picture/query/" + val;
|
|
|
+ console.log(url);
|
|
|
this.scene.setBackgroundImgItem(url);
|
|
|
- this.view.fitSceneToView();
|
|
|
+ // 通过监听 scene.bgImg来适配到页面上
|
|
|
+ // this.view.fitSceneToView();
|
|
|
});
|
|
|
bus.$on("changeText", val => {
|
|
|
this.scene.updatedText(val);
|
|
@@ -318,6 +427,9 @@ export default {
|
|
|
message: "上传中,切勿关闭窗口!",
|
|
|
type: "warning"
|
|
|
});
|
|
|
+ console.log("%c========", "color:blue");
|
|
|
+ console.log(data);
|
|
|
+ return true;
|
|
|
saveGroup(data)
|
|
|
.then(res => {
|
|
|
Message.close();
|
|
@@ -508,6 +620,12 @@ export default {
|
|
|
},
|
|
|
deep: true
|
|
|
},
|
|
|
+ // 背景图加载完成后,屏幕适配
|
|
|
+ "scene.bgImg": {
|
|
|
+ handler(v) {
|
|
|
+ this.view.fitSceneToView();
|
|
|
+ }
|
|
|
+ },
|
|
|
// 监听scale的变化
|
|
|
"view.scale": {
|
|
|
handler(scale) {
|