root 2 years ago
parent
commit
00e68e467d

+ 1 - 0
.env.test

@@ -0,0 +1 @@
+VITE_DEV_PORT = 5178

+ 1 - 0
package.json

@@ -6,6 +6,7 @@
   "scripts": {
     "dev": "vite --host 0.0.0.0",
     "build": "vite build",
+    "build-test": "vite build --mode test",
     "preview": "vite preview"
   },
   "dependencies": {

+ 23 - 9
public/static/lib/potree/potree.js

@@ -57369,7 +57369,7 @@
 				offset *= lineWidth;
 
 				// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
-				offset /= resolution.y * devicePixelRatio;
+				offset /= resolution.y;// * devicePixelRatio;
 
 				// select end
 				vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
@@ -57957,7 +57957,7 @@
 	        this.events = {
 	            setSize:(e)=>{//如果出现横条状的异常,往往是viewportOffset出错  //地图不需要
 	                let viewport = e.viewport; 
-	                this.uniforms.resolution.value.copy(viewport.resolution);  
+	                this.uniforms.resolution.value.copy(viewport.resolution2);  
 	                this.uniforms.devicePixelRatio.value = window.devicePixelRatio; 
 	                this.lineWidth = this.lineWidth_; //update
 	                if(!this.useDepth /* || !e.viewport.camera.isPerspectiveCamera  */|| !e.viewport)return
@@ -70858,14 +70858,14 @@ void main()
 	        });
 	         
 	        
-	        
+	         
 	        this.events = {
 	            setSize:(e)=>{//如果出现横条状的异常,往往是viewportOffset出错  //地图不需要
 	                if(!this.useDepth /* || !e.viewport.camera.isPerspectiveCamera  */|| !e.viewport)return
 	                let viewport = e.viewport;
 	                let viewportOffset = viewport.offset || new Vector2(); 
 	                
-	                this.uniforms.resolution.value.copy(viewport.resolution);  
+	                this.uniforms.resolution.value.copy(viewport.resolution2);  //2023.6.12突然发现ratio>1的用resolution不对,得用2才对。但是之前明明记得不是这样
 	                this.uniforms.viewportOffset.value.copy(viewportOffset);
 	            },
 	            render:(e)=>{//before render  如果有大于两个viewport的话,不同viewport用不同的depthTex
@@ -71069,11 +71069,18 @@ void main()
 	    }
 	    
 	    realVisible(){
+	        
+	        if(!this.visible && this.unvisibleReasons && this.unvisibleReasons.some(e=>e != 'unableCompute')){
+	            return false
+	        }
+	        
+	        
 	        let v = true; 
-	        let parent = this; 
-	        let lastParent;
+	        let parent = this.parent; 
+	        let lastParent = this;
+	        
 	        while(parent){
-	            if(parent.visible === false){
+	            if(parent.visible === false ){
 	                v = false;
 	                break; 
 	            }
@@ -71125,7 +71132,7 @@ void main()
 	                
 	                
 	                let r1 = Potree.Utils.getPos2d(center, camera, viewer.renderArea, e.viewport); 
-	                if(!r1.trueSide)return //Potree.Utils.updateVisible(this, 'notTrueSide', false); 但这句会使realVisible为false从而无法更新//console.error('!r1.trueSide') //中心点如果在背面直接不渲染了
+	                if(!r1.trueSide)return  Potree.Utils.updateVisible(this, 'unableCompute', false);// 但这句会使realVisible为false从而无法更新//console.error('!r1.trueSide') //中心点如果在背面直接不渲染了
 	                    
 	                let r2, point2;
 	                
@@ -71144,6 +71151,12 @@ void main()
 	                        }
 	                    }else {
 	                        let dis = r2.pos.distanceTo(r1.pos);
+	                        if(dis == 0){
+	                            //console.log('dis == 0') 
+	                            Potree.Utils.updateVisible(this, 'unableCompute', false);
+	                            return
+	                            break
+	                        } 
 	                        if(dis<10 && !p2StateHistory.includes('tooLong')){//和r1的屏幕距离太近,要加长,否则精度过低
 	                            p2State = 'tooShort';
 	                            len = 100/dis * len;  
@@ -71156,7 +71169,7 @@ void main()
 	                //console.log(p2StateHistory,len)
 	                
 	                if(!r2.trueSide){
-	                    return //Potree.Utils.updateVisible(this, 'notTrueSide', false), console.log('  !r2.trueSide', )
+	                    return  Potree.Utils.updateVisible(this, 'unableCompute', false)//, console.log('  !r2.trueSide', )
 	                }
 	                //Potree.Utils.updateVisible(this, 'notTrueSide', true)
 	                 
@@ -95770,6 +95783,7 @@ ENDSEC
                     }else{ */
                         gl_FragDepthEXT = mix(depth0.y,depth1.y,progress);
                     //}
+                    gl_FragDepthEXT = clamp(gl_FragDepthEXT, 0.0, 1.0);     //防止部分手机出现黑块。ios 16  。 因为我给的超远值超出范围
                     
                     
 

File diff suppressed because it is too large
+ 1 - 1
public/static/lib/potree/potree.js.map


File diff suppressed because it is too large
+ 0 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 1 - 1
src/graphic/CanvasStyle/focus.js

@@ -118,7 +118,7 @@ const TestPoint = {
 };
 const BaseLine = {
   strokeStyle: "#3290FF",
-  lineWidth: 1 * coordinate.ratio,
+  lineWidth: 3 * coordinate.ratio,
 };
 
 const SVG = {

+ 1 - 1
src/graphic/CanvasStyle/select.js

@@ -26,7 +26,7 @@ const MeasureLine = {
 
 const BaseLine = {
   strokeStyle: "#3290FF",
-  lineWidth: 1 * coordinate.ratio,
+  lineWidth: 3 * coordinate.ratio,
 };
 const NormalLine = {
   ...def.NormalLine,

+ 14 - 0
src/graphic/Controls/UIControl.js

@@ -247,6 +247,20 @@ export default class UIControl {
     } else if (selectUI == VectorEvents.AddBranchRoad) {
     } else if (selectUI == VectorEvents.AddNarrowRoad) {
     } else if (selectUI == VectorEvents.UnLock) {
+      let road = dataService.getRoad(focusItem.vectorId);
+      if (road) {
+        roadService.convertToLines(focusItem.vectorId);
+      } else {
+        road = dataService.getCurveRoad(focusItem.vectorId);
+        if (road) {
+          curveRoadService.convertToCurveLines(focusItem.vectorId);
+        }
+      }
+      if (road) {
+        this.deleteVector(focusItem.vectorId, focusItem.type);
+        this.layer.history.save();
+        this.layer.renderer.autoRedraw();
+      }
     }
   }
 

+ 12 - 0
src/graphic/Geometry/CurveRoad.js

@@ -26,4 +26,16 @@ export default class CurveRoad extends Road {
     this.geoType = VectorType.CurveRoad;
     this.setId(vectorId);
   }
+
+  getLanesCount(dir) {
+    if (this.way == Constant.oneWay) {
+      return this.singleCurveRoadDrivewayCount;
+    } else if (this.way == Constant.twoWay) {
+      if (dir == "left") {
+        return this.leftDrivewayCount;
+      } else {
+        return this.rightDrivewayCount;
+      }
+    }
+  }
 }

+ 12 - 0
src/graphic/Geometry/Road.js

@@ -87,4 +87,16 @@ export default class Road extends Geometry {
   setWay(value) {
     this.way = value;
   }
+
+  getLanesCount(dir) {
+    if (this.way == Constant.oneWay) {
+      return this.singleRoadDrivewayCount;
+    } else if (this.way == Constant.twoWay) {
+      if (dir == "left") {
+        return this.leftDrivewayCount;
+      } else {
+        return this.rightDrivewayCount;
+      }
+    }
+  }
 }

+ 12 - 8
src/graphic/Layer.js

@@ -203,31 +203,33 @@ export default class Layer {
         if (selectItem && selectItem.dir && selectItem.vectorId) {
           let road = dataService.getRoad(selectItem.vectorId);
           if (road) {
+            let roadLanCount = road.getLanesCount(selectItem.dir);
             if (selectItem.dir == "left") {
               roadService.updateForAddSubtractLanesCount(
                 road.vectorId,
-                road.leftDrivewayCount + 1,
+                roadLanCount + 1,
                 selectItem.dir
               );
             } else {
               roadService.updateForAddSubtractLanesCount(
                 road.vectorId,
-                road.rightDrivewayCount + 1,
+                roadLanCount + 1,
                 selectItem.dir
               );
             }
           } else {
             road = dataService.getCurveRoad(selectItem.vectorId);
+            let curveRoadLanCount = road.getLanesCount(selectItem.dir);
             if (selectItem.dir == "left") {
               curveRoadService.updateForAddSubtractLanesCount(
                 road.vectorId,
-                road.leftDrivewayCount + 1,
+                curveRoadLanCount + 1,
                 selectItem.dir
               );
             } else {
               curveRoadService.updateForAddSubtractLanesCount(
                 road.vectorId,
-                road.rightDrivewayCount + 1,
+                curveRoadLanCount + 1,
                 selectItem.dir
               );
             }
@@ -241,31 +243,33 @@ export default class Layer {
         if (selectItem && selectItem.dir && selectItem.vectorId) {
           let road = dataService.getRoad(selectItem.vectorId);
           if (road) {
+            let roadLanCount = road.getLanesCount(selectItem.dir);
             if (selectItem.dir == "left") {
               roadService.updateForAddSubtractLanesCount(
                 road.vectorId,
-                road.leftDrivewayCount - 1,
+                roadLanCount - 1,
                 selectItem.dir
               );
             } else {
               roadService.updateForAddSubtractLanesCount(
                 road.vectorId,
-                road.rightDrivewayCount - 1,
+                roadLanCount - 1,
                 selectItem.dir
               );
             }
           } else {
             road = dataService.getCurveRoad(selectItem.vectorId);
+            let curveRoadLanCount = road.getLanesCount(selectItem.dir);
             if (selectItem.dir == "left") {
               curveRoadService.updateForAddSubtractLanesCount(
                 road.vectorId,
-                road.leftDrivewayCount - 1,
+                curveRoadLanCount - 1,
                 selectItem.dir
               );
             } else {
               curveRoadService.updateForAddSubtractLanesCount(
                 road.vectorId,
-                road.rightDrivewayCount - 1,
+                curveRoadLanCount - 1,
                 selectItem.dir
               );
             }

+ 1 - 4
src/graphic/ListenLayer.js

@@ -301,10 +301,7 @@ export default class ListenLayer {
       }
 
       const line = dataService.getLine(lineId);
-      if (
-        line.getCategory() == VectorCategory.Line.PositionLine ||
-        line.getCategory() == VectorCategory.Line.BaseLine
-      ) {
+      if (line.getCategory() == VectorCategory.Line.PositionLine) {
         continue;
       }
       let startPoint = dataService.getPoint(line.startId);

+ 9 - 8
src/graphic/Renderer/Draw.js

@@ -462,9 +462,9 @@ export default class Draw {
     vector.rightLanesCurves &&
       vector.rightLanesCurves.forEach(this.drawCurveLan.bind(this));
 
-    if (import.meta.env.DEV) {
+    // if (import.meta.env.DEV) {
       vector.points.forEach(this.drawPoint.bind(this));
-    }
+    // }
   }
 
   drawCurveRoadEdge(vector, isTemp) {
@@ -490,12 +490,12 @@ export default class Draw {
     help.drawCoves(ctx, coves);
     ctx.restore();
 
-    if (import.meta.env.DEV) {
+    // if (import.meta.env.DEV) {
       lines.map((line) => {
         this.drawPoint(line.start);
         this.drawPoint(line.end);
       });
-    }
+    // }
   }
 
   drawRoadPoint(vector) {
@@ -664,9 +664,9 @@ export default class Draw {
         return;
       }
       const [_, attr] = help.getVectorStyle(line);
-      if (!attr) {
-        return;
-      }
+      // if (!attr) {
+      //   return;
+      // }
     }
 
     if (vector.color) {
@@ -697,6 +697,8 @@ export default class Draw {
         },
       };
     }
+
+
     draw(style);
     if (style.out) {
       draw(style.out);
@@ -905,7 +907,6 @@ export default class Draw {
         break;
       case VectorCategory.Line.BaseLine:
         this.drawBaseLineLabel(vector);
-        drawPoints();
         break;
       case VectorCategory.Line.MeasureLine:
       case VectorCategory.Line.PositionLine:

+ 0 - 25
src/graphic/Service/CurveRoadService.js

@@ -764,31 +764,6 @@ export default class CurveRoadService extends RoadService {
       lineService.createCurveLineForPoints(curveRoad.midDivide.leftMidDivide);
       lineService.createCurveLineForPoints(curveRoad.midDivide.rightMidDivide);
     }
-
-    dataService.deleteCurveRoad(curveRoadId);
-  }
-
-  unlock(curveRoadId) {
-    let curveRoad = dataService.getCurveRoad(curveRoadId);
-    let leftCurveEdge = dataService.getCurveRoadEdge(curveRoad.leftEdgeId);
-    let rightCurveEdge = dataService.getCurveRoadEdge(curveRoad.rightEdgeId);
-    let lanes = curveRoad.lanes;
-
-    for (let i = 0; i < curveRoad.curves.length; ++i) {
-      dataService.createCurveLine(curveRoad.curves[i]);
-    }
-    for (let i = 0; i < leftCurveEdge.curves.length; ++i) {
-      dataService.createCurveLine(leftCurveEdge.curves[i]);
-    }
-    for (let i = 0; i < rightCurveEdge.curves.length; ++i) {
-      dataService.createCurveLine(rightCurveEdge.curves[i]);
-    }
-    for (let i = 0; i < lanes.length; ++i) {
-      for (let j = 0; j < lanes[i].curves.length; ++j) {
-        dataService.createCurveLine(lanes[i].curves[j]);
-      }
-    }
-    dataService.deleteCurveRoad(curveRoadId);
   }
 }
 

+ 13 - 4
src/graphic/Service/RoadService.js

@@ -154,8 +154,6 @@ export default class RoadService {
       mathUtil.getDistance(startPoint, point) < Constant.minAdsorbPix ||
       mathUtil.getDistance(endPoint, point) < Constant.minAdsorbPix
     ) {
-      //console.error('splitRoad********************************************1')
-      //return null
     }
 
     let leftEdge = dataService.getRoadEdge(road.leftEdgeId);
@@ -194,6 +192,16 @@ export default class RoadService {
       point.setPointParent(roadId, "start");
       road.startId = pointId;
     }
+
+    if (road.way == Constant.oneWay) {
+      newRoad.setWay(road.way);
+      newRoad.singleRoadDrivewayCount = road.singleRoadDrivewayCount;
+    } else if (road.way == Constant.twoWay) {
+      newRoad.setWay(road.way);
+      newRoad.leftDrivewayCount = road.leftDrivewayCount;
+      newRoad.rightDrivewayCount = road.rightDrivewayCount;
+    }
+
     // 更新断开后两个road之间的edge
     edgeService.updateEdgeForTwoRoad(roadId, newRoad.vectorId);
 
@@ -1075,6 +1083,7 @@ export default class RoadService {
     let dx2 = (leftEdge.end.x - rightEdge.end.x) / drivewayCount;
     let dy2 = (leftEdge.end.y - rightEdge.end.y) / drivewayCount;
 
+    road.singleLanes = [];
     for (let i = 0; i < drivewayCount - 1; ++i) {
       if (!road.singleLanes[i]) {
         road.singleLanes[i] = {};
@@ -1385,6 +1394,7 @@ export default class RoadService {
       const line = mathUtil.createLine1(leftEdge.start, leftEdge.end);
       const singleRoadWidth = mathUtil.getDisForPoinLine(rightEdge.start, line);
       road.setWidth(singleRoadWidth);
+      road.singleRoadDrivewayCount = newCount;
     }
 
     edgeService.updateEdgeForMulRoad(road.startId);
@@ -1462,6 +1472,7 @@ export default class RoadService {
     this.setLanes(roadId, dir);
   }
 
+  //将道路转换成线条
   convertToLines(roadId) {
     let road = dataService.getRoad(roadId);
     let leftEdge = dataService.getRoadEdge(road.leftEdgeId);
@@ -1488,8 +1499,6 @@ export default class RoadService {
         road.midDivide.rightMidDivide.end
       );
     }
-
-    dataService.deleteRoad(roadId);
   }
 
   // unlock(roadId) {

+ 2 - 1
src/main.ts

@@ -1,5 +1,6 @@
 import VConsole from 'vconsole';
-if (import.meta.env.DEV) {
+console.log(import.meta.env.MODE)
+if (import.meta.env.MODE === "test") {
   if (!os.isPc) {
     new VConsole();
   }

+ 3 - 2
src/views/graphic/geos/index.ts

@@ -6,6 +6,7 @@ import magnifier from './magnifier.vue'
 import Del from './del.vue'
 import RoadEdge from './roadEdge.vue'
 import Road from './road.vue'
+import NormalLine from './normalLine.vue'
 import VectorCategory from "@/graphic/enum/VectorCategory";
 
 
@@ -19,8 +20,8 @@ export default {
   [VectorType.SingleArrowLine]: Arrow,
   [VectorType.DoubleArrowLine]: Arrow,
   // [VectorCategory.Line.MeasureLine]: Arrow,
-  [VectorCategory.Line.NormalLine]: Arrow,
+  [VectorCategory.Line.NormalLine]: NormalLine,
   [VectorType.Text]: Text,
   [VectorType.Circle]: Circle,
   [VectorType.Magnifier]: magnifier
-}
+}

+ 155 - 0
src/views/graphic/geos/normalLine.vue

@@ -0,0 +1,155 @@
+<template>
+  <GeoTeleport :menus="menus" class="geo-teleport-use" :active="active"/>
+  <GeoTeleport :menus="childMenus" v-if="childMenus" class="type-geo"/>
+</template>
+
+<script setup lang="ts">
+import GeoTeleport from "@/views/graphic/geos/geo-teleport.vue";
+import {drawRef, FocusVector, VectorType} from '@/hook/useGraphic'
+import {computed, ref, toRaw, UnwrapRef} from "vue";
+import {dataService} from "@/graphic/Service/DataService";
+import GeoActions from "@/graphic/enum/GeoActions"
+import {UITypeExtend} from "@/views/graphic/menus";
+import VectorEvents from "@/graphic/enum/VectorEvents";
+import VectorStyle from "@/graphic/enum/VectorStyle";
+
+
+const props = defineProps<{ geo: FocusVector }>()
+const vector = computed(() => dataService.getLine(props.geo.vectorId))
+console.error(props.geo)
+
+const clickHandlerFactory = (key) => {
+  return () => drawRef.value.uiControl.updateVectorForSelectUI(key)
+}
+
+const lineTypeMenu = [
+  {
+    key: VectorStyle.SingleSolidLine,
+    icon: "line",
+    text: "单实线",
+    onClick: clickHandlerFactory(VectorStyle.SingleSolidLine)
+  },
+  {
+    key: VectorStyle.SingleDashedLine,
+    icon: "line",
+    text: "单虚线",
+    onClick: clickHandlerFactory(VectorStyle.SingleDashedLine)
+  },
+  {
+    key: VectorStyle.DoubleSolidLine,
+    icon: "line",
+    text: "双实线",
+    onClick: clickHandlerFactory(VectorStyle.DoubleSolidLine)
+  },
+  {
+    key: VectorStyle.DoubleDashedLine,
+    icon: "line",
+    text: "双虚线",
+    onClick: clickHandlerFactory(VectorStyle.DoubleDashedLine)
+  },
+  {key: VectorStyle.BrokenLine, icon: "line", text: "折线", onClick: clickHandlerFactory(VectorStyle.BrokenLine)},
+  {
+    key: VectorStyle.PointDrawLine,
+    icon: "line",
+    text: "点画线",
+    onClick: clickHandlerFactory(VectorStyle.PointDrawLine)
+  },
+  {key: VectorStyle.Greenbelt, icon: "line", text: "绿化带 ", onClick: clickHandlerFactory(VectorStyle.Greenbelt)},
+]
+const lineWidthMenu = [
+  {key: VectorStyle.Bold, icon: 'l_thick', text: "粗", onClick: clickHandlerFactory(VectorStyle.Bold)},
+  {key: VectorStyle.Thinning, icon: 'l_thin', text: "细", onClick: clickHandlerFactory(VectorStyle.Thinning)},
+]
+
+const appendMenus = props.geo.type === VectorType.CurveRoadEdge
+  ? [
+    {
+      key: VectorEvents.AddCrossPoint,
+      icon: "control_a",
+      text: "加控制点",
+      onClick: clickHandlerFactory(VectorEvents.AddCrossPoint)
+    },
+    {
+      key: VectorEvents.MinusCrossPoint,
+      icon: "control_d",
+      text: "减控制点",
+      onClick: clickHandlerFactory(VectorEvents.MinusCrossPoint)
+    },
+  ]
+  : []
+const childMenus = ref<UnwrapRef<typeof menus>>()
+const menus = ref([
+  {
+    key: UITypeExtend.lineType,
+    text: "单实线",
+    icon: "line",
+    onClick() {
+      childMenus.value = toRaw(childMenus.value) === lineTypeMenu ? null : lineTypeMenu
+    }
+  },
+  {
+    key: UITypeExtend.width,
+    text: "宽度",
+    icon: 'l_thick',
+    onClick() {
+      childMenus.value = toRaw(childMenus.value) === lineWidthMenu ? null : lineWidthMenu
+    }
+  },
+  ...appendMenus,
+  {
+    key: 'copy',
+    icon: 'copy',
+    text: "复制",
+    onClick: () => {
+      drawRef.value.uiControl.handleGeo(GeoActions.CopyAction)
+    }
+  },
+  {
+    key: 'del',
+    icon: 'del',
+    text: "删除",
+    onClick: () => {
+      drawRef.value.uiControl.handleGeo(GeoActions.DeleteAction)
+    }
+  }
+])
+
+const active = computed(() =>
+  toRaw(childMenus.value) === lineTypeMenu ? menus.value[0]
+    : toRaw(childMenus.value) === lineWidthMenu ? menus.value[1] : null
+)
+
+</script>
+
+<style scoped lang="scss">
+.color {
+  width: 18px;
+  height: 18px;
+  border: 2px solid #fff;
+  border-radius: 50%;
+}
+
+.icon {
+  font-size: 16px;
+}
+
+.geo-input {
+  position: absolute;
+  left: 0;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  z-index: 1;
+  opacity: 0;
+}
+
+.type-geo {
+  margin-bottom: 74px;
+}
+</style>
+
+<style lang="scss">
+.select-floating.select-float.dire-top {
+  margin-top: -10px;
+}
+</style>

+ 1 - 17
src/views/graphic/geos/roadEdge.vue

@@ -95,23 +95,7 @@ const menus = ref([
       childMenus.value = toRaw(childMenus.value) === lineWidthMenu ? null : lineWidthMenu
     }
   },
-  ...appendMenus,
-  {
-    key: 'copy',
-    icon: 'copy',
-    text: "复制",
-    onClick: () => {
-      drawRef.value.uiControl.handleGeo(GeoActions.CopyAction)
-    }
-  },
-  {
-    key: 'del',
-    icon: 'del',
-    text: "删除",
-    onClick: () => {
-      drawRef.value.uiControl.handleGeo(GeoActions.DeleteAction)
-    }
-  }
+  ...appendMenus
 ])
 
 const active = computed(() =>

+ 9 - 9
src/views/graphic/header.vue

@@ -26,7 +26,7 @@
           v-model="(data as AccidentPhoto).type"
           v-if="options"
       />
-      <ui-button width="100px" type="primary" class="save" @click="saveHandler">
+      <ui-button width="100px" class="save" @click="saveHandler">
         保存
       </ui-button>
       <ui-button width="100px" type="primary" class="save" @click="createTable" v-if="isRoad">
@@ -70,7 +70,7 @@ watchEffect(() => {
 const menus = computed<{disable?: boolean, text: string, onClick: () => void}[]>(() => {
   const menus = [
     {
-      text: "回退",
+      text: "",
       icon: "backout",
       disable: !graphicState.value.canRevoke,
       onClick: () => {
@@ -79,7 +79,7 @@ const menus = computed<{disable?: boolean, text: string, onClick: () => void}[]>
       }
     },
     {
-      text: "前进",
+      text: "",
       icon: "redo",
       disable: !graphicState.value.canRecovery,
       onClick: () => {
@@ -88,8 +88,8 @@ const menus = computed<{disable?: boolean, text: string, onClick: () => void}[]>
       }
     },
     {
-      text: "清除",
-      icon: "reset",
+      text: "",
+      icon: "clear",
       onClick: () => {
         drawRef.value.uiControl.menu_clear()
         changeStore()
@@ -97,15 +97,15 @@ const menus = computed<{disable?: boolean, text: string, onClick: () => void}[]>
     },
     {
       icon: "recover",
-      text: "恢复",
+      text: "",
       onClick: () => drawRef.value.uiControl.menu_view_reset()
     }
   ]
 
   if (isRoad.value) {
     menus.push({
-      icon: "map",
-      text: `底图${graphicState.value.showBackImage ? '关' : '开'}`,
+      icon: graphicState.value.showBackImage ? "map" : "recover",
+      text: ``,
       onClick: () => backImageChang(!graphicState.value.showBackImage)
     })
   }
@@ -192,4 +192,4 @@ const createTable = async () => {
 }
 
 
-</style>
+</style>

+ 7 - 7
src/views/graphic/menus.ts

@@ -137,13 +137,13 @@ export const mainMenusRaw: MenusRaw = [
     text: "道路",
     icon: "road",
     children: [
-      { key: UIType.OneEdgeOneLanRoad, icon: "road_ss", text: "单向单车道直路" },
-      { key: UIType.OneEdgeTwoLanRoad, icon: "road_sd", text: "单向双车道直路" },
-      { key: UIType.OneEdgeThreeLanRoad, icon: "road_st", text: "单向三车道直路" },
-      { key: UIType.TwoEdgeOneLanRoad, icon: "road_ds", text: "双向单车道直路" },
-      { key: UIType.TwoEdgeTwoLanRoad, icon: "road_dd", text: "双向双车道直路" },
-      { key: UIType.TwoEdgeThreeLanRoad, icon: "road_dt", text: "双向三车道直路" },
-      { key: UIType.CurveRoad, icon: "road_wl", text: "弯路" },
+      { key: UIType.OneEdgeOneLanRoad, icon: "road_ss", text: "" },
+      { key: UIType.OneEdgeTwoLanRoad, icon: "road_sd", text: "" },
+      { key: UIType.OneEdgeThreeLanRoad, icon: "road_st", text: "" },
+      { key: UIType.TwoEdgeOneLanRoad, icon: "road_ds", text: "" },
+      { key: UIType.TwoEdgeTwoLanRoad, icon: "road_dd", text: "" },
+      { key: UIType.TwoEdgeThreeLanRoad, icon: "road_dt", text: "" },
+      { key: UIType.CurveRoad, icon: "road_wl", text: "" },
       { key: UITypeExtend.structure, icon: "r_template", text: "道路结构", extend: structureMenusRaw },
       { key: UITypeExtend.template, icon: "r_structure", text: "道路模板", extend: templateMenusRaw },
     ]

+ 8 - 6
src/views/sys/menu/item/item.vue

@@ -53,16 +53,18 @@ const emit = defineEmits<{
 .menu-children {
   backdrop-filter: blur(4px);
   background-color: var(--editor-menu-back);
-  transform: scaleY(0);
-  opacity: 0;
-  transform-origin: center top;
-  transition: transform 0.3s ease, opacity 0.3s ease;
+  transform: translateX(-100%);
+  transform-origin: left center;
+  transition: all 0.3s ease;
   height: calc(100% - var(--editor-head-height));
   top: var(--editor-head-height) !important;
+  z-index: -3 !important;
+
 }
 
 .menu-children.show {
-  transform: scaleY(1);
-  opacity: 1;
+  transform: translateX(0);
+  z-index: 1 !important;
+  /*pointer-events: all;*/
 }
 </style>