Prechádzať zdrojové kódy

Merge branch 'dev' of http://192.168.0.115:3000/bill/traffic-laser into dev

xzw 1 rok pred
rodič
commit
ec05ba875f

+ 36 - 32
src/components/base/components/loading/index.js

@@ -1,39 +1,43 @@
-import Loading from './Loading'
-import { mount } from '../../utils/componentHelper'
+import Loading from "./Loading";
+import { mount } from "../../utils/componentHelper";
 
-const seat = 1
-const closeStack = []
+const seat = 1;
+const closeStack = [];
 Loading.use = function use(app) {
-    Loading.show = function (config, key) {
-        if (closeStack.length) {
-            closeStack.push({ key, close: seat })
-        } else {
-            const { destroy } = mount(Loading, {
-                app,
-                props: { ...config },
-            })
-            closeStack.push({ key, close: destroy })
-        }
+  Loading.show = function (config, key) {
+    if (closeStack.length) {
+      closeStack.push({ key, close: seat });
+    } else {
+      const { destroy } = mount(Loading, {
+        app,
+        props: { ...config },
+      });
+      closeStack.push({ key, close: destroy });
     }
-    Loading.hide = function (hkey) {
-        if (closeStack.length) {
-            const { key } = closeStack[closeStack.length - 1]
-            if (key === hkey) {
-                const { close } = closeStack.pop()
-                if (close !== seat) {
-                    close()
-                }
-            }
+
+    // setTimeout(() => {
+    //   Loading.hide();
+    // }, 3000);
+  };
+  Loading.hide = function (hkey) {
+    if (closeStack.length) {
+      const { key } = closeStack[closeStack.length - 1];
+      if (key === hkey) {
+        const { close } = closeStack.pop();
+        if (close !== seat) {
+          close();
         }
+      }
     }
-    Loading.hideAll = function () {
-        for (const { close } of closeStack) {
-            if (typeof close === 'function') {
-                close()
-            }
-        }
-        closeStack.length = 0
+  };
+  Loading.hideAll = function () {
+    for (const { close } of closeStack) {
+      if (typeof close === "function") {
+        close();
+      }
     }
-}
+    closeStack.length = 0;
+  };
+};
 
-export default Loading
+export default Loading;

+ 68 - 192
src/graphic/History/HistoryUtil.js

@@ -32,7 +32,7 @@ export default class HistoryUtil {
       line1.linkedFixPointId == line2.linkedFixPointId &&
       line1.linkedBasePointId == line2.linkedBasePointId &&
       line1.style == line2.style &&
-      line1.weight == line2.weight && 
+      line1.weight == line2.weight &&
       line1.zebraCrossStyle == line2.zebraCrossStyle
     ) {
       return false;
@@ -42,12 +42,7 @@ export default class HistoryUtil {
   }
 
   isDifferentForCurvePoints(curvePoint1, curvePoint2) {
-    if (
-      curvePoint1.x == curvePoint2.x &&
-      curvePoint1.y == curvePoint2.y &&
-      curvePoint1.parent == curvePoint2.parent &&
-      curvePoint1.index == curvePoint2.index
-    ) {
+    if (curvePoint1.x == curvePoint2.x && curvePoint1.y == curvePoint2.y && curvePoint1.parent == curvePoint2.parent && curvePoint1.index == curvePoint2.index) {
       return false;
     } else {
       return true;
@@ -55,11 +50,7 @@ export default class HistoryUtil {
   }
 
   isDifferentForCurveLines(curveLine1, curveLine2) {
-    if (
-      curveLine1.startId == curveLine2.startId &&
-      curveLine1.endId == curveLine2.endId &&
-      mathUtil.equalJSON(curveLine1.points, curveLine2.points)
-    ) {
+    if (curveLine1.startId == curveLine2.startId && curveLine1.endId == curveLine2.endId && mathUtil.equalJSON(curveLine1.points, curveLine2.points)) {
       return false;
     } else {
       return true;
@@ -67,12 +58,7 @@ export default class HistoryUtil {
   }
 
   isDifferentForCircles(circle1, circle2) {
-    if (
-      mathUtil.equalPoint(circle1.center, circle2.center) &&
-      circle1.radiusX == circle2.radiusX &&
-      circle1.radiusY == circle2.radiusY &&
-      circle1.color == circle2.color
-    ) {
+    if (mathUtil.equalPoint(circle1.center, circle2.center) && circle1.radiusX == circle2.radiusX && circle1.radiusY == circle2.radiusY && circle1.color == circle2.color) {
       return false;
     } else {
       return true;
@@ -95,11 +81,7 @@ export default class HistoryUtil {
   }
 
   isDifferentForMagnifiers(magnifier1, magnifier2) {
-    if (
-      mathUtil.equalPoint(magnifier1.position, magnifier2.position) &&
-      magnifier1.photoUrl == magnifier2.photoUrl &&
-      mathUtil.equalPoint(magnifier1.popPosition, magnifier2.popPosition)
-    ) {
+    if (mathUtil.equalPoint(magnifier1.position, magnifier2.position) && magnifier1.photoUrl == magnifier2.photoUrl && mathUtil.equalPoint(magnifier1.popPosition, magnifier2.popPosition)) {
       return false;
     } else {
       return true;
@@ -107,12 +89,7 @@ export default class HistoryUtil {
   }
 
   isDifferentForSVGs(svg1, svg2) {
-    if (
-      mathUtil.equalPoint(svg1.center, svg2.center) &&
-      svg1.type == svg2.type &&
-      svg1.angle == svg2.angle &&
-      svg1.scale == svg2.scale
-    ) {
+    if (mathUtil.equalPoint(svg1.center, svg2.center) && svg1.type == svg2.type && svg1.angle == svg2.angle && svg1.scale == svg2.scale) {
       return false;
     } else {
       return true;
@@ -120,10 +97,7 @@ export default class HistoryUtil {
   }
 
   isDifferentForRoadPoints(roadPoint1, roadPoint2) {
-    if (
-      mathUtil.equalPoint(roadPoint1, roadPoint2) &&
-      mathUtil.equalJSON(roadPoint1.parent, roadPoint2.parent)
-    ) {
+    if (mathUtil.equalPoint(roadPoint1, roadPoint2) && mathUtil.equalJSON(roadPoint1.parent, roadPoint2.parent)) {
       return false;
     } else {
       return true;
@@ -136,7 +110,8 @@ export default class HistoryUtil {
       mathUtil.equalPoint(roadEdge1.end, roadEdge2.end) &&
       roadEdge1.parent == roadEdge2.parent &&
       roadEdge1.style == roadEdge2.style &&
-      roadEdge1.roadSide == roadEdge2.roadSide 
+      roadEdge1.weight == roadEdge2.weight &&
+      roadEdge1.roadSide == roadEdge2.roadSide
     ) {
       return false;
     } else {
@@ -151,25 +126,12 @@ export default class HistoryUtil {
       road1.leftEdgeId == road2.leftEdgeId &&
       road1.rightEdgeId == road2.rightEdgeId &&
       road1.way == road2.way &&
-      road1.roadWidthTipsPos == road2.roadWidthTipsPos 
+      road1.roadWidthTipsPos == road2.roadWidthTipsPos
     ) {
       if (road1.way == Constant.oneWay) {
-        if (
-          road1.singleRoadWidth == road2.singleRoadWidth &&
-          road1.singleRoadDrivewayCount == road2.singleRoadDrivewayCount &&
-          road1.singleLanes.length == road2.singleLanes.length
-        ) {
+        if (road1.singleRoadWidth == road2.singleRoadWidth && road1.singleRoadDrivewayCount == road2.singleRoadDrivewayCount && road1.singleLanes.length == road2.singleLanes.length) {
           for (let i = 0; i < road1.singleLanes.length; ++i) {
-            if (
-              !mathUtil.equalPoint(
-                road1.singleLanes[i].start,
-                road2.singleLanes[i].start
-              ) ||
-              !mathUtil.equalPoint(
-                road1.singleLanes[i].end,
-                road2.singleLanes[i].end
-              )
-            ) {
+            if (!mathUtil.equalPoint(road1.singleLanes[i].start, road2.singleLanes[i].start) || !mathUtil.equalPoint(road1.singleLanes[i].end, road2.singleLanes[i].end)) {
               return true;
             }
           }
@@ -184,50 +146,20 @@ export default class HistoryUtil {
           road1.leftDrivewayCount == road2.leftDrivewayCount &&
           road1.rightDrivewayCount == road2.rightDrivewayCount &&
           road1.midDivide.midDivideWidth == road2.midDivide.midDivideWidth &&
-          mathUtil.equalPoint(
-            road1.midDivide.leftMidDivide.start,
-            road2.midDivide.leftMidDivide.start
-          ) &&
-          mathUtil.equalPoint(
-            road1.midDivide.leftMidDivide.end,
-            road2.midDivide.leftMidDivide.end
-          ) &&
-          mathUtil.equalPoint(
-            road1.midDivide.rightMidDivide.start,
-            road2.midDivide.rightMidDivide.start
-          ) &&
-          mathUtil.equalPoint(
-            road1.midDivide.rightMidDivide.end,
-            road2.midDivide.rightMidDivide.end
-          ) &&
+          mathUtil.equalPoint(road1.midDivide.leftMidDivide.start, road2.midDivide.leftMidDivide.start) &&
+          mathUtil.equalPoint(road1.midDivide.leftMidDivide.end, road2.midDivide.leftMidDivide.end) &&
+          mathUtil.equalPoint(road1.midDivide.rightMidDivide.start, road2.midDivide.rightMidDivide.start) &&
+          mathUtil.equalPoint(road1.midDivide.rightMidDivide.end, road2.midDivide.rightMidDivide.end) &&
           road1.leftLanes.length == road2.leftLanes.length &&
           road1.rightLanes.length == road2.rightLanes.length
         ) {
           for (let i = 0; i < road1.leftLanes.length; ++i) {
-            if (
-              !mathUtil.equalPoint(
-                road1.leftLanes[i].start,
-                road2.leftLanes[i].start
-              ) ||
-              !mathUtil.equalPoint(
-                road1.leftLanes[i].end,
-                road2.leftLanes[i].end
-              )
-            ) {
+            if (!mathUtil.equalPoint(road1.leftLanes[i].start, road2.leftLanes[i].start) || !mathUtil.equalPoint(road1.leftLanes[i].end, road2.leftLanes[i].end)) {
               return true;
             }
           }
           for (let i = 0; i < road1.rightLanes.length; ++i) {
-            if (
-              !mathUtil.equalPoint(
-                road1.rightLanes[i].start,
-                road2.rightLanes[i].start
-              ) ||
-              !mathUtil.equalPoint(
-                road1.rightLanes[i].end,
-                road2.rightLanes[i].end
-              )
-            ) {
+            if (!mathUtil.equalPoint(road1.rightLanes[i].start, road2.rightLanes[i].start) || !mathUtil.equalPoint(road1.rightLanes[i].end, road2.rightLanes[i].end)) {
               return true;
             }
           }
@@ -244,11 +176,7 @@ export default class HistoryUtil {
   }
 
   isDifferentForCurveRoadPoints(curveRoadPoint1, curveRoadPoint2) {
-    if (
-      mathUtil.equalPoint(curveRoadPoint1, curveRoadPoint2) &&
-      mathUtil.equalJSON(curveRoadPoint1.parent, curveRoadPoint2.parent) &&
-      curveRoadPoint1.index == curveRoadPoint2.index
-    ) {
+    if (mathUtil.equalPoint(curveRoadPoint1, curveRoadPoint2) && mathUtil.equalJSON(curveRoadPoint1.parent, curveRoadPoint2.parent) && curveRoadPoint1.index == curveRoadPoint2.index) {
       return false;
     } else {
       return true;
@@ -262,8 +190,9 @@ export default class HistoryUtil {
       mathUtil.equalPoints(curveRoadEdge1.points, curveRoadEdge2.points) &&
       curveRoadEdge1.parent == curveRoadEdge2.parent &&
       curveRoadEdge1.style == curveRoadEdge2.style &&
-      curveRoadEdge1.weight == curveRoadEdge2.weight &&
-      curveRoadEdge1.roadSide == curveRoadEdge2.roadSide 
+      curveRoadEdge1.weight == curveRoadEdge2.weight
+      // &&
+      // curveRoadEdge1.roadSide == curveRoadEdge2.roadSide
     ) {
       return false;
     } else {
@@ -281,11 +210,7 @@ export default class HistoryUtil {
       curveRoad1.way == curveRoad2.way
     ) {
       if (curveRoad1.way == Constant.oneWay) {
-        if (
-          curveRoad1.singleRoadWidth == curveRoad2.singleRoadWidth &&
-          curveRoad1.singleRoadDrivewayCount ==
-            curveRoad2.singleRoadDrivewayCount
-        ) {
+        if (curveRoad1.singleRoadWidth == curveRoad2.singleRoadWidth && curveRoad1.singleRoadDrivewayCount == curveRoad2.singleRoadDrivewayCount) {
           return false;
         } else {
           return true;
@@ -296,8 +221,7 @@ export default class HistoryUtil {
           curveRoad1.rightWidth == curveRoad2.rightWidth &&
           curveRoad1.leftDrivewayCount == curveRoad2.leftDrivewayCount &&
           curveRoad1.rightDrivewayCount == curveRoad2.rightDrivewayCount &&
-          curveRoad1.midDivide.midDivideWidth ==
-            curveRoad2.midDivide.midDivideWidth
+          curveRoad1.midDivide.midDivideWidth == curveRoad2.midDivide.midDivideWidth
         ) {
           return false;
         } else {
@@ -366,7 +290,7 @@ export default class HistoryUtil {
     lineInfo.value = line2.value;
     lineInfo.style = line2.style;
     lineInfo.weight = line2.weight;
-    lineInfo.zebraCrossStyle = line2.zebraCrossStyle
+    lineInfo.zebraCrossStyle = line2.zebraCrossStyle;
     this.setLineInfo(lineInfo);
   }
 
@@ -417,9 +341,7 @@ export default class HistoryUtil {
     magnifierInfo.vectorId = magnifier1.vectorId;
     magnifierInfo.photoUrl = magnifier2.photoUrl;
     magnifierInfo.position = JSON.parse(JSON.stringify(magnifier2.position));
-    magnifierInfo.popPosition = JSON.parse(
-      JSON.stringify(magnifier2.popPosition)
-    );
+    magnifierInfo.popPosition = JSON.parse(JSON.stringify(magnifier2.popPosition));
     this.setMagnifierInfo(magnifierInfo);
   }
 
@@ -449,6 +371,7 @@ export default class HistoryUtil {
     const roadEdgeInfo = {};
     roadEdgeInfo.vectorId = roadEdge1.vectorId;
     roadEdgeInfo.style = roadEdge2.style;
+    roadEdgeInfo.weight = roadEdge2.weight;
     roadEdgeInfo.start = { x: roadEdge2.start.x, y: roadEdge2.start.y };
     roadEdgeInfo.end = { x: roadEdge2.end.x, y: roadEdge2.end.y };
     roadEdgeInfo.parent = roadEdge2.parent;
@@ -488,9 +411,7 @@ export default class HistoryUtil {
       x: curveRoadPoint2.position.x,
       y: curveRoadPoint2.position.y,
     };
-    curveRoadPointInfo.parent = JSON.parse(
-      JSON.stringify(curveRoadPoint2.parent)
-    );
+    curveRoadPointInfo.parent = JSON.parse(JSON.stringify(curveRoadPoint2.parent));
 
     curveRoadPointInfo.index = curveRoadPoint2.index;
     this.setCurveRoadPointInfo(curveRoadPointInfo);
@@ -507,16 +428,12 @@ export default class HistoryUtil {
       x: curveRoadEdge2.end.x,
       y: curveRoadEdge2.end.y,
     };
-    curveRoadEdgeInfo.points = JSON.parse(
-      JSON.stringify(curveRoadEdge2.points)
-    );
-    curveRoadEdgeInfo.curves = JSON.parse(
-      JSON.stringify(curveRoadEdge2.curves)
-    );
+    curveRoadEdgeInfo.points = JSON.parse(JSON.stringify(curveRoadEdge2.points));
+    curveRoadEdgeInfo.curves = JSON.parse(JSON.stringify(curveRoadEdge2.curves));
     curveRoadEdgeInfo.parent = curveRoadEdge2.parent;
     curveRoadEdgeInfo.style = curveRoadEdge2.style;
     curveRoadEdgeInfo.weight = curveRoadEdge2.weight;
-    curveRoadEdgeInfo.roadSide == curveRoadEdge2.roadSide 
+    // curveRoadEdgeInfo.roadSide == curveRoadEdge2.roadSide
     this.setCurveRoadEdgeInfo(curveRoadEdgeInfo);
   }
 
@@ -532,34 +449,19 @@ export default class HistoryUtil {
     curveRoadInfo.way = curveRoad2.way;
     if (curveRoad2.way == Constant.oneWay) {
       curveRoadInfo.singleCurveRoadWidth = curveRoad2.singleCurveRoadWidth;
-      curveRoadInfo.singleCurveRoadDrivewayCount =
-        curveRoad2.singleCurveRoadDrivewayCount;
-      curveRoadInfo.singleLanes = JSON.parse(
-        JSON.stringify(curveRoad2.singleLanes)
-      );
-      curveRoadInfo.singleLanesCurves = JSON.parse(
-        JSON.stringify(curveRoad2.singleLanesCurves)
-      );
+      curveRoadInfo.singleCurveRoadDrivewayCount = curveRoad2.singleCurveRoadDrivewayCount;
+      curveRoadInfo.singleLanes = JSON.parse(JSON.stringify(curveRoad2.singleLanes));
+      curveRoadInfo.singleLanesCurves = JSON.parse(JSON.stringify(curveRoad2.singleLanesCurves));
     } else if (curveRoad2.way == Constant.twoWay) {
       curveRoadInfo.leftWidth = curveRoad2.leftWidth;
       curveRoadInfo.rightWidth = curveRoad2.rightWidth;
       curveRoadInfo.leftDrivewayCount = curveRoad2.leftDrivewayCount;
       curveRoadInfo.rightDrivewayCount = curveRoad2.rightDrivewayCount;
-      curveRoadInfo.midDivide = JSON.parse(
-        JSON.stringify(curveRoad2.midDivide)
-      );
-      curveRoadInfo.leftLanesCurves = JSON.parse(
-        JSON.stringify(curveRoad2.leftLanesCurves)
-      );
-      curveRoadInfo.rightLanesCurves = JSON.parse(
-        JSON.stringify(curveRoad2.rightLanesCurves)
-      );
-      curveRoadInfo.leftLanes = JSON.parse(
-        JSON.stringify(curveRoad2.leftLanes)
-      );
-      curveRoadInfo.rightLanes = JSON.parse(
-        JSON.stringify(curveRoad2.rightLanes)
-      );
+      curveRoadInfo.midDivide = JSON.parse(JSON.stringify(curveRoad2.midDivide));
+      curveRoadInfo.leftLanesCurves = JSON.parse(JSON.stringify(curveRoad2.leftLanesCurves));
+      curveRoadInfo.rightLanesCurves = JSON.parse(JSON.stringify(curveRoad2.rightLanesCurves));
+      curveRoadInfo.leftLanes = JSON.parse(JSON.stringify(curveRoad2.leftLanes));
+      curveRoadInfo.rightLanes = JSON.parse(JSON.stringify(curveRoad2.rightLanes));
     }
     curveRoadInfo.points = [];
     for (let i = 0; i < curveRoad2.points.length; ++i) {
@@ -577,12 +479,8 @@ export default class HistoryUtil {
       x: crossPoint2.position.x,
       y: crossPoint2.position.y,
     };
-    crossPointInfo.edgeInfo1 = JSON.parse(
-      JSON.stringify(crossPoint2.edgeInfo1)
-    );
-    crossPointInfo.edgeInfo2 = JSON.parse(
-      JSON.stringify(crossPoint2.edgeInfo2)
-    );
+    crossPointInfo.edgeInfo1 = JSON.parse(JSON.stringify(crossPoint2.edgeInfo1));
+    crossPointInfo.edgeInfo2 = JSON.parse(JSON.stringify(crossPoint2.edgeInfo2));
     crossPoint1.edgeInfo1 = JSON.parse(JSON.stringify(crossPoint2.edgeInfo1));
     crossPoint1.edgeInfo2 = JSON.parse(JSON.stringify(crossPoint2.edgeInfo2));
     dataService.addCrossPoint(crossPoint1);
@@ -629,7 +527,7 @@ export default class HistoryUtil {
     data.type = line.geoType;
     data.style = line.style;
     data.weight = line.weight;
-    data.zebraCrossStyle = line.zebraCrossStyle
+    data.zebraCrossStyle = line.zebraCrossStyle;
     return data;
   }
 
@@ -734,6 +632,7 @@ export default class HistoryUtil {
     data.end = {};
     data.end = JSON.parse(JSON.stringify(roadEdge.end));
     data.style = roadEdge.style;
+    data.weight = roadEdge.weight;
     data.roadSide = roadEdge.roadSide;
     return data;
   }
@@ -786,7 +685,7 @@ export default class HistoryUtil {
     data.curves = JSON.parse(JSON.stringify(curveRoadEdge.curves));
     data.style = curveRoadEdge.style;
     data.weight = curveRoadEdge.weight;
-    data.roadSide == curveRoadEdge.roadSide 
+    // data.roadSide == curveRoadEdge.roadSide
     return data;
   }
 
@@ -805,9 +704,7 @@ export default class HistoryUtil {
     if (curveRoad.way == Constant.oneWay) {
       data.singleCurveRoadWidth = curveRoad.singleRoadWidth;
       data.singleCurveRoadDrivewayCount = curveRoad.singleRoadDrivewayCount;
-      data.singleLanesCurves = JSON.parse(
-        JSON.stringify(curveRoad.singleLanesCurves)
-      );
+      data.singleLanesCurves = JSON.parse(JSON.stringify(curveRoad.singleLanesCurves));
       data.singleLanes = JSON.parse(JSON.stringify(curveRoad.singleLanes));
     } else if (curveRoad.way == Constant.twoWay) {
       data.leftWidth = curveRoad.leftWidth;
@@ -815,12 +712,8 @@ export default class HistoryUtil {
       data.leftDrivewayCount = curveRoad.leftDrivewayCount;
       data.rightDrivewayCount = curveRoad.rightDrivewayCount;
       data.midDivide = JSON.parse(JSON.stringify(curveRoad.midDivide));
-      data.leftLanesCurves = JSON.parse(
-        JSON.stringify(curveRoad.leftLanesCurves)
-      );
-      data.rightLanesCurves = JSON.parse(
-        JSON.stringify(curveRoad.rightLanesCurves)
-      );
+      data.leftLanesCurves = JSON.parse(JSON.stringify(curveRoad.leftLanesCurves));
+      data.rightLanesCurves = JSON.parse(JSON.stringify(curveRoad.rightLanesCurves));
       data.leftLanes = JSON.parse(JSON.stringify(curveRoad.leftLanes));
       data.rightLanes = JSON.parse(JSON.stringify(curveRoad.rightLanes));
     }
@@ -876,7 +769,7 @@ export default class HistoryUtil {
     line.value = lineInfo.value;
     line.style = lineInfo.style;
     line.weight = lineInfo.weight;
-    line.zebraCrossStyle = lineInfo.zebraCrossStyle
+    line.zebraCrossStyle = lineInfo.zebraCrossStyle;
     return line;
   }
 
@@ -894,9 +787,7 @@ export default class HistoryUtil {
     curveLine.endId = curveLineInfo.endId;
     curveLine.points = [];
     for (let i = 0; i < curveLineInfo.points.length; ++i) {
-      curveLine.points[i] = dataService.getCurvePoint(
-        curveLineInfo.points[i].vectorId
-      );
+      curveLine.points[i] = dataService.getCurvePoint(curveLineInfo.points[i].vectorId);
     }
     curveLine.curves = JSON.parse(JSON.stringify(curveLineInfo.curves));
     return curveLine;
@@ -928,9 +819,7 @@ export default class HistoryUtil {
     let magnifier = dataService.getMagnifier(magnifierInfo.vectorId);
     magnifier.vectorId = magnifierInfo.vectorId;
     magnifier.position = JSON.parse(JSON.stringify(magnifierInfo.position));
-    magnifier.popPosition = JSON.parse(
-      JSON.stringify(magnifierInfo.popPosition)
-    );
+    magnifier.popPosition = JSON.parse(JSON.stringify(magnifierInfo.popPosition));
     magnifier.photoUrl = magnifierInfo.photoUrl;
   }
 
@@ -958,7 +847,11 @@ export default class HistoryUtil {
     mathUtil.clonePoint(roadEdge.end, roadEdgeInfo.end);
     roadEdge.type = roadEdgeInfo.type;
     roadEdge.style = roadEdgeInfo.style;
+    roadEdge.weight = roadEdgeInfo.weight;
     roadEdge.roadSide = roadEdgeInfo.roadSide;
+    if (roadEdge.roadSide) {
+      roadEdge.setRoadSideWidth(roadEdge.roadSide.width);
+    }
   }
 
   setRoadInfo(roadInfo) {
@@ -986,24 +879,19 @@ export default class HistoryUtil {
   }
 
   setCurveRoadPointInfo(curveRoadPointInfo) {
-    let curveRoadPoint = dataService.getCurveRoadPoint(
-      curveRoadPointInfo.vectorId
-    );
+    let curveRoadPoint = dataService.getCurveRoadPoint(curveRoadPointInfo.vectorId);
     curveRoadPoint.vectorId = curveRoadPointInfo.vectorId;
     mathUtil.clonePoint(curveRoadPoint, curveRoadPointInfo.position);
-    curveRoadPoint.parent = JSON.parse(
-      JSON.stringify(curveRoadPointInfo.parent)
-    );
+    curveRoadPoint.parent = JSON.parse(JSON.stringify(curveRoadPointInfo.parent));
     curveRoadPoint.index = curveRoadPointInfo.index;
   }
 
   setCurveRoadEdgeInfo(curveRoadEdgeInfo) {
-    let curveRoadEdge = dataService.getCurveRoadEdge(
-      curveRoadEdgeInfo.vectorId
-    );
+    let curveRoadEdge = dataService.getCurveRoadEdge(curveRoadEdgeInfo.vectorId);
     curveRoadEdge.vectorId = curveRoadEdgeInfo.vectorId;
     mathUtil.clonePoint(curveRoadEdge.start, curveRoadEdgeInfo.start);
     mathUtil.clonePoint(curveRoadEdge.end, curveRoadEdgeInfo.end);
+    curveRoadEdge.points = [];
     for (let i = 0; i < curveRoadEdgeInfo.points.length; ++i) {
       curveRoadEdge.points[i] = {};
       mathUtil.clonePoint(curveRoadEdge.points[i], curveRoadEdgeInfo.points[i]);
@@ -1013,7 +901,7 @@ export default class HistoryUtil {
     curveRoadEdge.type = curveRoadEdgeInfo.type;
     curveRoadEdge.style = curveRoadEdgeInfo.style;
     curveRoadEdge.weight = curveRoadEdgeInfo.weight;
-    curveRoadEdge.roadSide == curveRoadEdgeInfo.roadSide 
+    // curveRoadEdge.roadSide == curveRoadEdgeInfo.roadSide
   }
 
   setCurveRoadInfo(curveRoadInfo) {
@@ -1023,40 +911,28 @@ export default class HistoryUtil {
     curveRoad.endId = curveRoadInfo.endId;
     curveRoad.leftEdgeId = curveRoadInfo.leftEdgeId;
     curveRoad.rightEdgeId = curveRoadInfo.rightEdgeId;
+    curveRoad.points = [];
     for (let i = 0; i < curveRoadInfo.points.length; ++i) {
-      curveRoad.points[i] = dataService.getCurveRoadPoint(
-        curveRoadInfo.points[i].vectorId
-      );
+      curveRoad.points[i] = dataService.getCurveRoadPoint(curveRoadInfo.points[i].vectorId);
     }
-    //curveRoad.points = JSON.parse(JSON.stringify(curveRoadInfo.points));
+    // curveRoad.points = JSON.parse(JSON.stringify(curveRoadInfo.points));
     curveRoad.curves = JSON.parse(JSON.stringify(curveRoadInfo.curves));
 
     if (curveRoad.way == Constant.oneWay) {
       curveRoad.singleCurveRoadWidth = curveRoadInfo.singleCurveRoadWidth;
-      curveRoad.singleCurveRoadDrivewayCount =
-        curveRoadInfo.singleCurveRoadDrivewayCount;
-      curveRoad.singleLanesCurves = JSON.parse(
-        JSON.stringify(curveRoadInfo.singleLanesCurves)
-      );
-      curveRoad.singleLanes = JSON.parse(
-        JSON.stringify(curveRoadInfo.singleLanes)
-      );
+      curveRoad.singleCurveRoadDrivewayCount = curveRoadInfo.singleCurveRoadDrivewayCount;
+      curveRoad.singleLanesCurves = JSON.parse(JSON.stringify(curveRoadInfo.singleLanesCurves));
+      curveRoad.singleLanes = JSON.parse(JSON.stringify(curveRoadInfo.singleLanes));
     } else if (curveRoad.way == Constant.twoWay) {
       curveRoad.leftWidth = curveRoadInfo.leftWidth;
       curveRoad.rightWidth = curveRoadInfo.rightWidth;
       curveRoad.leftDrivewayCount = curveRoadInfo.leftDrivewayCount;
       curveRoad.rightDrivewayCount = curveRoadInfo.rightDrivewayCount;
       curveRoad.midDivide = JSON.parse(JSON.stringify(curveRoadInfo.midDivide));
-      curveRoad.leftLanesCurves = JSON.parse(
-        JSON.stringify(curveRoadInfo.leftLanesCurves)
-      );
-      curveRoad.rightLanesCurves = JSON.parse(
-        JSON.stringify(curveRoadInfo.rightLanesCurves)
-      );
+      curveRoad.leftLanesCurves = JSON.parse(JSON.stringify(curveRoadInfo.leftLanesCurves));
+      curveRoad.rightLanesCurves = JSON.parse(JSON.stringify(curveRoadInfo.rightLanesCurves));
       curveRoad.leftLanes = JSON.parse(JSON.stringify(curveRoadInfo.leftLanes));
-      curveRoad.rightLanes = JSON.parse(
-        JSON.stringify(curveRoadInfo.rightLanes)
-      );
+      curveRoad.rightLanes = JSON.parse(JSON.stringify(curveRoadInfo.rightLanes));
     }
   }
 

+ 11 - 1
src/graphic/Service/RoadService.js

@@ -287,7 +287,6 @@ export default class RoadService {
     //   this.initRoadWidthTipsPos(road);
     // }
 
-  
     // console.error(newRoad)
 
     return newRoad.vectorId;
@@ -619,6 +618,7 @@ export default class RoadService {
     this.setRoadPointId(roadId, newPoint.vectorId, dir);
     // 第四步更新Edge
     edgeService.updateDefaultEdge(roadId, dir);
+
     this.setLanes(roadId, null, dir);
   }
 
@@ -632,6 +632,16 @@ export default class RoadService {
     dataService.deleteCrossPointForEdge(road.leftEdgeId, "end");
     dataService.deleteCrossPointForEdge(road.rightEdgeId, "start");
     dataService.deleteCrossPointForEdge(road.rightEdgeId, "end");
+
+
+    //曲线救国(后续需优化),删除相交的道路,路缘线需要更新 。
+    let roadEdges = dataService.getRoadEdges();
+    for (let key in roadEdges) {
+      let roadEdge = dataService.getRoadEdge(key);
+      if (roadEdge.roadSide) {
+        roadEdge.initRoadSide();
+      }
+    }
   }
 
   setRoadPointId(roadId, pointId, dir) {

+ 77 - 18
src/store/sync.ts

@@ -19,6 +19,20 @@ import { drawSetting } from "./drawSetting";
 
 const global = window as any;
 
+const getFilesIng = [];
+const getFilesSuccess = [];
+setInterval(() => {
+  if (getFilesSuccess.length !== getFilesIng.length) {
+    console.log(
+      "请求资源数:" + getFilesIng.length,
+      "响应结果数:" + getFilesSuccess.length
+    );
+    console.log(
+      "未返回资源:" +
+        getFilesIng.filter((url) => !getFilesSuccess.includes(url))
+    );
+  }
+}, 1000);
 const normalImage = async (url: string) => {
   const getUrl = await api.getFile(url);
   const blob = await imageRotate(getUrl);
@@ -29,7 +43,11 @@ const normalImage = async (url: string) => {
   }
 };
 
-let count = 0;
+console.log("进入初始化sync count为" + global.count);
+if (!global.count) {
+  global.count = 0;
+}
+
 export const api = !global.android
   ? // true
     // const api = import.meta.env.DEV
@@ -58,19 +76,26 @@ export const api = !global.android
         await window.open(await api.getFile(filename));
       },
       async getFile(url) {
+        const urlRaw = url;
+        getFilesIng.push(urlRaw);
+
         if (url.includes(baseURL)) {
           url = url.substring(baseURL.length);
         }
         url = url.trim();
         const paths = url.split("/");
         const notBase64BaseTypes = [".png", ".jpg"];
-        const notBase64 = notBase64BaseTypes.some((type) => paths[paths.length - 1].includes(type));
+        const notBase64 = notBase64BaseTypes.some((type) =>
+          paths[paths.length - 1].includes(type)
+        );
         if (notBase64) {
+          getFilesSuccess.push(urlRaw);
           // await new Promise((resolve) => setTimeout(resolve, 2000));
           return baseURL + url;
         } else {
           const data = await axios.get(url, { responseType: "blob" });
           const base64 = await blobToBase64(data.data);
+          getFilesSuccess.push(urlRaw);
           return URL.createObjectURL(base64ToBlob(base64));
         }
       },
@@ -109,7 +134,11 @@ export const api = !global.android
           global.setSceneStoreCallback = (data) => {
             resolve(data);
           };
-          global.android.setSceneStore(params.m + "/store.json", JSON.stringify(data), "setSceneStoreCallback");
+          global.android.setSceneStore(
+            params.m + "/store.json",
+            JSON.stringify(data),
+            "setSceneStoreCallback"
+          );
         });
       },
       getStore() {
@@ -117,14 +146,21 @@ export const api = !global.android
           global.getSceneStoreCallback = (data) => {
             resolve(data);
           };
-          global.android.getSceneStore(params.m + "/store.json", "getSceneStoreCallback");
+          global.android.getSceneStore(
+            params.m + "/store.json",
+            "getSceneStoreCallback"
+          );
         });
       },
       // genUseLoading()
       async getFile(fileUrl: string) {
+        const urlRaw = fileUrl;
+        getFilesIng.push(urlRaw);
         fileUrl = fileUrl.trim();
         if (fileUrl.includes(params.m)) {
-          fileUrl = fileUrl.substring(fileUrl.indexOf(params.m) + params.m.length);
+          fileUrl = fileUrl.substring(
+            fileUrl.indexOf(params.m) + params.m.length
+          );
         }
         fileUrl = new URL(fileUrl, "http://www.a.com").pathname;
         fileUrl = (params.realPath || params.m) + fileUrl;
@@ -134,37 +170,46 @@ export const api = !global.android
           // ".png", ".jpg"
           // , ".bin"
         ];
-        const notBase64 = notBase64BaseTypes.some((type) => paths[paths.length - 1].includes(type));
+        const notBase64 = notBase64BaseTypes.some((type) =>
+          paths[paths.length - 1].includes(type)
+        );
 
         if (!notBase64) {
           return await new Promise<string>((resolve) => {
-            const apiName = `getImageCallback${count++}`;
+            const apiName = `getImageCallback${global.count++}`;
             global[apiName] = (base64) => {
-              console.error("请求url:" + fileUrl, "返回:" + base64.substring(0, 60));
+              getFilesSuccess.push(urlRaw);
               resolve(URL.createObjectURL(base64ToBlob(base64)));
               delete global[apiName];
             };
             global.android.getImage(fileUrl, apiName);
           });
         } else {
+          getFilesSuccess.push(urlRaw);
           return fileUrl;
         }
       },
       uploadImage(file: File) {
         return new Promise<string>(async (resolve) => {
-          const apiName = `uploadImageCallback${count++}`;
+          const apiName = `uploadImageCallback${global.count++}`;
           global[apiName] = (data) => {
             resolve(data);
             delete global[apiName];
           };
           const data = await blobToBase64(file);
-          global.android.uploadImage(params.m + "/attach/upload/" + file.name, data, apiName);
+          global.android.uploadImage(
+            params.m + "/attach/upload/" + file.name,
+            data,
+            apiName
+          );
         });
       },
       downloadImage(file: File) {
         return new Promise<boolean>(async (resolve) => {
-          const apiName = `downloadImageCallback${count++}`;
+          const apiName = `downloadImageCallback${global.count++}`;
+          console.log("download ing fileName ", file.name, "apiName ", apiName);
           global[apiName] = () => {
+            console.log("download success fileName", file.name);
             resolve(true);
             delete global[apiName];
           };
@@ -175,9 +220,13 @@ export const api = !global.android
       },
       photograph(rotate = true) {
         return new Promise<string>((resolve) => {
-          const apiName = `photograph${count++}`;
+          const apiName = `photograph${global.count++}`;
           global[apiName] = (data) => {
-            data ? (rotate ? normalImage(data).then(resolve) : resolve(data)) : resolve(null);
+            data
+              ? rotate
+                ? normalImage(data).then(resolve)
+                : resolve(data)
+              : resolve(null);
             delete global[apiName];
           };
           global.android.cameraPhotograph(params.m, apiName);
@@ -185,9 +234,13 @@ export const api = !global.android
       },
       selectPhotoAlbum(rotate = true) {
         return new Promise<string>((resolve) => {
-          const apiName = `selectPhotoAlbum${count++}`;
+          const apiName = `selectPhotoAlbum${global.count++}`;
           global[apiName] = (data) => {
-            data ? (rotate ? normalImage(data).then(resolve) : resolve(data)) : resolve(null);
+            data
+              ? rotate
+                ? normalImage(data).then(resolve)
+                : resolve(data)
+              : resolve(null);
             delete global[apiName];
           };
           global.android.selectPhotoAlbum(params.m, apiName);
@@ -218,7 +271,7 @@ const loadStore = async () => {
   uses.value = data?.uses || defaultUses;
   tables.value = data?.tables || {};
   drawSetting.value = data?.drawSetting || {};
-  
+
   syncSceneStore();
 };
 
@@ -228,8 +281,14 @@ export const uploadImage = (blob: Blob, name = `${getId()}.jpg`) => {
   return api.uploadImage(file);
 };
 
-export const downloadImage = async (data: Blob | string, name = `${getId()}.jpg`) => {
-  const blob: Blob = typeof data === "string" ? (await axios.get(data, { responseType: "blob" })).data : data;
+export const downloadImage = async (
+  data: Blob | string,
+  name = `${getId()}.jpg`
+) => {
+  const blob: Blob =
+    typeof data === "string"
+      ? (await axios.get(data, { responseType: "blob" })).data
+      : data;
   const file = new File([blob], name, { type: "image/jpeg" });
 
   return await api.downloadImage(file);

+ 28 - 8
src/views/graphic/geos/roadEdge.vue

@@ -1,19 +1,28 @@
 <template>
   <GeoTeleport :menus="menus" class="geo-teleport-use" :active="active" />
   <GeoTeleport :menus="childMenus" v-if="childMenus" class="type-geo" />
-  <VRange v-if="showChange" :max="1000" :min="0" :step="1" unit="mm" v-model:value="(lineWidthMenu[2].desc as number)" />
+  <VRange
+    v-if="showChange"
+    :max="1000"
+    :min="0"
+    :step="1"
+    unit="mm"
+    :value="(lineWidthMenu[2].desc as any)"
+    @update:value="updateDesc"
+  />
 </template>
 
 <script setup lang="ts">
 import GeoTeleport from "@/views/graphic/geos/geo-teleport.vue";
 import { drawRef, FocusVector } from "@/hook/useGraphic";
-import { computed, reactive, ref, toRaw, UnwrapRef, watchEffect } from "vue";
+import { computed, reactive, ref, toRaw, UnwrapRef, watch, watchEffect } from "vue";
 import { dataService } from "@/graphic/Service/DataService";
 import { UITypeExtend } from "@/views/graphic/menus";
 import VectorStyle from "@/graphic/enum/VectorStyle";
 import VectorWeight from "@/graphic/enum/VectorWeight";
 import VRange from "@/components/vrange/index.vue";
 import VectorType from "@/graphic/enum/VectorType";
+import { debounce, throttle } from "@/utils";
 const props = defineProps<{ geo: FocusVector }>();
 const vector = computed(() => dataService.getGeo(props.geo.type, props.geo.vectorId));
 const style = ref(vector.value.style || VectorStyle.SingleSolidLine);
@@ -91,7 +100,7 @@ const lineWidthMenu = reactive([
     key: "setRoadEdageWidth",
     icon: "l_thin",
     text: "宽度",
-    desc: 200,
+    desc: -1,
     onClick: () => {
       showChange.value = !showChange.value;
       childMenus.value = null;
@@ -122,22 +131,33 @@ watchEffect(() => {
     lineWidthMenu[2].desc = vector.value.roadSide.width * 1000;
     // }
   } else {
-    (menus.value[1] = vector.value?.weight === VectorWeight.Bold ? lineWidthMenu[0] : lineWidthMenu[1]), (showChange.value = false);
+    (menus.value[1] =
+      vector.value?.weight === VectorWeight.Bold ? lineWidthMenu[0] : lineWidthMenu[1]),
+      (showChange.value = false);
   }
 });
-watchEffect(() => {
+const updateWidth = debounce(() => {
+  drawRef.value.history.save();
+}, 500);
+const updateDesc = (value) => {
+  lineWidthMenu[2].desc = value;
   if (style.value === VectorStyle.RoadSide) {
     if (vector.value.geoType == VectorType.CurveRoadEdge) {
       vector.value.setCurveRoadSideWidth((lineWidthMenu[2].desc as number) / 1000);
     } else {
       vector.value.setRoadSideWidth((lineWidthMenu[2].desc as number) / 1000);
+      drawRef.value.renderer.autoRedraw();
+      updateWidth();
     }
-    drawRef.value.renderer.autoRedraw();
   }
-});
+};
 
 const active = computed(() => {
-  return toRaw(childMenus.value) === lineTypeMenu ? menus.value[0] : toRaw(childMenus.value) === lineWidthMenu ? menus.value[1] : null;
+  return toRaw(childMenus.value) === lineTypeMenu
+    ? menus.value[0]
+    : toRaw(childMenus.value) === lineWidthMenu
+    ? menus.value[1]
+    : null;
 });
 </script>
 

+ 1 - 0
src/views/scene/container.vue

@@ -44,6 +44,7 @@ onMounted(async () => {
     })
   );
 
+  console.error("sdk loaded");
   emit("loaded");
 
   sdk.scene.on("posChange", (pos) => {

+ 1 - 1
src/views/scene/covers/range.vue

@@ -57,7 +57,7 @@ const props = defineProps<{ rangeKey: string }>();
 const topSetting = useSDK().scene.getSceneCropSetting().top;
 
 const sceneRangeSetting = {
-  top: { min: topSetting.minTop, max: topSetting.maxTop, step: 1, unit: "米" },
+  top: { min: 0, max: 100, step: 1, unit: "%" },
   scale: { min: 0, max: 100, step: 1, unit: "%" },
   rotate: { min: -180, max: 180, step: 1, unit: "°" },
 };

+ 4 - 3
src/views/tables/ask.vue

@@ -20,8 +20,8 @@
       <span>次</span>
     </div>
 
-    <h2 v-show="!isWrite" class="title" v-if="type == '1'">询问/<span class="through">讯问</span>笔录</h2>
-    <h2 v-show="!isWrite" class="title" v-else><span class="through">询问</span>/讯问笔录</h2>
+    <h2 v-show="!isWrite" class="ask-title" v-if="type == '1'">询问/<span class="through">讯问</span>笔录</h2>
+    <h2 v-show="!isWrite" class="ask-title" v-else><span class="through">询问</span>/讯问笔录</h2>
     <div class="container" v-show="!isWrite">
       <div class="line">
         <span>时间</span>
@@ -322,9 +322,10 @@ div[contenteditable] {
       margin: 0 5px;
     }
   }
-  .title {
+  .ask-title {
     text-align: center;
     margin-bottom: 78px;
+    font-size: 32px !important;
   }
   .bottom-name {
     width: 100%;

+ 1 - 1
src/views/tables/index.vue

@@ -180,7 +180,7 @@ const getLayoutImage = async () => {
       const blob = await new Promise<Blob>((resolve) => {
         return canvas.toBlob(resolve, "image/jpeg", 0.95);
       });
-      await downloadImage(blob, `tables_${index}.jpg`);
+      await downloadImage(blob, `tables_${new Date().getTime()}.jpg`);
       Message.success({ msg: "已保存至相册", time: 2000 });
       num++;
 

+ 3 - 3
vite.config.ts

@@ -52,9 +52,9 @@ export default async ({ mode }) => {
     },
     plugins: [
       vue(),
-      legacy({
-        targets: ["defaults", "not IE 11"],
-      }),
+      // legacy({
+      //   targets: ["defaults", "not IE 11"],
+      // }),
     ],
     server,
   });