From 79f8ad79d4aebbc26037cda5d5a9a1ed295b6e4b Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Wed, 13 Sep 2023 17:29:54 +0800
Subject: [PATCH] 计划选择航线回显

---
 src/components/task/CreatePlan.vue |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/components/task/CreatePlan.vue b/src/components/task/CreatePlan.vue
index cd3736c..473e0f3 100644
--- a/src/components/task/CreatePlan.vue
+++ b/src/components/task/CreatePlan.vue
@@ -25,9 +25,11 @@
                   {{ wayline.name }}
                 </div>
               </a-tooltip>
+
               <div class="ml10">
                 <UserOutlined />
               </div>
+
               <a-tooltip :title="wayline.user_name">
                 <div class="ml5 pr10"
                   style="width: 80px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">
@@ -264,7 +266,7 @@
 </template>
 
 <script lang="ts" setup>
-import { computed, onMounted, onUnmounted, reactive, ref, toRaw, UnwrapRef } from 'vue'
+import { computed, onMounted, onUnmounted, reactive, ref, toRaw, UnwrapRef, watch } from 'vue'
 import {
   CloseOutlined,
   RocketOutlined,
@@ -291,6 +293,7 @@
 } from '/@/types/task'
 import moment, { Moment } from 'moment'
 import { RuleObject } from 'ant-design-vue/es/form/interface'
+import { clickPoint, pointCenter } from '/@/hooks/use-center-point'
 
 const btnSize = 'size'
 const root = getRoot()
@@ -298,6 +301,13 @@
 const workspaceId = localStorage.getItem(ELocalStorageKey.WorkspaceId)!
 const wayline = computed<WaylineFile>(() => {
   return store.state.waylineInfo
+})
+watch(() => wayline, (newVal) => {
+  if (newVal.value.id) {
+    planForm.fileId = newVal.value.id
+  }
+}, {
+  deep: true
 })
 
 const calculateDisabled = computed(() => {
@@ -370,8 +380,6 @@
   }
 }
 
-const repeatRuleValue = ref([] as string[])
-
 const dock = computed<Device>(() => {
   return store.state.dockInfo
 })
@@ -423,7 +431,7 @@
   // 公共字段
   form.name = planForm.name
   form.workspaceId = store.state.common.projectId
-  form.waylineId = planForm.waylineId
+  form.fileId = planForm.fileId
   form.dockSn = planForm.dockSn
   form.taskType = planForm.taskType
   form.rthAltitude = planForm.rthAltitude

--
Gitblit v1.9.3