xushiting 2 lat temu
rodzic
commit
17574f3554

Plik diff jest za duży
+ 1 - 1
server/test/SS-t-P1d6CwREny2/attach/sceneStore


+ 4 - 0
src/graphic/Coordinate.js

@@ -23,6 +23,10 @@ export default class Coordinate {
     this.res = res;
   }
 
+  getRes() {
+    return this.res;
+  }
+
   // 世界坐标转换成屏幕坐标
   getScreenXY(point) {
     if (this.width == null || this.height == null) {

+ 46 - 1
src/graphic/History/Change.js

@@ -486,7 +486,52 @@ export default class Change {
     }
   }
 
-  compareCurveRoadPoints() {}
+  compareCurveRoadPoints() {
+    this.currentData.curveRoadPoints = [];
+    const curveRoadPoints = dataService.getCurveRoadPoints();
+
+    for (const key in curveRoadPoints) {
+      const curveRoadPoint = curveRoadPoints[key];
+      const lastCurveRoadPoint = this.lastData.curveRoadPoints[key];
+
+      // 不存在意味着增加
+      if (!lastCurveRoadPoint) {
+        const item = {
+          handle: HistoryEvents.AddCurveRoadPoint,
+          curveRoadPoint: historyUtil.getDataForRoadPoint(curveRoadPoint),
+        };
+        this.currentData.curveRoadPoints.push(item);
+      } else {
+        if (
+          !historyUtil.isDifferentForRoadPoints(
+            curveRoadPoint,
+            lastCurveRoadPoint
+          )
+        ) {
+          delete this.lastData.curveRoadPoints[key];
+          continue;
+        } else {
+          const item = {
+            handle: HistoryEvents.ModifyRoadPoint,
+            preRoadPoint: historyUtil.getDataForRoadPoint(lastCurveRoadPoint),
+            curRoadPoint: historyUtil.getDataForRoadPoint(curveRoadPoint),
+          };
+          this.currentData.curveRoadPoints.push(item);
+        }
+      }
+      delete this.lastData.curveRoadPoints[key];
+    }
+
+    for (const key in this.lastData.curveRoadPoints) {
+      const item = {
+        handle: HistoryEvents.DeleteRoadPoint,
+        curveRoadPoint: historyUtil.getDataForRoadPoint(
+          this.lastData.curveRoadPoints[key]
+        ),
+      };
+      this.currentData.curveRoadPoints.push(item);
+    }
+  }
 
   compareCurveRoads() {}
 

+ 6 - 2
src/graphic/Load.js

@@ -100,8 +100,10 @@ export default class Load {
       if (dataLocal.hasOwnProperty("currentId")) {
         dataService.setCurrentId(dataLocal.currentId);
       }
-    }
-    if (data3d) {
+      if (dataLocal.hasOwnProperty("res")) {
+        coordinate.setRes(dataLocal.res);
+      }
+    } else if (data3d) {
       if (data3d.backImage) {
         let bgImg = imageService.create(data3d.backImage, data3d.vectorId);
         bgImg.setCenter(coordinate.center);
@@ -169,11 +171,13 @@ export default class Load {
   }
 
   save() {
+    dataService.vectorData.res = coordinate.getRes();
     return dataService.vectorData;
   }
 
   // 退出页面清除缓存及其他操作
   clear() {
+    this.layer.uiControl.menu_clear();
     console.warn("clear");
   }
 }