|
@@ -1,18 +1,26 @@
|
|
|
<template>
|
|
|
<GeoTeleport :menus="menus" class="geo-teleport-use" :active="active" />
|
|
|
<GeoTeleport :menus="childMenus" v-if="childMenus" class="type-geo" />
|
|
|
+ {{ showChange }}
|
|
|
+ <VRange
|
|
|
+ v-if="showChange"
|
|
|
+ :max="100"
|
|
|
+ :min="10"
|
|
|
+ :step="1"
|
|
|
+ unit="mm"
|
|
|
+ v-model:value="(lineWidthMenu[2].desc as number)"
|
|
|
+ />
|
|
|
</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 { drawRef, FocusVector } from "@/hook/useGraphic";
|
|
|
+import { computed, reactive, ref, toRaw, UnwrapRef, watchEffect } 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";
|
|
|
import VectorWeight from "@/graphic/enum/VectorWeight";
|
|
|
+import VRange from "@/components/vrange/index.vue";
|
|
|
|
|
|
const props = defineProps<{ geo: FocusVector }>();
|
|
|
const vector = computed(() => dataService.getGeo(props.geo.type, props.geo.vectorId));
|
|
@@ -22,7 +30,8 @@ const clickHandlerFactory = (key) => {
|
|
|
return () => drawRef.value.uiControl.updateVectorForSelectUI(key);
|
|
|
};
|
|
|
|
|
|
-const lineTypeMenu = [
|
|
|
+const showChange = ref(false);
|
|
|
+const lineTypeMenu = reactive([
|
|
|
{
|
|
|
key: VectorStyle.SingleSolidLine,
|
|
|
icon: "line_sf",
|
|
@@ -41,27 +50,6 @@ const lineTypeMenu = [
|
|
|
style.value = VectorStyle.SingleDashedLine;
|
|
|
},
|
|
|
},
|
|
|
- // {
|
|
|
- // hide: props.geo.type === VectorType.CurveRoadEdge,
|
|
|
- // key: VectorStyle.DoubleSolidLine,
|
|
|
- // icon: "line_df",
|
|
|
- // text: "双实线",
|
|
|
- // onClick: clickHandlerFactory(VectorStyle.DoubleSolidLine),
|
|
|
- // },
|
|
|
- // {
|
|
|
- // hide: props.geo.type === VectorType.CurveRoadEdge,
|
|
|
- // key: VectorStyle.DoubleDashedLine,
|
|
|
- // icon: "line_dd",
|
|
|
- // text: "双虚线",
|
|
|
- // onClick: clickHandlerFactory(VectorStyle.DoubleDashedLine),
|
|
|
- // },
|
|
|
- // {
|
|
|
- // hide: props.geo.type === VectorType.CurveRoadEdge,
|
|
|
- // key: VectorStyle.BrokenLine,
|
|
|
- // icon: "line_broken",
|
|
|
- // text: "折线",
|
|
|
- // onClick: clickHandlerFactory(VectorStyle.BrokenLine),
|
|
|
- // },
|
|
|
{
|
|
|
key: VectorStyle.PointDrawLine,
|
|
|
icon: "line_dot",
|
|
@@ -77,13 +65,12 @@ const lineTypeMenu = [
|
|
|
text: "路缘线",
|
|
|
onClick: () => {
|
|
|
clickHandlerFactory(VectorStyle.RoadSide)();
|
|
|
- // menus.value[1] = lineWidthMenu[0];
|
|
|
+ style.value = VectorStyle.RoadSide;
|
|
|
},
|
|
|
},
|
|
|
- // {key: VectorStyle.Greenbelt, icon: "treelawn", text: "绿化带 ", onClick: clickHandlerFactory(VectorStyle.Greenbelt)},
|
|
|
-];
|
|
|
+]);
|
|
|
|
|
|
-const lineWidthMenu = [
|
|
|
+const lineWidthMenu = reactive([
|
|
|
{
|
|
|
key: VectorWeight.Bold,
|
|
|
icon: "l_thick",
|
|
@@ -102,28 +89,17 @@ const lineWidthMenu = [
|
|
|
menus.value[1] = lineWidthMenu[0];
|
|
|
},
|
|
|
},
|
|
|
-
|
|
|
-];
|
|
|
-
|
|
|
-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)
|
|
|
- // },
|
|
|
- ]
|
|
|
- : [];
|
|
|
+ {
|
|
|
+ key: "setRoadEdageWidth",
|
|
|
+ icon: "l_thin",
|
|
|
+ text: "宽度",
|
|
|
+ desc: 0,
|
|
|
+ onClick: () => {
|
|
|
+ showChange.value = !showChange.value;
|
|
|
+ },
|
|
|
+ },
|
|
|
+]);
|
|
|
const childMenus = ref<UnwrapRef<typeof menus>>();
|
|
|
-// console.log(vector.value)
|
|
|
const menus = ref([
|
|
|
{
|
|
|
key: UITypeExtend.lineType,
|
|
@@ -134,9 +110,22 @@ const menus = ref([
|
|
|
},
|
|
|
},
|
|
|
vector.value?.weight === VectorWeight.Bold ? lineWidthMenu[0] : lineWidthMenu[1],
|
|
|
- ...appendMenus,
|
|
|
]);
|
|
|
|
|
|
+watchEffect(() => {
|
|
|
+ if (style.value === VectorStyle.RoadSide) {
|
|
|
+ menus.value[1] = lineWidthMenu[2];
|
|
|
+ lineWidthMenu[2].desc = vector.value.roadSide.width;
|
|
|
+ } else {
|
|
|
+ showChange.value = false;
|
|
|
+ }
|
|
|
+});
|
|
|
+watchEffect(() => {
|
|
|
+ if (style.value === VectorStyle.RoadSide) {
|
|
|
+ vector.value.setRoadSideWidth(lineWidthMenu[2].desc);
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
const active = computed(() =>
|
|
|
toRaw(childMenus.value) === lineTypeMenu
|
|
|
? menus.value[0]
|