Commit 99fb2a74 authored by 李纪文's avatar 李纪文

fix: 组态增加在线状态

parent 91692510
......@@ -213,7 +213,11 @@ const ConfigurationView = (props) => {
myDiagram.model.setDataProperty(
node,
'fontStroke',
shRule ? shRule.attr : node.fontStroke,
node.realType === '在线'
? shRule
? shRule.attr
: node.fontStroke
: node.oflColor || '#999999',
);
break;
case 'waterCase': // 水池模型
......@@ -334,7 +338,11 @@ const ConfigurationView = (props) => {
myDiagram.model.setDataProperty(
node,
'fontStroke',
shRule ? shRule.attr : node.fontStroke,
node.realType === '在线'
? shRule
? shRule.attr
: node.fontStroke
: node.oflColor || '#999999',
);
break;
default:
......@@ -403,13 +411,6 @@ const ConfigurationView = (props) => {
return item.code === code;
});
if (!mqttData) return false;
try {
if (unitRender) unitRender.tipRender({ deviceID: code, data: mqttData });
} catch (err) {
// 三维调用
}
const json = JSON.parse(myDiagram.model.toJson());
const jsonCopy = JSON.parse(JSON.stringify(json));
const oldJson = deepCopy(jsonCopy, {});
......@@ -444,6 +445,11 @@ const ConfigurationView = (props) => {
if (!(item.shName || item.figure === 'updateTime') || item.stationName !== name)
return false;
const node = myDiagram.model.findNodeDataForKey(item.key);
const onlineList = onLineDataMethod(mqttData);
if (onlineList) {
node.realType = onlineList.Value ? '在线' : '离线';
myDiagram.model.setDataProperty(node, 'realType', onlineList.Value ? '在线' : '离线');
}
mqttData.forEach((list) => {
if (node.figure === 'updateTime') {
myDiagram.model.setDataProperty(
......@@ -501,6 +507,18 @@ const ConfigurationView = (props) => {
}
};
/** **************************************是否在线数据获取****************************************** */
const onLineDataMethod = (data) => {
const onlineList = data.find((list) => {
const itemID = list.ItemID;
const num = itemID.lastIndexOf('.');
const ptName = itemID.substring(0, num);
const shName = itemID.substring(num + 1, Infinity);
return shName === '是否在线';
});
return onlineList;
};
/** **************************************合管****************************************** */
const changLinkRouting = (e) => {
const link = e.subject;
......@@ -2433,7 +2451,7 @@ const ConfigurationView = (props) => {
json.nodeDataArray.forEach((item) => {
item.showVal = '--';
item.realVal = '--';
item.realType = '线';
item.realType = '线';
item.Unit = '';
item.switchState = '开';
item.dtImgSrc = item.imgSrc || '';
......
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