Commit a7ea0293 authored by 李纪文's avatar 李纪文

fix: 修改历史曲线

parent d687c172
......@@ -512,7 +512,9 @@ const HistoryView = (props) => {
) : (
''
)}
<div className={classNames(`${prefixCls}-label`)}>曲线设置</div>
<div className={classNames(`${prefixCls}-label`)}>
{activeTabKey !== 'table' ? '曲线设置' : '表格设置'}
</div>
{checkboxData.map((child) => {
const box = renderCheckbox(child, isChart && isSingle);
if (!box) return null;
......@@ -563,7 +565,7 @@ const HistoryView = (props) => {
aDom.click();
aDom.remove();
})
.catch((err) => { });
.catch((err) => {});
});
};
......@@ -613,29 +615,31 @@ const HistoryView = (props) => {
};
data.forEach((item, index) => {
const { stationCode, sensorName, dataModel } = item;
dataModel && dataModel.forEach((data) => {
const formatTime = moment(data.pt).format(format);
dataModel &&
dataModel.forEach((data) => {
const formatTime = moment(data.pt).format(format);
let time = formatTime;
if (timeValue === 'contrast') {
time = time.slice(contrastOption === 'day' ? 11 : 8, 16);
}
let time = formatTime;
if (timeValue === 'contrast') {
time = time.slice(contrastOption === 'day' ? 11 : 8, 16);
}
timeData[formatTime] = timeData[formatTime] || buildDefaultData(time);
});
timeData[formatTime] = timeData[formatTime] || buildDefaultData(time);
});
});
// 处理表格数据
data.forEach((child, index) => {
const { dataModel } = child;
const dataIndex = dataIndexAccess(child, index);
dataModel && dataModel.forEach((value, j) => {
const formatTime = moment(value.pt).format(format);
const dataRow = timeData[formatTime];
if (dataRow) {
dataRow[dataIndex] = value.pv === null || value.pv === undefined ? '' : value.pv;
}
});
dataModel &&
dataModel.forEach((value, j) => {
const formatTime = moment(value.pt).format(format);
const dataRow = timeData[formatTime];
if (dataRow) {
dataRow[dataIndex] = value.pv === null || value.pv === undefined ? '' : value.pv;
}
});
});
const timeSort = (a, b) => {
let aa = a,
......@@ -756,7 +760,6 @@ const HistoryView = (props) => {
} else {
return {};
}
});
data = data.concat(list);
});
......@@ -838,7 +841,7 @@ const HistoryView = (props) => {
columns={columns}
{...tableProps}
pagination={false}
onChange={() => { }}
onChange={() => {}}
/>
) : (
<PandaEmpty />
......
......@@ -24,6 +24,9 @@
}
&-extra-right {
position: absolute;
top: 10px;
right: 40px;
width: 82px;
}
......
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