Commit 377078d5 authored by 李纪文's avatar 李纪文

fix: 组态增加数据来源

parent 385ddc9c
......@@ -944,10 +944,20 @@ const ConfigurationView = (props) => {
controlback: controlData,
})
: null;
diagramRender(typeof fromJson === 'string' ? fromJson : JSON.stringify(fromJson), list);
const diagramJson = typeof fromJson === 'string' ? fromJson : JSON.stringify(fromJson);
diagramRender(diagramJson, list);
setNoInitial(false);
try {
mqttView && mqttView.saveWaterMqtt();
let dataSources = 'MQTT';
const nodeDataArray = JSON.parse(diagramJson)?.nodeDataArray || [];
nodeDataArray.forEach((item) => {
if (item.category === 'bgCase') dataSources = item.dataSources || 'MQTT';
})
if (dataSources === 'MQTT') {
mqttView && mqttView.saveWaterMqtt();
} else {
getRealData(siteInfo);
}
} catch (e) {
// 获取实时数据
getRealData(siteInfo);
......
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