Commit 5dde9640 authored by 徐乐's avatar 徐乐

修改

parent 9cf69177
......@@ -613,7 +613,7 @@ const HistoryView = (props) => {
};
data.forEach((item, index) => {
const { stationCode, sensorName, dataModel } = item;
dataModel.forEach((data) => {
dataModel && dataModel.forEach((data) => {
const formatTime = moment(data.pt).format(format);
let time = formatTime;
......@@ -629,7 +629,7 @@ const HistoryView = (props) => {
data.forEach((child, index) => {
const { dataModel } = child;
const dataIndex = dataIndexAccess(child, index);
dataModel.forEach((value, j) => {
dataModel && dataModel.forEach((value, j) => {
const formatTime = moment(value.pt).format(format);
const dataRow = timeData[formatTime];
if (dataRow) {
......@@ -739,8 +739,8 @@ const HistoryView = (props) => {
const { dateFrom, dateTo } = dateRange?.[index] ?? {};
if (res.code === 0 && res.data.length) {
res.data.forEach((d) => {
d.dateFrom = dateFrom;
d.dateTo = dateTo;
d.dateFrom = dateFrom || '';
d.dateTo = dateTo || '';
});
deviceParams.forEach((p) => {
// 返回数据按查询指标顺序排序
......@@ -756,6 +756,7 @@ const HistoryView = (props) => {
} else {
return {};
}
});
data = data.concat(list);
});
......
......@@ -40,7 +40,7 @@ const nameFormatter = (data, contrast, contrastOption, nameWithSensor) => {
* @returns 图表系列数据, [[DateTime, value]]
*/
const dataAccessor = (data, contrast, contrastOption) => {
const { dataModel } = data;
const dataModel = data?.dataModel ?? [];
let _currentYear = moment().format('YYYY');
const formatStr =
contrastOption === 'day' ? `${_currentYear}-01-01 HH:mm:00` : `${_currentYear}-01-DD HH:mm:00`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment