城市内湖前3表

This commit is contained in:
庞东林
2021-12-08 10:43:34 +08:00
parent 3670be1575
commit 23d63cb7f4
9 changed files with 252 additions and 192 deletions

View File

@@ -8,7 +8,7 @@
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="断面名称:">
<a-select v-model:value="where.sectionName" allowClear showSearch>
<a-select-option v-for="item in palceOptions" :key="item.value"
<a-select-option v-for="item in sectionOptions" :key="item.value"
>{{ item.label }}
</a-select-option>
</a-select>
@@ -55,11 +55,9 @@
allowClear
placeholder="未选择"
>
<a-select-option value="良庆区">良庆区</a-select-option>
<a-select-option value="江南区">江南区</a-select-option>
<a-select-option value="江南区">横县</a-select-option>
<a-select-option value="江南区">青秀区</a-select-option>
<a-select-option value="江南区">良庆区</a-select-option>
<a-select-option v-for="item in palceOptions" :key="item.value"
>{{ item.label }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
@@ -123,6 +121,7 @@
<script>
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import { innerFilterColumns } from "./raw-colums";
import {getLakeDropdown} from "@/api/ecology/new-lake";
export default {
name: "inner-search",
props: {
@@ -138,7 +137,10 @@ export default {
default: function () {
return [];
},
}
},
visiable:{
typeof:Boolean
}
},
data() {
return {
@@ -152,9 +154,14 @@ export default {
filterColumns: innerFilterColumns,
newCloumns:[],
oldCloumns:[],
filterItem:[]
filterItem:[],
palceOptions:[],
sectionOptions:[]
};
},
created(){
this.loadOptionData();
},
watch: {
searchForm(newV) {
this.where = newV;
@@ -174,7 +181,11 @@ export default {
this.checkAll = true
this.indeterminate = false
}
}
},
// 监听组件显示
visiable(val){
this.emitData(val)
}
},
mounted() {
this.where = this.searchForm;
@@ -184,18 +195,45 @@ export default {
this.oldCloumns = [...innerFilterColumns];
// this.$emit("buildColumns", innerFilterColumns);
this.initFilter(this.filterKeys);
this.emitData(true)
},
methods: {
emitData(val){
if(val && this.where.startTime && this.where.endTime){
this.$emit("search", this.where);
}
},
// 初始化选择
initFilter(newKeys){
let filterIndex =this.filterColumns.map(item=>(item.dataIndex))
let filterIndex =this.filterColumns.map(item=>(item.dataIndex))
const newList = filterIndex.filter((item) => {
return newKeys.indexOf(item) == -1
})
this.filter = newList;
},
/**获取下来框数据 */
loadOptionData() {
getLakeDropdown().then((res) => {
this.palceOptions = res.data.data.map((item) => {
return {
label: item.regionName,
value: item.regionName,
};
});
this.sectionOptions= res.data.data.map((item) => {
return {
label: item.sectionName,
value: item.sectionName,
};
});
});
},
// 指标全选
onCheckAllChange (e) {
this.filter = e.target.checked ? innerFilterColumns.map((item) => item.dataIndex) : []
@@ -212,7 +250,9 @@ export default {
this.newCloumns = newCloumns;
},
reset() {
this.where = {};
this.where = {
checked: 1,
};
this.searchData();
},
searchData() {