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