|
@@ -1,109 +1,138 @@
|
|
|
<template>
|
|
|
<Teleport to="#layout-app">
|
|
|
<RightFillPano class="edit-path-point">
|
|
|
- <ui-group :title="`${isTemploraryID(data.id) ? '创建' : '编辑'}路线`" borderBottom>
|
|
|
- <ui-group-option class="item">
|
|
|
- <span class="label">路径名称</span>
|
|
|
- <span class="oper"> <Switch v-model:checked="data.showName" /> </span>
|
|
|
- </ui-group-option>
|
|
|
- <ui-group-option class="item">
|
|
|
- <ui-input
|
|
|
- width="100%"
|
|
|
- type="text"
|
|
|
- placeholder="路径名称"
|
|
|
- v-model="data.name"
|
|
|
- :maxlength="60"
|
|
|
- />
|
|
|
- </ui-group-option>
|
|
|
- <ui-group-option class="item">
|
|
|
- <span class="label">路径粗细</span>
|
|
|
- <span class="oper">
|
|
|
- <InputNumber
|
|
|
- style="width: 120px"
|
|
|
- v-model:value="data.lineWidth"
|
|
|
- :max="100"
|
|
|
- :min="1"
|
|
|
- :controls="false"
|
|
|
- >
|
|
|
- <template #addonBefore>
|
|
|
- <span
|
|
|
- class="fun-ctrl"
|
|
|
- @click="data.lineWidth = Math.max(1, data.lineWidth - 1)"
|
|
|
- >-</span
|
|
|
- >
|
|
|
- </template>
|
|
|
- <template #addonAfter>
|
|
|
- <span
|
|
|
- class="fun-ctrl"
|
|
|
- @click="data.lineWidth = Math.min(100, data.lineWidth + 1)"
|
|
|
- >+</span
|
|
|
- >
|
|
|
- </template>
|
|
|
- </InputNumber>
|
|
|
- </span>
|
|
|
- </ui-group-option>
|
|
|
- <ui-group-option class="item">
|
|
|
- <span class="label">路径颜色</span>
|
|
|
- <span class="oper">
|
|
|
- <ui-input type="color" width="24px" height="24px" v-model="data.lineColor" />
|
|
|
- </span>
|
|
|
- </ui-group-option>
|
|
|
- <ui-group-option class="item">
|
|
|
- <span class="label">路径箭头</span>
|
|
|
- <span class="oper">
|
|
|
- <Switch v-model:checked="data.showDirection" />
|
|
|
- </span>
|
|
|
- </ui-group-option>
|
|
|
- <ui-group-option class="item" v-if="data.showDirection">
|
|
|
- <span class="label">箭头反向</span>
|
|
|
- <span class="oper"> <Switch v-model:checked="data.reverseDirection" /> </span>
|
|
|
- </ui-group-option>
|
|
|
- </ui-group>
|
|
|
- <ui-group borderBottom>
|
|
|
- <ui-group-option>
|
|
|
- <span>文字大小</span>
|
|
|
- <Slider v-model:value="data.fontSize" :min="12" :max="60" :step="0.1" />
|
|
|
- </ui-group-option>
|
|
|
- </ui-group>
|
|
|
- <ui-group borderBottom>
|
|
|
- <ui-group-option>
|
|
|
- <SignItem
|
|
|
- label="可见范围"
|
|
|
- v-if="!data.globalVisibility"
|
|
|
- @apply-global="$emit('applyGlobal', 'visibilityRange')"
|
|
|
- >
|
|
|
- <Slider
|
|
|
- v-model:value="data.visibilityRange"
|
|
|
- :min="1"
|
|
|
- :max="1000"
|
|
|
- :step="0.1"
|
|
|
+ <div v-show="!~activePointNdx">
|
|
|
+ <ui-group
|
|
|
+ :title="`${isTemploraryID(data.id) ? '创建' : '编辑'}路线`"
|
|
|
+ borderBottom
|
|
|
+ >
|
|
|
+ <ui-group-option class="item">
|
|
|
+ <span class="label">路径名称</span>
|
|
|
+ <span class="oper"> <Switch v-model:checked="data.showName" /> </span>
|
|
|
+ </ui-group-option>
|
|
|
+ <ui-group-option class="item">
|
|
|
+ <ui-input
|
|
|
+ width="100%"
|
|
|
+ type="text"
|
|
|
+ placeholder="路径名称"
|
|
|
+ v-model="data.name"
|
|
|
+ :maxlength="60"
|
|
|
/>
|
|
|
- </SignItem>
|
|
|
- </ui-group-option>
|
|
|
-
|
|
|
- <ui-group-option>
|
|
|
- <SignItem @apply-global="$emit('applyGlobal', 'globalVisibility')">
|
|
|
- <template v-slot:label>
|
|
|
+ </ui-group-option>
|
|
|
+ <ui-group-option class="item">
|
|
|
+ <span class="label">路径粗细</span>
|
|
|
+ <span class="oper">
|
|
|
+ <InputNumber
|
|
|
+ style="width: 120px"
|
|
|
+ v-model:value="data.lineWidth"
|
|
|
+ :max="100"
|
|
|
+ :min="1"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
+ <template #addonBefore>
|
|
|
+ <span
|
|
|
+ class="fun-ctrl"
|
|
|
+ @click="data.lineWidth = Math.max(1, data.lineWidth - 1)"
|
|
|
+ >-</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template #addonAfter>
|
|
|
+ <span
|
|
|
+ class="fun-ctrl"
|
|
|
+ @click="data.lineWidth = Math.min(100, data.lineWidth + 1)"
|
|
|
+ >+</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </InputNumber>
|
|
|
+ </span>
|
|
|
+ </ui-group-option>
|
|
|
+ <ui-group-option class="item">
|
|
|
+ <span class="label">路径颜色</span>
|
|
|
+ <span class="oper">
|
|
|
<ui-input
|
|
|
- type="checkbox"
|
|
|
- label="全部范围可见"
|
|
|
- :modelValue="!!data.globalVisibility"
|
|
|
- @update:modelValue="(v: boolean) => data.globalVisibility = v"
|
|
|
+ type="color"
|
|
|
+ width="24px"
|
|
|
+ height="24px"
|
|
|
+ v-model="data.lineColor"
|
|
|
/>
|
|
|
- </template>
|
|
|
- </SignItem>
|
|
|
- </ui-group-option>
|
|
|
- </ui-group>
|
|
|
- <Button
|
|
|
- block
|
|
|
- type="primary"
|
|
|
- ghost
|
|
|
- size="large"
|
|
|
- @click="switchPlay"
|
|
|
- v-if="data.points.length"
|
|
|
- >
|
|
|
- {{ isScenePathPlayIng ? "停止" : "" }} 预览路径
|
|
|
- </Button>
|
|
|
+ </span>
|
|
|
+ </ui-group-option>
|
|
|
+ <ui-group-option class="item">
|
|
|
+ <span class="label">路径箭头</span>
|
|
|
+ <span class="oper">
|
|
|
+ <Switch v-model:checked="data.showDirection" />
|
|
|
+ </span>
|
|
|
+ </ui-group-option>
|
|
|
+ <ui-group-option class="item" v-if="data.showDirection">
|
|
|
+ <span class="label">箭头反向</span>
|
|
|
+ <span class="oper"> <Switch v-model:checked="data.reverseDirection" /> </span>
|
|
|
+ </ui-group-option>
|
|
|
+ </ui-group>
|
|
|
+ <ui-group borderBottom>
|
|
|
+ <ui-group-option>
|
|
|
+ <span>文字大小</span>
|
|
|
+ <Slider v-model:value="data.fontSize" :min="12" :max="60" :step="0.1" />
|
|
|
+ </ui-group-option>
|
|
|
+ </ui-group>
|
|
|
+ <ui-group borderBottom>
|
|
|
+ <ui-group-option>
|
|
|
+ <SignItem
|
|
|
+ label="可见范围"
|
|
|
+ v-if="!data.globalVisibility"
|
|
|
+ @apply-global="$emit('applyGlobal', 'visibilityRange')"
|
|
|
+ >
|
|
|
+ <Slider
|
|
|
+ v-model:value="data.visibilityRange"
|
|
|
+ :min="1"
|
|
|
+ :max="1000"
|
|
|
+ :step="0.1"
|
|
|
+ />
|
|
|
+ </SignItem>
|
|
|
+ </ui-group-option>
|
|
|
+
|
|
|
+ <ui-group-option>
|
|
|
+ <SignItem @apply-global="$emit('applyGlobal', 'globalVisibility')">
|
|
|
+ <template v-slot:label>
|
|
|
+ <ui-input
|
|
|
+ type="checkbox"
|
|
|
+ label="全部范围可见"
|
|
|
+ :modelValue="!!data.globalVisibility"
|
|
|
+ @update:modelValue="(v: boolean) => data.globalVisibility = v"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </SignItem>
|
|
|
+ </ui-group-option>
|
|
|
+ </ui-group>
|
|
|
+ <Button
|
|
|
+ block
|
|
|
+ type="primary"
|
|
|
+ ghost
|
|
|
+ size="large"
|
|
|
+ @click="switchPlay"
|
|
|
+ v-if="data.points.length"
|
|
|
+ >
|
|
|
+ {{ isScenePathPlayIng ? "停止" : "" }} 预览路径
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ <div v-if="~activePointNdx">
|
|
|
+ <ui-group title="编辑点" borderBottom>
|
|
|
+ <ui-group-option>描述:</ui-group-option>
|
|
|
+ <ui-group-option>
|
|
|
+ <ui-input
|
|
|
+ class="input"
|
|
|
+ width="100%"
|
|
|
+ height="158px"
|
|
|
+ v-model="data.points[activePointNdx].name"
|
|
|
+ placeholder="特征描述:"
|
|
|
+ type="richtext"
|
|
|
+ :maxlength="200"
|
|
|
+ />
|
|
|
+ </ui-group-option>
|
|
|
+ </ui-group>
|
|
|
+ <Button block danger type="primary" ghost size="large" @click="deletePoint">
|
|
|
+ 删除
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
</RightFillPano>
|
|
|
|
|
|
<span
|
|
@@ -155,6 +184,22 @@ watch(node, () => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+const activePointNdx = ref(-1);
|
|
|
+watchEffect((onCleanup) => {
|
|
|
+ if (!node.value) return;
|
|
|
+ const $node = node.value;
|
|
|
+ const handler = (ndx: number) => {
|
|
|
+ activePointNdx.value = ndx;
|
|
|
+ };
|
|
|
+ $node.bus.on("activePoint", handler);
|
|
|
+ onCleanup(() => $node.bus.off("activePoint", handler));
|
|
|
+});
|
|
|
+
|
|
|
+const deletePoint = () => {
|
|
|
+ props.data.points.splice(activePointNdx.value, 1);
|
|
|
+ activePointNdx.value = -1;
|
|
|
+};
|
|
|
+
|
|
|
let unKeepAdding = shallowRef<() => void>();
|
|
|
const keepAdding = () => {
|
|
|
unKeepAdding.value && unKeepAdding.value();
|