statistics 页面搜索条件添加校验提示

This commit is contained in:
任珮宇 2024-01-24 18:39:04 +08:00
parent 5c73a26d21
commit e1cdea9222

View File

@ -274,7 +274,7 @@ export default {
stationIds: [],
queryParams: {
systemType: undefined,
nuclideNames: undefined,
nuclideNames: [],
dbName: undefined,
startDate: moment().subtract(6, 'days').format('YYYY-MM-DD'),
endDate: moment().format('YYYY-MM-DD'),
@ -373,9 +373,11 @@ export default {
this.queryParams.endDate = dateString
},
handleSearch() {
this.isDefault = false
this.chartInitList = []
this.chartLayout = []
if (this.queryParams.systemType) {
if (this.stationIds.length > 0) {
this.isDefault = false
this.stationIds.forEach((id, index) => {
this.chartLayout.push(id)
this.$nextTick(() => {
@ -386,13 +388,36 @@ export default {
stationId: id,
}
let options = cloneDeep(commonOptions)
if (this.queryParams.nuclideNames.length > 0) {
this.getChartDate(params, currChartInit, options, id)
} else {
if (this.queryParams.nuclideNames.length < 1) {
this.$message.warning(`Please select nuclide!`)
// this.getChartDate(params, currChartInit, options, id)
}
if (!this.queryParams.dbName) {
this.$message.warning(`Please select Data Source!`)
}
if (!this.queryParams.startDate) {
this.$message.warning(`Please select start Date!`)
}
if (!this.queryParams.endDate) {
this.$message.warning(`Please select end Date!`)
}
if (
this.queryParams.nuclideNames.length > 0 &&
this.queryParams.dbName &&
this.queryParams.startDate &&
this.queryParams.endDate
) {
this.getChartDate(params, currChartInit, options, id)
}
})
})
} else {
this.$message.warning(`Please select stations!`)
}
} else {
this.$message.warning(`Please select type!`)
}
},
async getChartDate(params, chart, option, id) {
this.spinning = true