From 75aeb4e63339b60f9559af984c7d9f87a7cba24a Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 09 五月 2024 17:40:47 +0800
Subject: [PATCH] 轨迹动画和任务管理

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

diff --git a/src/components/search/SearchBar.vue b/src/components/search/SearchBar.vue
index 03e4082..1c1202d 100644
--- a/src/components/search/SearchBar.vue
+++ b/src/components/search/SearchBar.vue
@@ -1,14 +1,17 @@
 <template>
-  <BaseCard class="map-date-selector">
+  <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"
           v-model="formSearch.deviceCode"
         ></OptionDevice>
         <OptionTime v-model="formSearch.timeArray"></OptionTime>
+        <el-button type="primary" class="el-button-custom" @click="handleClick">
+          鍒嗘瀽
+        </el-button>
       </el-form>
     </template>
   </BaseCard>
@@ -17,17 +20,56 @@
 <script>
 // 鎼滅储妗�
 export default {
+  props: {
+    searchTime: Array
+  },
   data() {
     return {
+      mission: {},
       formSearch: {
-        missionCode: '',
         type: '',
         deviceCode: '',
         timeArray: []
       }
     };
   },
-  method: {}
+  emits: ['search'],
+  watch: {
+    searchTime(nV, oV) {
+      if (nV != oV) {
+        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, mission: this.mission });
+    }
+  }
 };
 </script>
-<style scoped></style>
+<style lang="scss">
+.map-date-selector {
+  display: inline-block;
+  position: relative;
+  /* left: 0;
+    right: 0;
+    top: 0px; */
+  /* padding: 0 4px; */
+  /* color: ffffffbd; */
+  /* background-color: antiquewhite; */
+}
+
+.p-events-auto {
+}
+</style>

--
Gitblit v1.9.3