|
@@ -34,6 +34,12 @@ export default class Change {
|
|
|
JSON.stringify(dataService.getRoadEdges())
|
|
|
);
|
|
|
this.lastData.roads = JSON.parse(JSON.stringify(dataService.getRoads()));
|
|
|
+ this.lastData.curveRoadPoints = JSON.parse(
|
|
|
+ JSON.stringify(dataService.getCurveRoadPoints())
|
|
|
+ );
|
|
|
+ this.lastData.curveRoadEdges = JSON.parse(
|
|
|
+ JSON.stringify(dataService.getCurveRoadEdges())
|
|
|
+ );
|
|
|
this.lastData.curveRoads = JSON.parse(
|
|
|
JSON.stringify(dataService.getCurveRoads())
|
|
|
);
|
|
@@ -55,7 +61,9 @@ export default class Change {
|
|
|
this.compareRoadPoints();
|
|
|
this.compareRoadEdges();
|
|
|
this.compareRoads();
|
|
|
- this.compareCurveRoads();
|
|
|
+ // this.compareCurveRoadPoints();
|
|
|
+ // this.compareCurveRoadEdges();
|
|
|
+ // this.compareCurveRoads();
|
|
|
this.compareCrossPoints();
|
|
|
if (
|
|
|
this.currentData.points.length == 0 &&
|
|
@@ -66,6 +74,9 @@ export default class Change {
|
|
|
this.currentData.roadPoints.length == 0 &&
|
|
|
this.currentData.roadEdges.length == 0 &&
|
|
|
this.currentData.roads.length == 0 &&
|
|
|
+ // this.currentData.curveRoadPoints.length == 0 &&
|
|
|
+ // this.currentData.curveRoadEdges.length == 0 &&
|
|
|
+ // this.currentData.curveRoads.length == 0 &&
|
|
|
this.currentData.crossPoints.length == 0
|
|
|
) {
|
|
|
this.saveCurrentInfo();
|
|
@@ -475,8 +486,59 @@ export default class Change {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ compareCurveRoadPoints() {}
|
|
|
+
|
|
|
compareCurveRoads() {}
|
|
|
|
|
|
+ compareCurveRoadEdges() {
|
|
|
+ this.currentData.curveRoadEdges = [];
|
|
|
+ const curveRoadEdges = dataService.getCurveRoadEdges();
|
|
|
+
|
|
|
+ for (const key in curveRoadEdges) {
|
|
|
+ const curveRoadEdge = curveRoadEdges[key];
|
|
|
+ const lastCurveRoadEdge = this.lastData.curveRoadEdges[key];
|
|
|
+
|
|
|
+ // 不存在意味着增加
|
|
|
+ if (!lastCurveRoadEdge) {
|
|
|
+ const item = {
|
|
|
+ handle: HistoryEvents.AddCurveRoadEdge,
|
|
|
+ curveRoadEdge: historyUtil.getDataForCurveRoadEdge(curveRoadEdge),
|
|
|
+ };
|
|
|
+ this.currentData.curveRoadEdges.push(item);
|
|
|
+ } else {
|
|
|
+ if (
|
|
|
+ !historyUtil.isDifferentForCurveRoadEdges(
|
|
|
+ curveRoadEdge,
|
|
|
+ lastCurveRoadEdge
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ delete this.lastData.curveRoadEdges[key];
|
|
|
+ continue;
|
|
|
+ } else {
|
|
|
+ const item = {
|
|
|
+ handle: HistoryEvents.ModifyCurveRoadEdge,
|
|
|
+ preCurveRoadEdge:
|
|
|
+ historyUtil.getDataForCurveRoadEdge(lastCurveRoadEdge),
|
|
|
+ curCurveRoadEdge:
|
|
|
+ historyUtil.getDataForCurveRoadEdge(curveRoadEdge),
|
|
|
+ };
|
|
|
+ this.currentData.curveRoadEdges.push(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ delete this.lastData.curveRoadEdges[key];
|
|
|
+ }
|
|
|
+
|
|
|
+ for (const key in this.lastData.curveRoadEdges) {
|
|
|
+ const item = {
|
|
|
+ handle: HistoryEvents.DeleteCurveRoadEdge,
|
|
|
+ curveRoadEdge: historyUtil.getDataForCurveRoadEdge(
|
|
|
+ this.lastData.curveRoadEdges[key]
|
|
|
+ ),
|
|
|
+ };
|
|
|
+ this.currentData.curveRoadEdges.push(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
compareCrossPoints() {
|
|
|
this.currentData.crossPoints = [];
|
|
|
const crossPoints = dataService.getCrossPoints();
|