Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
ea875649
Commit
ea875649
authored
May 12, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 是否在线数据变更颜色变换
parent
f2d0e769
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
5 deletions
+28
-5
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+28
-5
No files found.
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
ea875649
...
...
@@ -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
(
e
rr
)
{
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
(
e
rr
)
{
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;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment