ソースを参照

feat:编辑多边形加undo redo

YaolongHan 4 年 前
コミット
66534cf0e3
5 ファイル変更19 行追加12588 行削除
  1. 0 12579
      package-lock.json
  2. 4 4
      package.json
  3. 3 1
      src/components/baseEditer.vue
  4. 10 2
      src/lib/FloorScene.ts
  5. 2 2
      src/lib/FloorView.ts

ファイルの差分が大きいため隠しています
+ 0 - 12579
package-lock.json


+ 4 - 4
package.json

@@ -8,10 +8,10 @@
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
-    "@saga-web/base": "^2.1.14",
-    "@saga-web/big": "^1.0.17",
-    "@saga-web/draw": "^2.1.84",
-    "@saga-web/graph": "^2.1.66",
+    "@saga-web/base": "2.1.9",
+    "@saga-web/big": "1.0.16",
+    "@saga-web/draw": "2.1.84",
+    "@saga-web/graph": "2.1.65",
     "@saga-web/feng-map": "1.0.6",
     "@saga-web/topology": "1.0.84",
     "ant-design-vue": "^1.6.0",

+ 3 - 1
src/components/baseEditer.vue

@@ -52,7 +52,8 @@ export default {
         console.log(this.fParser);
         this.fParser.parseData(res);
         this.fParser.spaceList.forEach(t => {
-          t.connect('clicjnnmnk', this, this.spaceClick)
+          t.connect('click', this, this.spaceClick)
+          t.selectable = true;
           this.scene.addItem(t)
         });
         this.fParser.wallList.forEach(t => this.scene.addItem(t));
@@ -101,6 +102,7 @@ export default {
       document.getElementById('canvas').focus()
     },
     spaceClick(space, event) {
+      console.log(this.scene.selectContainer)
       // const item = new SImageItem(null, {
       //   Width: 32,
       //   Height: 32,

+ 10 - 2
src/lib/FloorScene.ts

@@ -1,12 +1,20 @@
-import { SGraphyScene } from '@saga-web/graphy/lib';
+import { SGraphScene } from '@saga-web/graph/lib';
 import { SMouseEvent } from '@saga-web/base/lib';
 import { SPoint } from '@saga-web/draw/lib';
 import { SFloorParser, SImageItem,STextItem,SLineItem,SPolylineItem } from "@saga-web/big";
 
-export class FloorScene extends SGraphyScene {
+export class FloorScene extends SGraphScene {
   isLining: boolean = false;
 
+  constructor(){
+    super();
+    console.log(999999999)
+    this.selectContainer.connect('listChange',this,this.listChange)
+  }
 
+  listChange(){
+    console.log(arguments)
+  }
 
   onMouseDown(event: SMouseEvent): boolean {
     if (this.isLining) {

+ 2 - 2
src/lib/FloorView.ts

@@ -1,4 +1,4 @@
-import { SGraphyItem, SGraphyView } from "@saga-web/graphy/lib";
+import { SGraphItem, SGraphView } from "@saga-web/graph/lib";
 import { SMouseButton, SMouseEvent, SNetUtil } from "@saga-web/base/lib";
 import { SPoint } from "@saga-web/draw/lib";
 
@@ -7,7 +7,7 @@ import { SPoint } from "@saga-web/draw/lib";
  *
  * @author  郝建龙
  */
-export class FloorView extends SGraphyView {
+export class FloorView extends SGraphView {
     /** 鼠标左键键按下时位置 */
     private _leftKeyPos = new SPoint();
     /** 空格是否被按下 */