bill 2 月之前
父节点
当前提交
ff7d2f6ad1
共有 3 个文件被更改,包括 8 次插入0 次删除
  1. 1 0
      src/components/path/list.vue
  2. 6 0
      src/components/path/sign.vue
  3. 1 0
      src/sdk/sdk.ts

+ 1 - 0
src/components/path/list.vue

@@ -5,6 +5,7 @@
       @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"

+ 6 - 0
src/components/path/sign.vue

@@ -25,6 +25,7 @@ const emit = defineEmits<{
   (e: "delete"): void;
   (e: "updateLinePosition", val: Path["linePosition"]): void;
   (e: "updatePoints", val: Path["points"]): void;
+  (e: "updateLineHeight", val: Path["lineAltitudeAboveGround"]): void;
 }>();
 
 const getLineProps = () => ({
@@ -69,6 +70,11 @@ path.bus.on("changePoints", (points) => {
   }));
   emit("updatePoints", currentPoints);
 });
+path.bus.on("changeLineHeight", (val) => {
+  console.log("changeHeight");
+  emit("updateLineHeight", val);
+  clearTimeout(changLineTimeout);
+});
 watchEffect(() => {
   path.changeName(props.path.name);
 });

+ 1 - 0
src/sdk/sdk.ts

@@ -232,6 +232,7 @@ export type PathProps = {
 }
 export type Path = {
   bus: Emitter<{
+    changeLineHeight: number
     activePoint: number
     // 标注点击事件
     click: void;