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
9ca6780e
Commit
9ca6780e
authored
Apr 28, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 增加状态模型
parent
ce174dca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
12 deletions
+70
-12
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+32
-5
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+38
-7
No files found.
packages/extend-components/EC_ConfigurationView/src/HistoryModel.js
View file @
9ca6780e
...
...
@@ -169,6 +169,7 @@ const ConfigurationView = (props) => {
}
else
{
myDiagram
.
model
.
setDataProperty
(
node
,
'showVal'
,
realVal
);
}
if
(
node
.
stateName
)
return
false
;
shRule
=
ruleOperation
(
node
,
realVal
);
myDiagram
.
model
.
setDataProperty
(
node
,
...
...
@@ -281,6 +282,30 @@ const ConfigurationView = (props) => {
}
};
/** *********************************节点状态展示逻辑****************************** */
const
stateMethod
=
(
node
,
list
)
=>
{
const
realVal
=
list
.
Value
*
1
;
if
(
!
node
.
shType
)
return
false
;
let
shRule
=
[];
try
{
switch
(
node
.
category
)
{
case
'valCase'
:
// 实时值模型
// 颜色规则
shRule
=
ruleOperation
(
node
,
realVal
);
myDiagram
.
model
.
setDataProperty
(
node
,
'fontStroke'
,
shRule
?
shRule
.
attr
:
node
.
fontStroke
,
);
break
;
default
:
break
;
}
}
catch
(
err
)
{
console
.
log
(
err
);
}
};
/** ***********************************展示规则运算********************************* */
const
ruleOperation
=
(
node
,
realVal
)
=>
{
const
patt
=
/
[
><=
]
/gi
;
...
...
@@ -740,14 +765,16 @@ const ConfigurationView = (props) => {
});
if (!bindList || item.stationName !== bindList.name) return false;
if (
!pvList ||
pvList.pv === null ||
list.sensorName !== item.shName ||
item.realVal === pvList.pv
(!pvList ||
pvList.pv === null ||
list.sensorName !== item.shName ||
item.realVal === pvList.pv) &&
list.sensorName !== item.stateName
)
return false;
pvList.Value = pvList.pv;
showNodeMethod(node, pvList);
if (list.sensorName === item.shName) showNodeMethod(node, pvList);
if (list.sensorName === item.stateName) stateMethod(node, pvList);
});
});
} catch (e) {
...
...
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
9ca6780e
...
...
@@ -199,6 +199,7 @@ const ConfigurationView = (props) => {
myDiagram
.
model
.
setDataProperty
(
node
,
'showVal'
,
realVal
);
}
// 颜色规则
if
(
node
.
stateName
)
return
false
;
shRule
=
ruleOperation
(
node
,
realVal
);
myDiagram
.
model
.
setDataProperty
(
node
,
...
...
@@ -311,6 +312,30 @@ const ConfigurationView = (props) => {
}
};
/** *********************************节点状态展示逻辑****************************** */
const
stateMethod
=
(
node
,
list
)
=>
{
const
realVal
=
list
.
Value
*
1
;
if
(
!
node
.
shType
)
return
false
;
let
shRule
=
[];
try
{
switch
(
node
.
category
)
{
case
'valCase'
:
// 实时值模型
// 颜色规则
shRule
=
ruleOperation
(
node
,
realVal
);
myDiagram
.
model
.
setDataProperty
(
node
,
'fontStroke'
,
shRule
?
shRule
.
attr
:
node
.
fontStroke
,
);
break
;
default
:
break
;
}
}
catch
(
err
)
{
console
.
log
(
err
);
}
};
/** ***********************************展示规则运算********************************* */
const
ruleOperation
=
(
node
,
realVal
)
=>
{
const
patt
=
/
[
><=
]
/gi
;
...
...
@@ -424,9 +449,13 @@ const ConfigurationView = (props) => {
const
ptName
=
itemID
.
substring
(
0
,
num
);
const
shName
=
itemID
.
substring
(
num
+
1
,
Infinity
);
if
(
editionList
&&
`
${
editionList
.
name
}
.
${
editionList
.
version
}
`
!==
ptName
)
return
false
;
if
(
list
.
Value
==
null
||
shName
!==
item
.
shName
||
item
.
realVal
===
list
.
Value
)
if
(
(
list
.
Value
==
null
||
shName
!==
item
.
shName
||
item
.
realVal
===
list
.
Value
)
&&
shName
!==
item
.
stateName
)
return
false
;
showNodeMethod
(
node
,
list
);
if
(
shName
===
item
.
shName
)
showNodeMethod
(
node
,
list
);
if
(
shName
===
item
.
stateName
)
stateMethod
(
node
,
list
);
});
});
}
catch
(
e
)
{
...
...
@@ -875,14 +904,16 @@ const ConfigurationView = (props) => {
});
if (!bindList || item.stationName !== bindList.name) return false;
if (
!pvList ||
pvList.pv === null ||
pvList.dName !== item.shName ||
item.realVal === pvList.pv
(!pvList ||
pvList.pv === null ||
pvList.dName !== item.shName ||
item.realVal === pvList.pv) &&
pvList.dName !== item.stateName
)
return false;
pvList.Value = pvList.pv;
showNodeMethod(node, pvList);
if (pvList.dName === item.shName) showNodeMethod(node, pvList);
if (pvList.dName === item.stateName) stateMethod(node, list);
});
});
} catch (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