Browse Source

修改道路交互

bill 2 năm trước cách đây
mục cha
commit
c50b82b502

+ 0 - 34
src/graphic/enum/UIEvents.js

@@ -136,40 +136,6 @@ const UIEvents = {
   // 底图关
   BasemapClose: "BasemapClose",
 
-  // ------------选中组件时的UI控制-----------
-  // 解锁
-  UnLock: "UnLock",
-  // 加控制点
-  AddCrossPoint: "AddCrossPoint",
-  // 减控制点
-  MinusCrossPoint: "MinusCrossPoint",
-  // 单实线
-  SingleSolidLine: "SingleSolidLine",
-  // 单虚线
-  SingleDashedLine: "SingleDashedLine",
-  // 双实线
-  DoubleSolidLine: "DoubleSolidLine",
-  // 双虚线
-  DoubleDashedLine: "DoubleDashedLine",
-  // 折线
-  BrokenLine: "BrokenLine",
-  // 点画线
-  PointDrawLine: "PointDrawLine",
-  // 绿化带
-  Greenbelt: "Greenbelt",
-  // 加粗
-  Bold: "Bold",
-  // 变细
-  Thinning: "Thinning",
-  // 加支路
-  AddBranchRoad: "AddBranchRoad",
-  // 加窄路
-  AddNarrowRoad: "AddNarrowRoad",
-  // 加车道
-  AddLane: "AddLane",
-  // 减车道
-  DelLane: "DelLane",
-
   Road: "road",
   CurveRoad: "curveRoad",
 };

+ 37 - 0
src/graphic/enum/VectorEvents.js

@@ -0,0 +1,37 @@
+const VectorEvents = {
+  // ------------选中组件时的UI控制-----------
+  // 解锁
+  UnLock: "UnLock",
+  // 加控制点
+  AddCrossPoint: "AddCrossPoint",
+  // 减控制点
+  MinusCrossPoint: "MinusCrossPoint",
+  // 单实线
+  SingleSolidLine: "SingleSolidLine",
+  // 单虚线
+  SingleDashedLine: "SingleDashedLine",
+  // 双实线
+  DoubleSolidLine: "DoubleSolidLine",
+  // 双虚线
+  DoubleDashedLine: "DoubleDashedLine",
+  // 折线
+  BrokenLine: "BrokenLine",
+  // 点画线
+  PointDrawLine: "PointDrawLine",
+  // 绿化带
+  Greenbelt: "Greenbelt",
+  // 加粗
+  Bold: "Bold",
+  // 变细
+  Thinning: "Thinning",
+  // 加支路
+  AddBranchRoad: "AddBranchRoad",
+  // 加窄路
+  AddNarrowRoad: "AddNarrowRoad",
+  // 加车道
+  AddLane: "AddLane",
+  // 减车道
+  DelLane: "DelLane"
+};
+
+export default VectorEvents;

+ 12 - 12
src/views/graphic/geos/road.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="layout">
     <GraphicAction class="full-action">
-      <ui-icon type="lock" ctrl @click="clickHandlerFactory(UIEvents.UnLock)()"/>
+      <ui-icon type="lock" ctrl @click="clickHandlerFactory(VectorEvents.UnLock)()"/>
     </GraphicAction>
     <GeoTeleport :menus="menus" class="geo-teleport-use"  />
   </div>
@@ -10,43 +10,43 @@
 <script setup lang="ts">
 import GeoTeleport from "@/views/graphic/geos/geo-teleport.vue";
 import UiIcon from "@/components/base/components/icon/index.vue";
-import {drawRef, FocusVector, uiType, UIType} from '@/hook/useGraphic'
+import {drawRef, FocusVector} from '@/hook/useGraphic'
 import {computed, ref} from "vue";
 import {dataService} from "@/graphic/Service/DataService";
 import GeoActions from "@/graphic/enum/GeoActions"
 import GraphicAction from "@/components/button-pane/index.vue";
