查询数据为空bug修复
This commit is contained in:
parent
d6d52d6517
commit
d2f5ce0003
@ -289,15 +289,16 @@ const queryHistoryData = () => {
|
||||
}
|
||||
historyReq(requestData).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const result = res.data[windBlowerValue.value]
|
||||
if (Object.keys(result).length) {
|
||||
const result = res.data
|
||||
if (Object.keys(result)?.length) {
|
||||
const realResult = result[windBlowerValue.value]
|
||||
let tableData = []
|
||||
attributeCodes.forEach((item) => {
|
||||
if (Object.keys(result).includes(item)) {
|
||||
if (Object.keys(realResult).includes(item)) {
|
||||
tableData.push({
|
||||
name: item,
|
||||
times: result[item].times,
|
||||
value: result[item].values,
|
||||
times: realResult[item].times,
|
||||
value: realResult[item].values,
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -315,6 +316,9 @@ const queryHistoryData = () => {
|
||||
}
|
||||
reportTableData.value = Array.from(processedData.values())
|
||||
reportLoading.value = false
|
||||
} else {
|
||||
ElMessage.warning('查询数据为空!')
|
||||
reportLoading.value = false
|
||||
}
|
||||
} else {
|
||||
reportLoading.value = false
|
||||
|
Loading…
Reference in New Issue
Block a user