Commit 7cd38cdd authored by 陈龙's avatar 陈龙

feat: 增加参数监听

parent fab319a4
......@@ -3,7 +3,7 @@ import HistoryView from '../index';
const deviceParams = [
{
"deviceCode": "EGBF00000023",
"deviceCode": "EGBF00000024",
"sensors": "出水瞬时流量",
"deviceType": "二供泵房"
}
......
......@@ -341,7 +341,7 @@ const HistoryView = (props) => {
_deviceParams[0].sensors = combineSensors.join(',')
}
return _deviceParams;
}, [combineSensors]);
}, [combineSensors, props.deviceParams]);
if (theme === 'Normal') import('./index.less');
if (theme === 'BI') import('./indexForBI.less');
const isBoxPlots =
......@@ -1545,7 +1545,7 @@ const HistoryView = (props) => {
setIsSingleStatusSensor(_isStatusSensor);
}
// 关联指标
if (_res3.code === 0) {
if (_res3.code === 0 && _res3.data.jsonData) {
let _jsonData = JSON.parse(_res3.data.jsonData);
let allSensors = _jsonData.find(item => item['关键指标'] === sensors)?.['关联指标']?.split(',') ?? [];
setCombineSensors([...new Set([...allSensors, sensors])]);
......
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