|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<Teleport to="#layout-app">
|
|
|
<RightFillPano class="edit-path-point">
|
|
|
- <div v-show="!~activePointNdx">
|
|
|
+ <div v-show="!~activePointNdx" :class="{ disable: !complete }">
|
|
|
<ui-group
|
|
|
:title="`${isTemploraryID(data.id) ? '创建' : '编辑'}路线`"
|
|
|
borderBottom
|
|
@@ -117,7 +117,7 @@
|
|
|
{{ isScenePathPlayIng ? "停止" : "" }} 预览路径
|
|
|
</Button>
|
|
|
</div>
|
|
|
- <div v-if="~activePointNdx">
|
|
|
+ <div v-if="~activePointNdx" :class="{ disable: !complete }">
|
|
|
<ui-group title="编辑点" borderBottom>
|
|
|
<ui-group-option>描述:</ui-group-option>
|
|
|
<ui-group-option>
|
|
@@ -127,7 +127,7 @@
|
|
|
height="158px"
|
|
|
v-model="data.points[activePointNdx].name"
|
|
|
placeholder="特征描述:"
|
|
|
- type="richtext"
|
|
|
+ type="textarea"
|
|
|
:maxlength="200"
|
|
|
/>
|
|
|
</ui-group-option>
|
|
@@ -141,7 +141,7 @@
|
|
|
<span
|
|
|
@click="unKeepAdding ? unKeepAdding() : keepAdding()"
|
|
|
class="pin-position strengthen fun-ctrl"
|
|
|
- v-if="node"
|
|
|
+ v-if="node && complete"
|
|
|
>
|
|
|
<ui-icon
|
|
|
:style="{ color: unKeepAdding ? 'var(--color-main-normal)' : 'currentColor' }"
|
|
@@ -173,6 +173,7 @@ import {
|
|
|
pauseScenePath,
|
|
|
playScenePath,
|
|
|
} from "@/sdk/association/path";
|
|
|
+import { nextTick } from "process";
|
|
|
|
|
|
const props = defineProps<{ data: Path }>();
|
|
|
|
|
@@ -187,6 +188,8 @@ watch(node, () => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+const currentComplete = !!props.data.points.length;
|
|
|
+const complete = ref(currentComplete);
|
|
|
const activePointNdx = ref(-1);
|
|
|
watchEffect((onCleanup) => {
|
|
|
if (!node.value) return;
|
|
@@ -194,8 +197,19 @@ watchEffect((onCleanup) => {
|
|
|
const handler = (ndx: number) => {
|
|
|
activePointNdx.value = ndx;
|
|
|
};
|
|
|
+ $node.changeEditMode(true);
|
|
|
$node.bus.on("activePoint", handler);
|
|
|
- onCleanup(() => $node.bus.off("activePoint", handler));
|
|
|
+ if (!currentComplete) {
|
|
|
+ $node.bus.on("drawed", () => (complete.value = true));
|
|
|
+ }
|
|
|
+
|
|
|
+ onCleanup(() => {
|
|
|
+ $node.bus.off("activePoint", handler);
|
|
|
+ $node.changeEditMode(false);
|
|
|
+ if (!currentComplete) {
|
|
|
+ $node.bus.off("drawed");
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
const deletePoint = () => {
|
|
@@ -217,14 +231,14 @@ const keepAdding = () => {
|
|
|
};
|
|
|
onUnmounted(() => unKeepAdding.value && unKeepAdding.value());
|
|
|
|
|
|
-useViewStack(() =>
|
|
|
- togetherCallback([
|
|
|
+useViewStack(() => {
|
|
|
+ return togetherCallback([
|
|
|
showRightPanoStack.push(ref(false)),
|
|
|
showLeftCtrlPanoStack.push(ref(false)),
|
|
|
showLeftPanoStack.push(ref(false)),
|
|
|
showRightCtrlPanoStack.push(ref(false)),
|
|
|
- ])
|
|
|
-);
|
|
|
+ ]);
|
|
|
+});
|
|
|
|
|
|
const switchPlay = () => {
|
|
|
if (isScenePathPlayIng.value) {
|