处理地图右侧filter功能不生效的问题

This commit is contained in:
任珮宇 2023-10-27 16:52:25 +08:00
parent 5125c5bf64
commit c2e34c2af3

View File

@ -205,7 +205,7 @@ export default {
markerList: [], //
markerList_clone: [], //
upDateStationList: [], //
orgStationList: [], //
orgStationList: [], //
markerType: 1, //
circleRadius: 0,
@ -227,6 +227,7 @@ export default {
treeData: [], //
timer: null,
updataFilterType: [],
updataFilterDataQuality: [],
}
},
created() {
@ -290,12 +291,19 @@ export default {
})
})
this.orgStationList = res.result
let arrA = []
let arrB = []
let arrC = []
if (this.updataFilterType.length > 0) {
this.upDateStationList = this.orgStationList.filter((item) =>
this.updataFilterType.includes(item.stationType)
)
arrA = this.orgStationList.filter((item) => this.updataFilterType.includes(item.stationType))
} else {
this.upDateStationList = res.result
arrA = res.result
}
if (this.updataFilterDataQuality.length > 0) {
arrB = this.orgStationList.filter((item) => this.updataFilterDataQuality.includes(item.quality))
} else {
arrB = res.result
// this.upDateStationList = res.result
}
if (this.markerList.length > 0) {
let curList = []
@ -308,8 +316,13 @@ export default {
})
}
})
this.upDateStationList = curList
arrC = curList
} else {
arrC = []
}
if (arrA.length > 0 && arrB.length > 0 && arrC.length > 0) {
this.upDateStationList = arrA.filter((val) => arrB.includes(val)).filter((item) => arrC.includes(item))
} else if (arrA.length == 0 || arrB.length == 0 || arrC.length == 0) {
this.upDateStationList = []
}
setTimeout(() => {
@ -492,8 +505,23 @@ export default {
filterType,
filterDataQuality
)
this.updataFilterDataQuality = []
filterDataQuality.forEach((item) => {
if (item === 'Excellent data quality') {
this.updataFilterDataQuality.push('excellent')
} else if (item === 'Good data quality') {
this.updataFilterDataQuality.push('good')
} else if (item === 'Poor data quality') {
this.updataFilterDataQuality.push('bad')
} else {
this.updataFilterDataQuality.push('signal')
}
})
this.markerList = this.originalDataList.filter((item) => filterType.includes(item.stationType))
this.upDateStationList = this.orgStationList.filter((item) => filterType.includes(item.stationType))
this.upDateStationList = this.upDateStationList.filter((item) =>
this.updataFilterDataQuality.includes(item.quality)
)
},
//