|
|
@ -1,24 +1,38 @@ |
|
|
|
<template> |
|
|
|
<div class='HomeFilter'> |
|
|
|
<ElPopover trigger="manual" :value="activeIcon === 'filter'" :visibleArrow="false" placement="left" |
|
|
|
popper-class="global-input-search-popover"> |
|
|
|
<Button :class="['btn', { 'btn-active': activeIcon }]" slot="reference" @click.native="handleClick('filter')"> |
|
|
|
<img src="@screen/images/home-filter/filter.svg"> |
|
|
|
<div class="HomeFilter"> |
|
|
|
<ElPopover |
|
|
|
trigger="manual" |
|
|
|
:value="activeIcon === 'filter'" |
|
|
|
:visibleArrow="false" |
|
|
|
placement="left" |
|
|
|
popper-class="global-input-search-popover" |
|
|
|
> |
|
|
|
<Button |
|
|
|
:class="['btn', { 'btn-active': activeIcon }]" |
|
|
|
slot="reference" |
|
|
|
@click.native="handleClick('filter')" |
|
|
|
> |
|
|
|
<img src="@screen/images/home-filter/filter.svg" /> |
|
|
|
</Button> |
|
|
|
|
|
|
|
<div class="body"> |
|
|
|
<div class="title"> |
|
|
|
设备筛选 |
|
|
|
</div> |
|
|
|
<Form labelWidth="90px" column="1" class="form" ref="FormConfigRef" :formList="formList" /> |
|
|
|
<div class="title">设备筛选</div> |
|
|
|
<Form |
|
|
|
labelWidth="90px" |
|
|
|
column="1" |
|
|
|
class="form" |
|
|
|
ref="FormConfigRef" |
|
|
|
:formList="formList" |
|
|
|
/> |
|
|
|
|
|
|
|
<div class="footer"> |
|
|
|
<Button style="background-color: rgba(0, 179, 204, .3);" @click.native="handleResetForm"> |
|
|
|
<Button |
|
|
|
style="background-color: rgba(0, 179, 204, 0.3)" |
|
|
|
@click.native="handleResetForm" |
|
|
|
> |
|
|
|
重置 |
|
|
|
</Button> |
|
|
|
<Button @click.native="handleSearch"> |
|
|
|
搜索 |
|
|
|
</Button> |
|
|
|
<Button @click.native="handleSearch"> 搜索 </Button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</ElPopover> |
|
|
@ -26,17 +40,18 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import Button from '@screen/components/Buttons/Button.vue'; |
|
|
|
import Form from '@screen/components/FormConfig'; |
|
|
|
import Button from "@screen/components/Buttons/Button.vue"; |
|
|
|
import Form from "@screen/components/FormConfig"; |
|
|
|
import * as PresetFormItems from "@screen/common/PresetFormItems.js"; |
|
|
|
import { merge, cloneDeep } from "lodash" |
|
|
|
import { merge, cloneDeep } from "lodash"; |
|
|
|
import request from "@/utils/request"; |
|
|
|
import { log } from "mathjs"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'HomeFilter', |
|
|
|
name: "HomeFilter", |
|
|
|
components: { |
|
|
|
Button, |
|
|
|
Form |
|
|
|
Form, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -49,7 +64,7 @@ export default { |
|
|
|
key: "deviceType", |
|
|
|
type: "select", |
|
|
|
options: { |
|
|
|
options: [] |
|
|
|
options: [], |
|
|
|
}, |
|
|
|
// visible: data => { |
|
|
|
// if (data.searchType == 1) { |
|
|
@ -57,29 +72,32 @@ export default { |
|
|
|
// } |
|
|
|
// }, |
|
|
|
}, |
|
|
|
] |
|
|
|
} |
|
|
|
], |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleClick(type) { |
|
|
|
console.log("type: ", type); |
|
|
|
this.activeIcon = this.activeIcon === type ? null : type; |
|
|
|
console.log("this.activeIcon", this.activeIcon); |
|
|
|
}, |
|
|
|
filterEnd(data) { |
|
|
|
this.activeIcon = null; |
|
|
|
// this.filterData = data; |
|
|
|
this.$parent.$refs.RoadAndEventsRef?.setFilterData?.(data); |
|
|
|
}, |
|
|
|
async handleResetForm() { |
|
|
|
this.$refs.FormConfigRef?.reset(); |
|
|
|
this.filterEnd(null) |
|
|
|
this.activeIcon = "filter"; |
|
|
|
this.filterEnd(null); |
|
|
|
}, |
|
|
|
async handleSearch() { |
|
|
|
const data = await this.$refs.FormConfigRef.validate(); |
|
|
|
|
|
|
|
if (!data.startStakeMark[0] || !data.startStakeMark[1]) delete data.startStakeMark; |
|
|
|
if (!data.endStakeMark[0] || !data.endStakeMark[1]) delete data.endStakeMark; |
|
|
|
|
|
|
|
this.filterEnd(data) |
|
|
|
if (!data.startStakeMark[0] || !data.startStakeMark[1]) |
|
|
|
delete data.startStakeMark; |
|
|
|
if (!data.endStakeMark[0] || !data.endStakeMark[1]) |
|
|
|
delete data.endStakeMark; |
|
|
|
this.activeIcon = null; |
|
|
|
this.filterEnd(data); |
|
|
|
}, |
|
|
|
async getDeviceTypeOptions() { |
|
|
|
// try { |
|
|
@ -90,15 +108,15 @@ export default { |
|
|
|
// }); |
|
|
|
// } catch (e) { console.error(e); } |
|
|
|
// return ; |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
async created() { |
|
|
|
// await this.getDeviceTypeOptions(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang='scss'> |
|
|
|
<style lang="scss"> |
|
|
|
div.el-popper.global-input-search-popover { |
|
|
|
background: rgba(6, 66, 88, 0.8); |
|
|
|
border: 1px solid rgba(42, 217, 253, 0.6); |
|
|
@ -108,23 +126,25 @@ div.el-popper.global-input-search-popover { |
|
|
|
|
|
|
|
.body { |
|
|
|
.title { |
|
|
|
background: linear-gradient(90deg, #237E9B 0%, rgba(23, 145, 184, 0) 100%); |
|
|
|
background: linear-gradient( |
|
|
|
90deg, |
|
|
|
#237e9b 0%, |
|
|
|
rgba(23, 145, 184, 0) 100% |
|
|
|
); |
|
|
|
padding: 3px 9px; |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
left: 0; |
|
|
|
width: 100%; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
<style lang='scss' scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.HomeFilter { |
|
|
|
|
|
|
|
.btn { |
|
|
|
padding: 9px; |
|
|
|
background: linear-gradient(180deg, #152E3C 0%, #163A45 100%); |
|
|
|
background: linear-gradient(180deg, #152e3c 0%, #163a45 100%); |
|
|
|
border-radius: 4px; |
|
|
|
overflow: hidden; |
|
|
|
height: unset; |
|
|
@ -132,7 +152,7 @@ div.el-popper.global-input-search-popover { |
|
|
|
} |
|
|
|
|
|
|
|
.btn-active { |
|
|
|
background: linear-gradient(180deg, #005C79 0%, #009BCC 100%); |
|
|
|
background: linear-gradient(180deg, #005c79 0%, #009bcc 100%); |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|