|
@@ -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() {}
|
|
|
|