-import UIEvents from "@/graphic/enum/UIEvents";
+import VectorEvents from "@/graphic/enum/VectorEvents";
 
 const props = defineProps<{geo: FocusVector}>()
 const vector = computed(() => dataService.getRoad(props.geo.vectorId))
 const clickHandlerFactory = (key) => {
-  return () => uiType.change(key)
+  return () => drawRef.value.uiControl.updateVectorForSelectUI(key)
 }
 
 const menus = ref([
   {
-    key: UIType.AddLane,
+    key: VectorEvents.AddLane,
     icon: "lane_a",
     text: "加车道" ,
-    onClick: clickHandlerFactory(UIType.AddLane)
+    onClick: clickHandlerFactory(VectorEvents.AddLane)
   },
   {
-    key: UIType.DelLane,
+    key: VectorEvents.DelLane,
     icon: "lane_d",
     text: "减车道",
-    onClick: clickHandlerFactory(UIType.DelLane)
+    onClick: clickHandlerFactory(VectorEvents.DelLane)
   },
   {
-    key: UIType.AddCrossPoint,
+    key: VectorEvents.AddCrossPoint,
     icon: "control_a",
     text: "加控制点",
-    onClick: clickHandlerFactory(UIType.AddCrossPoint)
+    onClick: clickHandlerFactory(VectorEvents.AddCrossPoint)
   },
   {
-    key: UIType.MinusCrossPoint,
+    key: VectorEvents.MinusCrossPoint,
     icon: "control_d",
     text: "减控制点" ,
-    onClick: clickHandlerFactory(UIType.MinusCrossPoint)
+    onClick: clickHandlerFactory(VectorEvents.MinusCrossPoint)
   },
   {
     key: 'copy',

+ 47 - 24
src/views/graphic/geos/roadEdge.vue

@@ -1,40 +1,63 @@
 <template>
-  <GeoTeleport :menus="menus" class="geo-teleport-use" :active="active" />
-  <GeoTeleport :menus="childMenus" v-if="childMenus" class="type-geo" />
+  <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 UiInput from "@/components/base/components/input/index.vue";
-import UiIcon from "@/components/base/components/icon/index.vue";
-import {drawRef, FocusVector, uiType, UIType, useChange} from '@/hook/useGraphic'
-import {computed, ref, toRaw, UnwrapRef, watch, watchEffect} from "vue";
+import {drawRef, FocusVector} from '@/hook/useGraphic'
+import {computed, ref, toRaw, UnwrapRef} from "vue";
 import {dataService} from "@/graphic/Service/DataService";
 import GeoActions from "@/graphic/enum/GeoActions"
-import {debounce} from "@/utils";
-import VectorCategory from "@/graphic/enum/VectorCategory";
 import {UITypeExtend} from "@/views/graphic/menus";
+import VectorEvents from "@/graphic/enum/VectorEvents";
 
-const props = defineProps<{geo: FocusVector}>()
+
+const props = defineProps<{ geo: FocusVector }>()
 const vector = computed(() => dataService.getLine(props.geo.vectorId))
 
 
 const clickHandlerFactory = (key) => {
-  return () => uiType.change(key)
+  return () => drawRef.value.uiControl.updateVectorForSelectUI(key)
 }
 
 const lineTypeMenu = [
-  { key: UIType.SingleSolidLine, icon: "line", text: "单实线", onClick: clickHandlerFactory(UIType.SingleSolidLine) },
-  { key: UIType.SingleDashedLine, icon: "line", text: "单虚线", onClick: clickHandlerFactory(UIType.SingleDashedLine)  },
-  { key: UIType.DoubleSolidLine, icon: "line", text: "双实线", onClick: clickHandlerFactory(UIType.DoubleSolidLine)  },
-  { key: UIType.DoubleDashedLine, icon: "line", text: "双虚线", onClick: clickHandlerFactory(UIType.DoubleDashedLine)  },
-  { key: UIType.BrokenLine, icon: "line", text: "折线", onClick: clickHandlerFactory(UIType.BrokenLine)  },
-  { key: UIType.PointDrawLine, icon: "line", text: "点画线", onClick: clickHandlerFactory(UIType.PointDrawLine)  },
-  { key: UIType.Greenbelt, icon: "line", text: "绿化带 ", onClick: clickHandlerFactory(UIType.Greenbelt)  },
+  {
+    key: VectorEvents.SingleSolidLine,
+    icon: "line",
+    text: "单实线",
+    onClick: clickHandlerFactory(VectorEvents.SingleSolidLine)
+  },
+  {
+    key: VectorEvents.SingleDashedLine,
+    icon: "line",
+    text: "单虚线",
+    onClick: clickHandlerFactory(VectorEvents.SingleDashedLine)
+  },
+  {
+    key: VectorEvents.DoubleSolidLine,
+    icon: "line",
+    text: "双实线",
+    onClick: clickHandlerFactory(VectorEvents.DoubleSolidLine)
+  },
+  {
+    key: VectorEvents.DoubleDashedLine,
+    icon: "line",
+    text: "双虚线",
+    onClick: clickHandlerFactory(VectorEvents.DoubleDashedLine)
+  },
+  {key: VectorEvents.BrokenLine, icon: "line", text: "折线", onClick: clickHandlerFactory(VectorEvents.BrokenLine)},
+  {
+    key: VectorEvents.PointDrawLine,
+    icon: "line",
+    text: "点画线",
+    onClick: clickHandlerFactory(VectorEvents.PointDrawLine)
+  },
+  {key: VectorEvents.Greenbelt, icon: "line", text: "绿化带 ", onClick: clickHandlerFactory(VectorEvents.Greenbelt)},
 ]
 const lineWidthMenu = [
-  { key: UIType.Bold, icon: 'l_thick', text: "粗", onClick: clickHandlerFactory(UIType.Bold)  },
-  { key: UIType.Thinning, icon: 'l_thin', text: "细", onClick: clickHandlerFactory(UIType.Thinning)  },
+  {key: VectorEvents.Bold, icon: 'l_thick', text: "粗", onClick: clickHandlerFactory(VectorEvents.Bold)},
+  {key: VectorEvents.Thinning, icon: 'l_thin', text: "细", onClick: clickHandlerFactory(VectorEvents.Thinning)},
 ]
 const childMenus = ref<UnwrapRef<typeof menus>>()
 const menus = ref([
@@ -55,16 +78,16 @@ const menus = ref([
     }
   },
   {
-    key: UIType.AddCrossPoint,
+    key: VectorEvents.AddCrossPoint,
     icon: "control_a",
     text: "加控制点",
-    onClick: clickHandlerFactory(UIType.AddCrossPoint)
+    onClick: clickHandlerFactory(VectorEvents.AddCrossPoint)
   },
   {
-    key: UIType.MinusCrossPoint,
+    key: VectorEvents.MinusCrossPoint,
     icon: "control_d",
-    text: "减控制点" ,
-    onClick: clickHandlerFactory(UIType.MinusCrossPoint)
+    text: "减控制点",
+    onClick: clickHandlerFactory(VectorEvents.MinusCrossPoint)
   },
   {
     key: 'copy',