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

fix: 是否在线数据变更颜色变换

parent f2d0e769
......@@ -219,6 +219,7 @@ const ConfigurationView = (props) => {
: node.fontStroke
: node.oflColor || '#999999',
);
myDiagram.model.setDataProperty(node, 'dtStroke', shRule ? shRule.attr : node.fontStroke);
break;
case 'waterCase': // 水池模型
const height = node.height - node.strokeWidth * 2;
......@@ -320,8 +321,8 @@ const ConfigurationView = (props) => {
default:
break;
}
} catch (err) {
console.log(err);
} catch (e) {
// console.log(e);
}
};
......@@ -344,12 +345,13 @@ const ConfigurationView = (props) => {
: node.fontStroke
: node.oflColor || '#999999',
);
myDiagram.model.setDataProperty(node, 'dtStroke', shRule ? shRule.attr : node.fontStroke);
break;
default:
break;
}
} catch (err) {
console.log(err);
} catch (e) {
// console.log(e);
}
};
......@@ -449,6 +451,7 @@ const ConfigurationView = (props) => {
if (onlineList) {
node.realType = onlineList.Value ? '在线' : '离线';
myDiagram.model.setDataProperty(node, 'realType', onlineList.Value ? '在线' : '离线');
onlineColorMethod(node);
}
mqttData.forEach((list) => {
if (node.figure === 'updateTime') {
......@@ -512,13 +515,32 @@ const ConfigurationView = (props) => {
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 onlineColorMethod = (node) => {
if (node.realVal === '--' || !node.shName) return false;
try {
switch (node.category) {
case 'valCase': // 实时值模型
myDiagram.model.setDataProperty(
node,
'fontStroke',
node.realType === '在线' ? node.dtStroke : node.oflColor || '#999999',
);
break;
default:
break;
}
} catch (e) {
// console.log(e)
}
};
/** **************************************合管****************************************** */
const changLinkRouting = (e) => {
const link = e.subject;
......@@ -2461,6 +2483,7 @@ const ConfigurationView = (props) => {
}
if (item.category === 'valCase') {
if (item.shType === '') item.showVal = item.text;
item.dtStroke = item.fontStroke;
}
if (item.category === 'nameCase') {
item.dtFillColor = item.fillColor;
......
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