|
@@ -16,11 +16,16 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { PTopoScene, PTopoParser } from "@/components/editClass/persagy-edit";
|
|
|
-import { SGraphView } from "@persagy-web/graph";
|
|
|
-import { SFloorParser } from "@persagy-web/big/lib";
|
|
|
+import {
|
|
|
+ PTopoScene,
|
|
|
+ PTopoParser,
|
|
|
+ PTopoView,
|
|
|
+} from "@/components/editClass/persagy-edit";
|
|
|
+// import { SGraphView } from "@persagy-web/graph";
|
|
|
+// import { SFloorParser } from "@persagy-web/big/lib";
|
|
|
import topoTooltip from "./topoTooltip.vue";
|
|
|
import { mapState, mapMutations } from "vuex";
|
|
|
+import base64ToFile from "@/utils/base64ToFile";
|
|
|
import bus from "@/bus/bus";
|
|
|
import {
|
|
|
saveGroup,
|
|
@@ -57,7 +62,7 @@ export default {
|
|
|
this.canvasWidth = this.$refs.baseTopo.offsetWidth;
|
|
|
this.canvasHeight = this.$refs.baseTopo.offsetHeight - 10;
|
|
|
this.scene = new PTopoScene();
|
|
|
- this.view = new SGraphView("persagy_topo");
|
|
|
+ this.view = new PTopoView("persagy_topo");
|
|
|
this.view.scene = this.scene;
|
|
|
this.scene.clearCmdStatus = this.clearCmdStatus;
|
|
|
// 初始化bus绑定事件
|
|
@@ -193,6 +198,10 @@ export default {
|
|
|
bus.$on("setItemStatus", (val) => {
|
|
|
this.scene.setItemStatus();
|
|
|
});
|
|
|
+ // 下载图片
|
|
|
+ bus.$on("saveTopoImg", () => {
|
|
|
+ this.view.saveImage(`${this.topoContent.name}.png`, "png");
|
|
|
+ });
|
|
|
// 手动添加设备实例
|
|
|
bus.$on("addEquipment", (val) => {
|
|
|
this.addEquipmentList(val);
|
|
@@ -270,6 +279,8 @@ export default {
|
|
|
this.view.fitSceneToView();
|
|
|
});
|
|
|
},
|
|
|
+ // 生成快照
|
|
|
+ generateSnap() {},
|
|
|
},
|
|
|
watch: {
|
|
|
editCmd(val) {
|