From 021e4bb85124931388b067c262d844bcd6f1db09 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 13 六月 2024 17:29:31 +0800 Subject: [PATCH] 完善创建任务功能 --- src/components/search/SearchBar.vue | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/components/search/SearchBar.vue b/src/components/search/SearchBar.vue index 03e4082..4534886 100644 --- a/src/components/search/SearchBar.vue +++ b/src/components/search/SearchBar.vue @@ -1,14 +1,22 @@ <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 + :loading="loading" + type="primary" + class="el-button-custom" + @click="handleClick" + > + 鍒嗘瀽 + </el-button> </el-form> </template> </BaseCard> @@ -17,17 +25,57 @@ <script> // 鎼滅储妗� export default { + props: { + loading: Boolean, + 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