From 1788c96aea9247cc36ef8b82734997f1a6a92fb4 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 23 八月 2024 11:07:42 +0800 Subject: [PATCH] 新增新版本。静安区特供版 --- src/components/search/SearchBar.vue | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 44 insertions(+), 9 deletions(-) diff --git a/src/components/search/SearchBar.vue b/src/components/search/SearchBar.vue index 68ee8ed..a7de11b 100644 --- a/src/components/search/SearchBar.vue +++ b/src/components/search/SearchBar.vue @@ -1,15 +1,24 @@ <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" v-model="formSearch.deviceCode" ></OptionDevice> - <OptionTime v-model="formSearch.timeArray"></OptionTime> - <el-button type="primary" class="el-button-custom" @click="handleClick"> + <OptionTime + v-model="formSearch.timeArray" + :start-date="dateRange[0]" + :end-date="dateRange[1]" + ></OptionTime> + <el-button + :loading="loading" + type="primary" + class="el-button-custom" + @click="handleClick" + > 鍒嗘瀽 </el-button> </el-form> @@ -21,34 +30,55 @@ // 鎼滅储妗� export default { props: { + loading: Boolean, searchTime: Array }, data() { return { + mission: undefined, formSearch: { - missionCode: '', type: '', deviceCode: '', timeArray: [] - } + }, + // 鍙�夋棩鏈熻寖鍥达紝鏍规嵁璧拌埅浠诲姟鍐冲畾 + dateRange: [] }; }, emits: ['search'], 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.dateRange = [new Date(nV.startTime), new Date(nV.endTime)]; + this.formSearch.type = nV.deviceType; + this.formSearch.deviceCode = nV.deviceCode; + + // 浠h〃棣栨杩涘叆鐣岄潰锛屾鏃惰嚜鍔ㄦ墽琛岄涓换鍔$殑鏁版嵁鏌ヨ鎿嶄綔 + if (oV == undefined) { + setTimeout(() => { + this.handleClick(); + }, 500); + } } } }, methods: { handleClick() { - this.$emit('search', this.formSearch); + this.$emit('search', { ...this.formSearch, mission: this.mission }); } } }; </script> -<style lang="scss"> +<style scoped lang="scss"> .map-date-selector { display: inline-block; position: relative; @@ -62,4 +92,9 @@ .p-events-auto { } + +.el-form-item { + margin-bottom: 0px; + margin-right: 8px !important; +} </style> -- Gitblit v1.9.3