fix: 修改接口调用参数

This commit is contained in:
Xu Zhimeng 2023-07-25 20:01:55 +08:00
parent 94e1808ed3
commit 392a023504

View File

@ -127,18 +127,18 @@ export default {
methods: {
loadData(arg) {
const params = this.getQueryParams() //
const { startDate, endDate, menuTypes } = params
const { startDate, endDate, menuTypes } = params
if (!menuTypes) {
this.$message.warn('Please Select SampleType First')
return
}
if(!startDate || !endDate) {
if (!startDate || !endDate) {
this.$message.warn(`'From' Date And 'To' Date Cannot Be Null`)
return
}
if(moment(startDate).isAfter(moment(endDate))) {
if (moment(startDate).isAfter(moment(endDate))) {
this.$message.warn(`'From' Date Cannot Be Late Than 'To' Date`)
return
}
@ -148,12 +148,8 @@ export default {
this.ipagination.current = 1
}
if (params.checkboxGroup) {
params.checkboxGroup.forEach(item => {
params[item] = true
})
delete params.checkboxGroup
}
params.AllUsers = this.allUsersValue
delete params.checkboxGroup
this.onClearSelected()
@ -191,13 +187,11 @@ export default {
//
async getStationAndDetectorList(value) {
if (!value) {
return
}
try {
const { success, result, message } = await getAction('/spectrumAnalysis/getDBSearchList', {
menuTypes: value
menuTypes: value,
dbName: this.queryParam.dbName,
AllUsers: this.allUsersValue
})
if (success) {
this.stationList = result.stationCode.map(item => ({ label: item, value: item }))
@ -256,6 +250,11 @@ export default {
},
on: {
change: event => {
if (!event) {
this.stationList = []
this.detectorList = []
return
}
this.getStationAndDetectorList(event)
}
}
@ -389,7 +388,7 @@ export default {
name: 'checkboxGroup',
props: {
options: [
{ label: 'All User', value: 'allUser' },
{ label: 'All User', value: 'AllUsers' },
{ label: 'Collect Stop', value: 'CollectStop' },
{ label: 'Acq.Start', value: 'AcqStart' }
]
@ -432,6 +431,21 @@ export default {
}
}
]
},
allUsersValue() {
const checkboxGroup = this.queryParam.checkboxGroup
return !!(checkboxGroup && checkboxGroup.includes('AllUsers'))
}
},
watch: {
// All User station detector
allUsersValue() {
if (this.queryParam.menuTypes) {
this.stationList = []
this.detectorList = []
this.getStationAndDetectorList(this.queryParam.menuTypes)
}
}
}
}