浏览代码

修正问题

bill 2 年之前
父节点
当前提交
fc8a68635b
共有 3 个文件被更改,包括 72 次插入0 次删除
  1. 69 0
      src/views/graphic/geos/delAndCopu.vue
  2. 2 0
      src/views/graphic/geos/index.ts
  3. 1 0
      src/views/graphic/index.vue

+ 69 - 0
src/views/graphic/geos/delAndCopu.vue

@@ -0,0 +1,69 @@
+<template>
+  <GeoTeleport
+      :menus="menus"
+      class="geo-teleport-use"
+      v-if="!hideTypes.includes(geo.type) && !hideTypes.includes(geo.category)"
+  />
+</template>
+
+<script setup lang="ts">
+import GeoTeleport from "@/views/graphic/geos/geo-teleport.vue";
+import {drawRef, FocusVector, VectorType} from '@/hook/useGraphic'
+import GeoActions from "@/graphic/enum/GeoActions"
+import VectorCategory from "@/graphic/enum/VectorCategory";
+
+const props = defineProps<{geo: FocusVector}>()
+const hideTypes = [
+  VectorType.RoadPoint,
+  VectorType.CurveRoadPoint,
+  VectorCategory.Point.NormalPoint
+]
+console.log(props)
+const menus = [
+  {
+    key: 'copy',
+    icon: 'copy',
+    text: "复制",
+    onClick: () => {
+      drawRef.value.uiControl.handleGeo(GeoActions.CopyAction)
+    }
+  },
+  {
+    key: 'del',
+    text: "删除",
+    icon: 'del',
+    onClick: () => {
+      drawRef.value.uiControl.handleGeo(GeoActions.DeleteAction)
+    }
+  }
+]
+</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;
+}
+</style>
+
+<style lang="scss">
+.select-floating.select-float.dire-top {
+  margin-top: -10px;
+}
+</style>

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

@@ -8,11 +8,13 @@ import RoadEdge from './roadEdge.vue'
 import Road from './road.vue'
 import NormalLine from './normalLine.vue'
 import VectorCategory from "@/graphic/enum/VectorCategory";
+import DelAndCopu from "@/views/graphic/geos/delAndCopu.vue";
 
 
 export const GlobalComp = Del
 
 export default {
+  [VectorType.SVG]: DelAndCopu,
   [VectorType.Road]: Road,
   [VectorType.RoadEdge]: RoadEdge,
   [VectorType.CurveRoad]: Road,

+ 1 - 0
src/views/graphic/index.vue

@@ -63,6 +63,7 @@ const store = computed(() => generateMixMenus(
 const focusMenus = computed(() => focusMenuRaw[currentVector.value?.type])
 const geoComponent = computed(() => {
   if (currentVector.value) {
+    console.log(currentVector.value)
     return geos[currentVector.value?.type] || geos[currentVector.value?.category] || GlobalComp
   }
 })