|
@@ -25,6 +25,7 @@ import {
|
|
|
PTopoParser,
|
|
|
PTopoView,
|
|
|
} from "@/components/editClass/persagy-edit";
|
|
|
+import { SBaseEquipment } from "@persagy-web/big-edit";
|
|
|
import topoTooltip from "./topoTooltip.vue";
|
|
|
import zoom from "./zoom";
|
|
|
import { mapState, mapMutations } from "vuex";
|
|
@@ -120,6 +121,7 @@ export default {
|
|
|
"EDITEQUIPITEM",
|
|
|
"SETVERSION",
|
|
|
"SETVBACKGROUND",
|
|
|
+ "SYNCSCENCEEQUIp",
|
|
|
]),
|
|
|
// 恢复命令状态
|
|
|
clearCmdStatus() {
|
|
@@ -169,11 +171,15 @@ export default {
|
|
|
bus.$off("topoUndo");
|
|
|
bus.$on("topoUndo", (val) => {
|
|
|
this.scene.undo();
|
|
|
+ //撤销后 scence中设备与vuex设备数组做同步
|
|
|
+ this.SyncVuex();
|
|
|
});
|
|
|
// 重做
|
|
|
bus.$off("topoRedo");
|
|
|
bus.$on("topoRedo", (val) => {
|
|
|
this.scene.redo();
|
|
|
+ //撤销后 scence中设备与vuex设备数组做同步
|
|
|
+ this.SyncVuex();
|
|
|
});
|
|
|
// 删除
|
|
|
bus.$off("deleteItem");
|
|
@@ -252,6 +258,16 @@ export default {
|
|
|
this.scene.changeBackgroundColor(val);
|
|
|
});
|
|
|
},
|
|
|
+ // 同步场景与vuex设备数据
|
|
|
+ SyncVuex() {
|
|
|
+ const arr = [];
|
|
|
+ this.scene.root.children.forEach((item) => {
|
|
|
+ if (item instanceof SBaseEquipment) {
|
|
|
+ arr.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.SYNCSCENCEEQUIp(arr);
|
|
|
+ },
|
|
|
// 读取拓扑图
|
|
|
readtopoMsg() {
|
|
|
const obj = {
|