window.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <div>
  3. <canvas id="wall" width="800" height="400" tabindex="0" />
  4. </div>
  5. </template>
  6. <script lang="ts">
  7. import {SGraphScene, SGraphView} from "@persagy-web/graph/";
  8. import {SWindowItem} from "@persagy-web/big/lib/items/floor/SWindowItem";
  9. import { Component, Vue } from "vue-property-decorator";
  10. @Component
  11. export default class WindowCanvas extends Vue {
  12. view: SGraphView | undefined;
  13. outline1 = [[{X:120,Y:-30},{X:120,Y:-50},{X:10,Y:-50},{X:10,Y:-30}]];
  14. mounted(): void {
  15. this.init();
  16. }
  17. init(): void{
  18. this.view = new SGraphView('wall');
  19. const scene = new SGraphScene();
  20. this.view.scene = scene;
  21. // 只模拟了轮廓数据
  22. // @ts-ignore
  23. const item = new SWindowItem(null,{OutLine:this.outline1});
  24. scene.addItem(item);
  25. this.view.fitSceneToView();
  26. this.view.scalable = false;
  27. }
  28. }
  29. </script>
  30. <style scoped>
  31. </style>