|
@@ -16,11 +16,12 @@
|
|
|
</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 +58,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 +194,10 @@ export default {
|
|
|
bus.$on("setItemStatus", (val) => {
|
|
|
this.scene.setItemStatus();
|
|
|
});
|
|
|
+ // 下载图片
|
|
|
+ bus.$on("saveTopoImg", () => {
|
|
|
+ this.view.saveImage(`${this.topoContent.name}.png`, 'png')
|
|
|
+ })
|
|
|
},
|
|
|
// 读取拓扑图
|
|
|
readtopoMsg() {
|
|
@@ -231,6 +236,10 @@ export default {
|
|
|
});
|
|
|
this.view.fitSceneToView()
|
|
|
},
|
|
|
+ // 生成快照
|
|
|
+ generateSnap() {
|
|
|
+
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
editCmd(val) {
|