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
88576ce0
Commit
88576ce0
authored
Sep 07, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 在线修改修改
parent
1ec160b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
32 deletions
+39
-32
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+39
-32
No files found.
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
88576ce0
...
...
@@ -272,10 +272,9 @@ const ConfigurationView = (props) => {
node
.
realType
===
'在线'
?
shRule
?
shRule
.
attr
:
node
.
fon
tStroke
:
node
.
d
tStroke
:
node
.
oflColor
||
'#999999'
,
);
myDiagram
.
model
.
setDataProperty
(
node
,
'dtStroke'
,
shRule
?
shRule
.
attr
:
node
.
fontStroke
);
break
;
case
'waterCase'
:
// 水池模型
const
height
=
node
.
height
-
node
.
strokeWidth
*
2
;
...
...
@@ -398,10 +397,9 @@ const ConfigurationView = (props) => {
node
.
realType
===
'在线'
?
shRule
?
shRule
.
attr
:
node
.
fon
tStroke
:
node
.
d
tStroke
:
node
.
oflColor
||
'#999999'
,
);
myDiagram
.
model
.
setDataProperty
(
node
,
'dtStroke'
,
shRule
?
shRule
.
attr
:
node
.
fontStroke
);
break
;
default
:
break
;
...
...
@@ -499,23 +497,18 @@ const ConfigurationView = (props) => {
// 水流样式
}
// 离线判断
try
{
onlineColorMethod
(
jsonCopy
.
nodeDataArray
,
name
,
mqttData
);
}
catch
(
err
)
{
// console.log(err)
}
try
{
jsonCopy
.
nodeDataArray
.
forEach
((
item
)
=>
{
if
(
!
(
item
.
shName
||
item
.
category
===
'timeCase'
)
||
item
.
stationName
!==
name
)
return
false
;
const
node
=
myDiagram
.
model
.
findNodeDataForKey
(
item
.
key
);
if
(
!
item
.
stateName
)
{
const
onlineList
=
onLineDataMethod
(
mqttData
);
if
(
onlineList
)
{
node
.
realType
=
onlineList
.
Value
*
1
?
'在线'
:
'离线'
;
myDiagram
.
model
.
setDataProperty
(
node
,
'realType'
,
onlineList
.
Value
*
1
?
'在线'
:
'离线'
,
);
onlineColorMethod
(
node
);
}
}
mqttData
.
forEach
((
list
)
=>
{
const
itemID
=
list
.
ItemID
;
const
num
=
itemID
.
lastIndexOf
(
'.'
);
...
...
@@ -586,23 +579,37 @@ const ConfigurationView = (props) => {
};
/** **************************************是否在线颜色变化****************************************** */
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
;
const
onlineColorMethod
=
(
nodeDataArray
,
name
,
mqttData
)
=>
{
const
onlineList
=
onLineDataMethod
(
mqttData
);
if
(
!
onlineList
)
return
false
;
const
onlineType
=
onlineList
.
Value
*
1
?
'在线'
:
'离线'
;
nodeDataArray
.
forEach
((
item
)
=>
{
if
(
item
.
shName
&&
item
.
stationName
===
name
&&
item
.
category
===
'valCase'
&&
!
item
.
stateName
)
{
const
node
=
myDiagram
.
model
.
findNodeDataForKey
(
item
.
key
);
const
shRule
=
node
.
realVal
!==
'--'
?
ruleOperation
(
node
,
node
.
realVal
)
:
null
;
switch
(
node
.
category
)
{
case
'valCase'
:
// 实时值模型
myDiagram
.
model
.
setDataProperty
(
node
,
'fontStroke'
,
onlineType
===
'在线'
?
shRule
?
shRule
.
attr
:
node
.
dtStroke
:
node
.
oflColor
||
'#999999'
,
);
myDiagram
.
model
.
setDataProperty
(
node
,
'realType'
,
onlineType
);
break
;
default
:
break
;
}
}
}
catch
(
e
)
{
// console.log(e)
}
});
};
/** **************************************合管****************************************** */
...
...
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