|
|
@@ -1,27 +1,30 @@
|
|
|
<template>
|
|
|
<!-- <template v-for="(path, index) in paths" :key="path.id">
|
|
|
v-if="getPathIsShow(path)" -->
|
|
|
- <Sign
|
|
|
- v-for="(path, index) in paths"
|
|
|
- @delete="deletePath(path)"
|
|
|
- @updatePoints="(data) => updatePosition(index, data)"
|
|
|
- @updateLinePosition="(data) => updateLinePosition(index, data)"
|
|
|
- @updateLineHeight="(data) => (paths[index].lineAltitudeAboveGround = data)"
|
|
|
- :ref="(node: any) => nodeHandler(index, node)"
|
|
|
- :path="path"
|
|
|
- :key="path.id"
|
|
|
- />
|
|
|
+ <div class="pathList">
|
|
|
+ <Sign
|
|
|
+ v-for="(path, index) in paths"
|
|
|
+ @delete="deletePath(path)"
|
|
|
+ @updatePoints="(data) => updatePosition(index, data)"
|
|
|
+ @updateLinePosition="(data) => updateLinePosition(index, data)"
|
|
|
+ @updateLineHeight="(data) => (paths[index].lineAltitudeAboveGround = data)"
|
|
|
+ :ref="(node: any) => nodeHandler(index, node)"
|
|
|
+ @updateId="(id) => refreshId = id"
|
|
|
+ :path="path"
|
|
|
+ :key="path.id == refreshId ? Date.now() : path.id"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<!-- </template> -->
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { reactive, watchEffect } from "vue";
|
|
|
+import { reactive, watchEffect, ref } from "vue";
|
|
|
import Sign from "./sign.vue";
|
|
|
import { getPathIsShow, Path } from "@/store";
|
|
|
import { PathsNode } from "@/sdk/association/path";
|
|
|
const props = defineProps<{ paths: Path[] }>();
|
|
|
const nodes = reactive([]) as PathsNode;
|
|
|
-
|
|
|
+const refreshId = ref(null as any);
|
|
|
watchEffect(() => (nodes.length = props.paths.length));
|
|
|
|
|
|
const deletePath = (path: Path) => {
|