From f5624d6a7ad32ee475e00edbad26bc98ea4629e1 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 10 五月 2024 17:35:54 +0800
Subject: [PATCH] 实时走航模块

---
 src/components/search/SearchBar.vue |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/components/search/SearchBar.vue b/src/components/search/SearchBar.vue
index 68ee8ed..1c1202d 100644
--- a/src/components/search/SearchBar.vue
+++ b/src/components/search/SearchBar.vue
@@ -1,8 +1,8 @@
 <template>
-  <BaseCard class="">
+  <BaseCard size="middle-s" direction="down">
     <template #content>
       <el-form :inline="true">
-        <OptionMission v-model="formSearch.missionCode"></OptionMission>
+        <OptionMission v-model="mission"></OptionMission>
         <OptionType v-model="formSearch.type"></OptionType>
         <OptionDevice
           :type="formSearch.type"
@@ -25,8 +25,8 @@
   },
   data() {
     return {
+      mission: {},
       formSearch: {
-        missionCode: '',
         type: '',
         deviceCode: '',
         timeArray: []
@@ -37,13 +37,23 @@
   watch: {
     searchTime(nV, oV) {
       if (nV != oV) {
-        this.timeArray = this.searchTime;
+        this.formSearch.timeArray = this.searchTime;
+      }
+    },
+    mission(nV, oV) {
+      if (nV != oV) {
+        this.formSearch.timeArray = [
+          new Date(nV.startTime),
+          new Date(nV.endTime)
+        ];
+        this.formSearch.type = nV.deviceType;
+        this.formSearch.deviceCode = nV.deviceCode;
       }
     }
   },
   methods: {
     handleClick() {
-      this.$emit('search', this.formSearch);
+      this.$emit('search', { ...this.formSearch, mission: this.mission });
     }
   }
 };

--
Gitblit v1.9.3