|
@@ -1,40 +1,63 @@
|
|
<template>
|
|
<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>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import GeoTeleport from "@/views/graphic/geos/geo-teleport.vue";
|
|
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 {dataService} from "@/graphic/Service/DataService";
|
|
import GeoActions from "@/graphic/enum/GeoActions"
|
|
import GeoActions from "@/graphic/enum/GeoActions"
|
|
-import {debounce} from "@/utils";
|
|
|
|
-import VectorCategory from "@/graphic/enum/VectorCategory";
|
|
|
|
import {UITypeExtend} from "@/views/graphic/menus";
|
|
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 vector = computed(() => dataService.getLine(props.geo.vectorId))
|
|
|
|
|
|
|
|
|
|
const clickHandlerFactory = (key) => {
|
|
const clickHandlerFactory = (key) => {
|
|
- return () => uiType.change(key)
|
|
|
|
|
|
+ return () => drawRef.value.uiControl.updateVectorForSelectUI(key)
|
|
}
|
|
}
|
|
|
|
|
|
const lineTypeMenu = [
|
|
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 = [
|
|
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 childMenus = ref<UnwrapRef<typeof menus>>()
|
|
const menus = ref([
|
|
const menus = ref([
|
|
@@ -55,16 +78,16 @@ const menus = ref([
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- key: UIType.AddCrossPoint,
|
|
|
|
|
|
+ key: VectorEvents.AddCrossPoint,
|
|
icon: "control_a",
|
|
icon: "control_a",
|
|
text: "加控制点",
|
|
text: "加控制点",
|
|
- onClick: clickHandlerFactory(UIType.AddCrossPoint)
|
|
|
|
|
|
+ onClick: clickHandlerFactory(VectorEvents.AddCrossPoint)
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- key: UIType.MinusCrossPoint,
|
|
|
|
|
|
+ key: VectorEvents.MinusCrossPoint,
|
|
icon: "control_d",
|
|
icon: "control_d",
|
|
- text: "减控制点" ,
|
|
|
|
- onClick: clickHandlerFactory(UIType.MinusCrossPoint)
|
|
|
|
|
|
+ text: "减控制点",
|
|
|
|
+ onClick: clickHandlerFactory(VectorEvents.MinusCrossPoint)
|
|
},
|
|
},
|
|
{
|
|
{
|
|
key: 'copy',
|
|
key: 'copy',
|