Commit acf7465a authored by 陈龙's avatar 陈龙

fix: 修复历史曲线内的虚拟表格,无法根据数据变化自动设定宽度的问题

parent b81008b3
...@@ -54,7 +54,7 @@ const VirtualTable = (props) => { ...@@ -54,7 +54,7 @@ const VirtualTable = (props) => {
shouldForceUpdate: true, shouldForceUpdate: true,
}); });
}; };
useEffect(() => resetVirtualGrid, [tableWidth]); useEffect(() => resetVirtualGrid, [tableWidth, props.dataSource]);
const renderVirtualList = (rawData, {scrollbarSize, ref, onScroll}) => { const renderVirtualList = (rawData, {scrollbarSize, ref, onScroll}) => {
ref.current = connectObject; ref.current = connectObject;
const totalHeight = rawData.length * TABLE_ROW_HEIGHT; const totalHeight = rawData.length * TABLE_ROW_HEIGHT;
......
...@@ -391,7 +391,7 @@ const handleSpecial1 = (special, dataSource) => { ...@@ -391,7 +391,7 @@ const handleSpecial1 = (special, dataSource) => {
工频: '#00d0c7', 工频: '#00d0c7',
运行: '#1685ff', 运行: '#1685ff',
故障: '#ff6b37', 故障: '#ff6b37',
停止: '#666666', 停止: '#aeaeae',
}; };
let _special1 = special?.special1 ?? {}; let _special1 = special?.special1 ?? {};
let _valDesc = _special1?.valDesc ?? {}; let _valDesc = _special1?.valDesc ?? {};
...@@ -1203,15 +1203,6 @@ const handleDataSource = (dataSource) => { ...@@ -1203,15 +1203,6 @@ const handleDataSource = (dataSource) => {
}); });
return _data; return _data;
}; };
const returnLegend = (sensorType) => {
const _colorMap = {
变频: '#1685ff',
工频: '#00d0c7',
运行: '#1685ff',
故障: '#ff6b37',
停止: '#666666',
};
};
const handleSpecial2 = (special, sensorName, sensorType, data1, data2) => { const handleSpecial2 = (special, sensorName, sensorType, data1, data2) => {
let color = ''; let color = '';
let name = ''; let name = '';
...@@ -1224,7 +1215,7 @@ const handleSpecial2 = (special, sensorName, sensorType, data1, data2) => { ...@@ -1224,7 +1215,7 @@ const handleSpecial2 = (special, sensorName, sensorType, data1, data2) => {
工频: '#00d0c7', 工频: '#00d0c7',
运行: '#1685ff', 运行: '#1685ff',
故障: '#ff6b37', 故障: '#ff6b37',
停止: '#666666', 停止: '#aeaeae',
}; };
let _valDescMap = special.allValDesc[sensorName]?.split(';').reduce((final, cur) => { let _valDescMap = special.allValDesc[sensorName]?.split(';').reduce((final, cur) => {
let _arr = cur.split(':'); let _arr = cur.split(':');
...@@ -1238,7 +1229,7 @@ const handleSpecial2 = (special, sensorName, sensorType, data1, data2) => { ...@@ -1238,7 +1229,7 @@ const handleSpecial2 = (special, sensorName, sensorType, data1, data2) => {
//2. 开关量 //2. 开关量
if (sensorType === '开关值') { if (sensorType === '开关值') {
const _switchColorMap = { const _switchColorMap = {
0: '#666666', 0: '#aeaeae',
1: '#1685ff', 1: '#1685ff',
}; };
const _switchNameMap = { const _switchNameMap = {
...@@ -1369,8 +1360,8 @@ const specialTypeChartOptionGenerator = ({ ...@@ -1369,8 +1360,8 @@ const specialTypeChartOptionGenerator = ({
工频: '#00d0c7', 工频: '#00d0c7',
运行: '#1685ff', 运行: '#1685ff',
故障: '#ff6b37', 故障: '#ff6b37',
停止: '#666666', 停止: '#898989',
: '#666666', : '#cacaca',
: '#1685ff', : '#1685ff',
}; };
return { return {
......
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