diff --git a/ui/dasadmin/src/views/backend/report/index.vue b/ui/dasadmin/src/views/backend/report/index.vue index 338a368b..60d83eb6 100644 --- a/ui/dasadmin/src/views/backend/report/index.vue +++ b/ui/dasadmin/src/views/backend/report/index.vue @@ -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