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

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

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