fix: 优化load from db搜索栏station和detector列表逻辑

This commit is contained in:
Xu Zhimeng 2023-11-13 18:27:59 +08:00
parent 9d1910e689
commit 2cd1cd9f7d

View File

@ -234,7 +234,7 @@ export default {
})
if (success) {
this.stationList = result.stationCode.map((item) => ({ label: item, value: item }))
this.detectorList = this.allDetectorList = result.detectorCode.map((item) => ({ label: item, value: item }))
this.allDetectorList = result.detectorCode.map((item) => ({ label: item, value: item }))
} else {
this.$message.error(message)
}
@ -360,9 +360,14 @@ export default {
},
on: {
change: (val) => {
this.detectorList = this.allDetectorList.filter((item) => {
return item.label.includes(val)
})
if(val) {
this.detectorList = this.allDetectorList.filter((item) => {
return item.label.includes(val)
})
} else {
this.detectorList = []
}
this.queryParam.detectorsName = []
},
},
},