Forráskód Böngészése

feat:解决冲突

YaolongHan 4 éve
szülő
commit
c12a1aeae0

+ 11 - 11
package-lock.json

@@ -1067,17 +1067,17 @@
       "integrity": "sha512-gnItoKBjjv+kbcDfnY8f9EMMVPRJgXXgebdSEj2NTsNmygpdsjQBaqQ6AfDUYzRaWwP53sdmFHeidOCYcqg0RA=="
     },
     "@saga-web/big": {
-      "version": "1.0.30",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/big/-/big-1.0.30.tgz",
-      "integrity": "sha512-qgjsEb0BkWz6hIhoOEGv4zTdR9dyqawzXlh5Wm72v/qyhh8FseVC0k+HoXafsDusSuJMDaDZ3APj++Tuhqd+TA==",
+      "version": "1.0.31",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/big/-/big-1.0.31.tgz",
+      "integrity": "sha512-l9I2Pn9O8CusI5Bu8w1/vzIFmEK2nFTvcuMdy4OBwsVzsin6Wabq2rQr2dWDKJ5g7K2K3OvQAVVEcCZCTCW5Rw==",
       "requires": {
-        "@saga-web/graph": "2.1.74"
+        "@saga-web/graph": "2.1.75"
       }
     },
     "@saga-web/draw": {
-      "version": "2.1.87",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/draw/-/draw-2.1.87.tgz",
-      "integrity": "sha512-bXS4gCZg6i5R1ByA9KKBdn3kge1ntf4pMfOJg+fvIOvf+m6+MIKIlRNKqwdIKu6jJgpC0YMsWkySNDlUb0j15Q==",
+      "version": "2.1.88",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/draw/-/draw-2.1.88.tgz",
+      "integrity": "sha512-3gVbrgo3Qsqoi0t5Hwz4c98UYJPKJ7BXsu/zO5OFzF/Y0nykS6XG2jQLnMnXd+QqWhhJvOasrQHcQyvJlA3lUA==",
       "requires": {
         "@saga-web/base": "^2.1.16"
       }
@@ -1091,11 +1091,11 @@
       }
     },
     "@saga-web/graph": {
-      "version": "2.1.74",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.74.tgz",
-      "integrity": "sha512-aVFxIPWia7QEBhY7IFR27NFxayahe4tU7LEXer1HxUJzcK7Mch0jt9vEZWf8eERLOBPzQhr38PyqRgapN1RLAg==",
+      "version": "2.1.75",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.75.tgz",
+      "integrity": "sha512-LpIskX94jy560KDIjiHlO3404KprZWKOb07jDCNfCP2l/1+PHlqApT3WAoSZWWMziKUjq0+y65wkE6wpO9m5dg==",
       "requires": {
-        "@saga-web/draw": "2.1.87"
+        "@saga-web/draw": "2.1.88"
       }
     },
     "@saga-web/graphy": {

+ 3 - 3
package.json

@@ -9,9 +9,9 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.16",
-    "@saga-web/big": "1.0.30",
-    "@saga-web/draw": "2.1.87",
-    "@saga-web/graph": "2.1.74",
+    "@saga-web/big": "1.0.31",
+    "@saga-web/draw": "2.1.88",
+    "@saga-web/graph": "2.1.75",
     "@saga-web/feng-map": "1.0.7",
     "@saga-web/topology": "1.0.84",
     "ant-design-vue": "^1.6.0",

+ 7 - 50
src/components/baseEditer.vue

@@ -1,4 +1,4 @@
-left_toolbar<template>
+<template>
   <div id="baseEditer">
     <div id="fengMap"></div>
     <div class="canvas-container" ref="graphy">
@@ -8,19 +8,9 @@ left_toolbar<template>
 </template>
 <script>
 import { SFengParser } from "@saga-web/feng-map";
-import { SPoint } from "@saga-web/draw/lib";
-import {
-  SFloorParser,
-  SImageItem,
-  STextItem,
-  SLineItem,
-  SPolylineItem
-} from "@saga-web/big";
-import { SPolygonItem } from "./mapClass/SPolygonItem";
+import { SFloorParser } from "@saga-web/big";
 import { FloorView } from "./../lib/FloorView";
-import { FloorScene } from "./../lib/FloorScene";
 import { EditScence } from "./mapClass/EditScence";
-import { SRelationState } from "@saga-web/big/lib/enums/SRelationState";
 export default {
   props: {
     cmd: {
@@ -52,7 +42,6 @@ export default {
     init() {
       document.getElementById(`canvas`).focus();
       this.clearGraphy();
-      // this.scene = new FloorScene();
       this.scene = new EditScence();
       // 选择绑定选额item事件
       this.scene.selectContainer.connect("listChange", this, this.listChange);
@@ -64,20 +53,18 @@ export default {
         null
       );
       this.fmap.parseData("1001724_29", 6, res => {
-        console.log(res);
         this.fParser = new SFloorParser(null);
-        console.log(this.fParser);
         this.fParser.parseData(res);
-        this.fParser.spaceList.forEach(t => {
-          t.connect("click", this, this.spaceClick);
-          t.selectable = true;
-          this.scene.addItem(t);
-        });
         this.fParser.wallList.forEach(t => this.scene.addItem(t));
         this.fParser.virtualWallList.forEach(t => this.scene.addItem(t));
         this.fParser.doorList.forEach(t => this.scene.addItem(t));
         this.fParser.columnList.forEach(t => this.scene.addItem(t));
         this.fParser.casementList.forEach(t => this.scene.addItem(t));
+        this.fParser.spaceList.forEach(t => {
+          t.selectable = true
+          // t.connect("click", this, this.spaceClick);
+          this.scene.addItem(t);
+        });
         this.view.scene = this.scene;
         this.view.fitSceneToView();
       });
@@ -86,17 +73,6 @@ export default {
     listChange(itemList) {
       this.$emit("changeFocusItem", itemList.itemList);
     },
-    // 引入折线
-    // DirectRelationItem() {
-    //   const data = {
-    //     PointList: [
-    //       { X: -138.71000000089407, Y: -17.5 },
-    //       { X: -130.31000000052154, Y: -17.5 }
-    //     ]
-    //   };
-    //   const directRelationItem = new DirectRelationItem(null, data);
-    //   this.scene.addItem(directRelationItem);
-    // },
     clearGraphy() {
       if (this.view) {
         this.view.scene = null;
@@ -104,25 +80,6 @@ export default {
       }
       this.view = new FloorView("canvas");
       document.getElementById("canvas").focus();
-    },
-    spaceClick(space, event) {
-      console.log(this.scene.selectContainer);
-      // const item = new SImageItem(null, {
-      //   Width: 32,
-      //   Height: 32,
-      //   Url: "https://dss2.bdstatic.com/6Ot1bjeh1BF3odCf/it/u=1569891320,3644984535&fm=85&app=52&f=JPEG?w=121&h=75&s=891B0FD8964406EF8091EA200300E056"
-      // })
-      // const item = new SImageItem(null);
-      // item.moveTo(event[0].x, event[0].y)
-      // item.url = 'https://dss2.bdstatic.com/6Ot1bjeh1BF3odCf/it/u=1569891320,3644984535&fm=85&app=52&f=JPEG?w=121&h=75&s=891B0FD8964406EF8091EA200300E056'
-      // item.font.size = 12;
-      // item.zOrder = 999;
-      // item.connect('mousedown', this, this.iconClick)
-      // this.scene.addItem(item)
-      // setInterval(() => { item.text += '魔' }, 1000)
-    },
-    iconClick(item, event) {
-      console.log(2222222222222);
     }
   },
   watch: {

+ 2 - 10
src/components/edit/left_toolbar.vue

@@ -24,19 +24,11 @@
       </li>
     </ul>
     <ul class="list-2">
-      <!-- v-on:mouseout="mouseoutActive(item)"
-        v-on:mouseover="mouseoverActive(item)"
-        v-for="(item,i) in systemChoice"
-        :key="i"
-        @click="showDrawer(item)"
-      >
-        <div class="item">
-          <img v-show="!item.isHover" :src="require(`./../../assets/images/${item.img}`)" alt />
-      <img v-show="item.isHover" :src="require(`./../../assets/images/${item.hoverImg}`)" alt />-->
       <li
         v-on:mouseout="mouseoutActive(item)"
         v-on:mouseover="mouseoverActive(item)"
         v-for="(item,i) in systemChoice"
+        @click="showDrawer(item)"
         :key="i"
       >
         <div class="item">
@@ -200,7 +192,7 @@ export default {
         item.isChoice = false;
       });
       item.isChoice = true;
-      this.$emit("toolActionClick", item);
+      this.$emit("setCmd", item.cmd);
     },
     showDrawer(item) {
       if (item.name == "管线桥架") {

+ 8 - 3
src/components/mapClass/editScence.ts

@@ -51,6 +51,8 @@ export class EditScence extends SGraphScene {
     addLine(event: SMouseEvent): boolean {
         const item = new SLineItem(null, new SPoint(event.x, event.y));
         this.addItem(item);
+        item.connect("finishCreated", this, this.finishCreated);
+        item.zOrder = ItemOrder.lineOrder
         this.grabItem = item;
         this.undoStack.push(new SGraphAddCommand(this, item));
         // item.connect("onMove", this, this.onItemMove.bind(this));
@@ -65,6 +67,7 @@ export class EditScence extends SGraphScene {
         const item = new TipelineItem(null, [point]);
         //设置状态
         item.status = SItemStatus.Create;
+        item.zOrder = ItemOrder.polylineOrder
         this.addItem(item);
         item.connect("finishCreated", this, this.finishCreated);
         // this.undoStack.push(new SGraphAddCommand(this, item));
@@ -83,7 +86,8 @@ export class EditScence extends SGraphScene {
         Polylines.selectable = true;
         //设置状态
         Polylines.setStatus = SItemStatus.Create;
-        const point = new SPoint(event.x, event.y)
+        const point = new SPoint(event.x, event.y);
+        Polylines.zOrder = ItemOrder.polygonOrder;
         Polylines.setPointList = [point];
         this.addItem(Polylines);
         Polylines.connect("finishCreated", this, this.finishCreated);
@@ -98,7 +102,7 @@ export class EditScence extends SGraphScene {
         const url = require('./../../assets/logo.png')
         const item = new SImageItem(null);
         item.url = url;
-        item.zOrder = 400;
+        item.zOrder = ItemOrder.imageOrder;
         item.selectable = true;
         item.moveTo(event.x, event.y);
         this.addItem(item);
@@ -114,6 +118,7 @@ export class EditScence extends SGraphScene {
         const item = new STextItem(null, '请在右侧属性栏输入文字!');
         item.moveTo(event.x, event.y);
         item.selectable = true;
+        item.zOrder = ItemOrder.textOrder;
         this.addItem(item);
         this.grabItem == null
         this.cmd = 0;
@@ -176,7 +181,7 @@ export class EditScence extends SGraphScene {
     /**
      * 完成事件创建的回调函数
      */
-    finishCreated(item:any){
+    finishCreated(item: any) {
         this.setCmd = 0;
         this.focusItem = item;
         this.selectContainer.toggleItem(item)

+ 10 - 4
src/views/editer.vue

@@ -7,7 +7,7 @@
     <div class="content">
       <!-- 左侧工具栏 -->
       <div class="left_toolbar">
-        <leftToolbar @toolActionClick="toolActionClick" :cmd="cmd"></leftToolbar>
+        <leftToolbar @setCmd="setCmd" :cmd="cmd"></leftToolbar>
       </div>
       <!-- 绘制界面 -->
       <div class="baseEdit">
@@ -33,10 +33,16 @@ import rightToolbar from "@/components/edit/right_toolbar.vue";
 
 export default {
   name: "wandaEditer",
+  data() {
+    return {
+      cmd: 0,
+      focusItemList:null
+    };
+  },
   components: {
     baseEditer,
-    baseEditertest,
-    baseEditerzy,
+    // baseEditertest,
+    // baseEditerzy,
     leftToolbar,
     topToolbar,
     rightToolbar
@@ -44,7 +50,7 @@ export default {
   methods: {
     // 左侧工具栏 点击事件
     toolActionClick(name) {
-      this.$refs.graphy.changeStatus(name);
+     this.cmd = cmd;
     },
     setCmd(cmd) {
       this.cmd = cmd;