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

fix: 修改历史曲线

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