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
99fb2a74
Commit
99fb2a74
authored
May 11, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 组态增加在线状态
parent
91692510
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
10 deletions
+28
-10
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+28
-10
No files found.
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
99fb2a74
...
@@ -213,7 +213,11 @@ const ConfigurationView = (props) => {
...
@@ -213,7 +213,11 @@ const ConfigurationView = (props) => {
myDiagram
.
model
.
setDataProperty
(
myDiagram
.
model
.
setDataProperty
(
node
,
node
,
'fontStroke'
,
'fontStroke'
,
shRule
?
shRule
.
attr
:
node
.
fontStroke
,
node
.
realType
===
'在线'
?
shRule
?
shRule
.
attr
:
node
.
fontStroke
:
node
.
oflColor
||
'#999999'
,
);
);
break
;
break
;
case
'waterCase'
:
// 水池模型
case
'waterCase'
:
// 水池模型
...
@@ -334,7 +338,11 @@ const ConfigurationView = (props) => {
...
@@ -334,7 +338,11 @@ const ConfigurationView = (props) => {
myDiagram
.
model
.
setDataProperty
(
myDiagram
.
model
.
setDataProperty
(
node
,
node
,
'fontStroke'
,
'fontStroke'
,
shRule
?
shRule
.
attr
:
node
.
fontStroke
,
node
.
realType
===
'在线'
?
shRule
?
shRule
.
attr
:
node
.
fontStroke
:
node
.
oflColor
||
'#999999'
,
);
);
break
;
break
;
default
:
default
:
...
@@ -403,13 +411,6 @@ const ConfigurationView = (props) => {
...
@@ -403,13 +411,6 @@ const ConfigurationView = (props) => {
return
item
.
code
===
code
;
return
item
.
code
===
code
;
});
});
if
(
!
mqttData
)
return
false
;
if
(
!
mqttData
)
return
false
;
try
{
if
(
unitRender
)
unitRender
.
tipRender
({
deviceID
:
code
,
data
:
mqttData
});
}
catch
(
err
)
{
// 三维调用
}
const
json
=
JSON
.
parse
(
myDiagram
.
model
.
toJson
());
const
json
=
JSON
.
parse
(
myDiagram
.
model
.
toJson
());
const
jsonCopy
=
JSON
.
parse
(
JSON
.
stringify
(
json
));
const
jsonCopy
=
JSON
.
parse
(
JSON
.
stringify
(
json
));
const
oldJson
=
deepCopy
(
jsonCopy
,
{});
const
oldJson
=
deepCopy
(
jsonCopy
,
{});
...
@@ -444,6 +445,11 @@ const ConfigurationView = (props) => {
...
@@ -444,6 +445,11 @@ const ConfigurationView = (props) => {
if
(
!
(
item
.
shName
||
item
.
figure
===
'updateTime'
)
||
item
.
stationName
!==
name
)
if
(
!
(
item
.
shName
||
item
.
figure
===
'updateTime'
)
||
item
.
stationName
!==
name
)
return
false
;
return
false
;
const
node
=
myDiagram
.
model
.
findNodeDataForKey
(
item
.
key
);
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
)
=>
{
mqttData
.
forEach
((
list
)
=>
{
if
(
node
.
figure
===
'updateTime'
)
{
if
(
node
.
figure
===
'updateTime'
)
{
myDiagram
.
model
.
setDataProperty
(
myDiagram
.
model
.
setDataProperty
(
...
@@ -501,6 +507,18 @@ const ConfigurationView = (props) => {
...
@@ -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
changLinkRouting
=
(
e
)
=>
{
const
link
=
e
.
subject
;
const
link
=
e
.
subject
;
...
@@ -2433,7 +2451,7 @@ const ConfigurationView = (props) => {
...
@@ -2433,7 +2451,7 @@ const ConfigurationView = (props) => {
json.nodeDataArray.forEach((item) => {
json.nodeDataArray.forEach((item) => {
item.showVal = '--';
item.showVal = '--';
item.realVal = '--';
item.realVal = '--';
item.realType = '
离
线';
item.realType = '
在
线';
item.Unit = '';
item.Unit = '';
item.switchState = '开';
item.switchState = '开';
item.dtImgSrc = item.imgSrc || '';
item.dtImgSrc = item.imgSrc || '';
...
...
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