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
f94a56bb
Commit
f94a56bb
authored
Jan 19, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 组态增加图层设置
parent
451437c1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
5 deletions
+50
-5
index.js
...onents/EC_AlarmCurve/src/limitCurve/historyTrend/index.js
+14
-4
index.js
...s/extend-components/EC_AlarmCurve/src/limitCurve/index.js
+1
-1
index.js
...nents/EC_AlarmCurve/src/limitCurve/intellectDraw/index.js
+0
-0
index.less
...nts/EC_AlarmCurve/src/limitCurve/intellectDraw/index.less
+16
-0
utils.js
...s/extend-components/EC_AlarmCurve/src/limitCurve/utils.js
+15
-0
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+2
-0
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+2
-0
No files found.
packages/extend-components/EC_AlarmCurve/src/limitCurve/historyTrend/index.js
View file @
f94a56bb
...
...
@@ -12,6 +12,10 @@ const HistoryTrend = (props) => {
const
prefixCls
=
getPrefixCls
(
'history-trend'
);
const
{
deviceCode
,
sensors
,
deviceType
,
changeSpin
}
=
props
;
const
chartRef
=
useRef
(
null
);
const
infoRef
=
useRef
({
decimalPoint
:
2
,
unit
:
''
,
})
const
[
sensitive
,
setSensitive
]
=
useState
(
10
);
// 敏感度
const
[
timeType
,
setTimeType
]
=
useState
(
'近7日'
);
// 时间
...
...
@@ -76,6 +80,11 @@ const HistoryTrend = (props) => {
let
historyData
=
[];
results
.
forEach
((
result
)
=>
{
const
_historyData
=
result
?.
data
?.[
0
]?.
dataModel
||
[];
const
info
=
result
?.
data
?.[
0
]
||
{};
infoRef
.
current
=
{
decimalPoint
:
info
?.
decimalPoint
||
2
,
unit
:
info
?.
unit
||
''
}
historyData
=
historyData
.
concat
([...
_historyData
]);
});
console
.
log
(
historyData
);
...
...
@@ -161,11 +170,12 @@ const HistoryTrend = (props) => {
let
max
=
Math
.
max
(...
pvArr
);
let
min
=
Math
.
min
(...
pvArr
);
console
.
log
(
max
,
min
);
const
decimalPoint
=
infoRef
.
current
.
decimalPoint
||
2
;
const
data
=
[
(
min
*
(
1
-
sensitive
/
100
)).
toFixed
(
2
)
*
1
,
(
min
*
(
1
+
sensitive
/
100
)).
toFixed
(
2
)
*
1
,
(
max
*
(
1
-
sensitive
/
100
)).
toFixed
(
2
)
*
1
,
(
max
*
(
1
+
sensitive
/
100
)).
toFixed
(
2
)
*
1
,
(
min
*
(
1
-
sensitive
/
100
)).
toFixed
(
decimalPoint
)
*
1
,
(
min
*
(
1
+
sensitive
/
100
)).
toFixed
(
decimalPoint
)
*
1
,
(
max
*
(
1
-
sensitive
/
100
)).
toFixed
(
decimalPoint
)
*
1
,
(
max
*
(
1
+
sensitive
/
100
)).
toFixed
(
decimalPoint
)
*
1
,
];
const
color
=
[
'#CB2D2D'
,
'#0087F7'
];
const
name
=
[
'低低限'
,
'低限'
,
'高限'
,
'高高限'
];
...
...
packages/extend-components/EC_AlarmCurve/src/limitCurve/index.js
View file @
f94a56bb
...
...
@@ -80,7 +80,7 @@ const LimitCurve = (props) => {
<
Modal
closable
=
{
false
}
centered
width
=
{
width
||
'1
2
00px'
}
width
=
{
width
||
'1
3
00px'
}
footer
=
{
null
}
open
=
{
open
}
visible
=
{
open
}
...
...
packages/extend-components/EC_AlarmCurve/src/limitCurve/intellectDraw/index.js
View file @
f94a56bb
This diff is collapsed.
Click to expand it.
packages/extend-components/EC_AlarmCurve/src/limitCurve/intellectDraw/index.less
View file @
f94a56bb
...
...
@@ -37,9 +37,25 @@
display: flex;
}
&-propose-box {
display: flex;
flex-direction: column;
}
&-propose-list {
display: flex;
align-items: center;
margin-bottom: 5px;
&:last-of-type {
margin-bottom: 0px;
}
}
&-propose-select {
margin: 10px;
display: flex;
align-items: center;
}
&-value-list {
...
...
packages/extend-components/EC_AlarmCurve/src/limitCurve/utils.js
View file @
f94a56bb
...
...
@@ -54,3 +54,18 @@ export const chartArr = [
export
const
average
=
(
arr
)
=>
{
return
arr
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
)
/
arr
.
length
;
};
// 中位数方法
export
const
median
=
(
data
)
=>
{
if
(
data
.
length
===
0
)
return
0
;
data
.
sort
((
a
,
b
)
=>
{
return
a
-
b
;
});
const
half
=
Math
.
floor
(
data
.
length
/
2
);
if
(
data
.
length
%
2
)
return
data
[
half
];
return
(
data
[
half
-
1
]
+
data
[
half
])
/
2
;
};
packages/extend-components/EC_ConfigurationView/src/HistoryModel.js
View file @
f94a56bb
...
...
@@ -2373,6 +2373,7 @@ const ConfigurationView = (props) => {
relinkableTo: true,
zOrder: 1,
},
new go.Binding('layerName', 'layerName').makeTwoWay(),
new go.Binding('fromSpot', 'fromPort', (d) => {
return spotConverter(d);
}),
...
...
@@ -2422,6 +2423,7 @@ const ConfigurationView = (props) => {
relinkableTo: true,
zOrder: 1,
},
new go.Binding('layerName', 'layerName').makeTwoWay(),
new go.Binding('fromSpot', 'fromPort', function (d) {
return spotConverter(d);
}),
...
...
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
f94a56bb
...
...
@@ -3017,6 +3017,7 @@ const ConfigurationView = (props) => {
relinkableTo: true,
zOrder: 1,
},
new go.Binding('layerName', 'layerName').makeTwoWay(),
new go.Binding('fromSpot', 'fromPort', (d) => {
return spotConverter(d);
}),
...
...
@@ -3066,6 +3067,7 @@ const ConfigurationView = (props) => {
relinkableTo: true,
zOrder: 1,
},
new go.Binding('layerName', 'layerName').makeTwoWay(),
new go.Binding('fromSpot', 'fromPort', function (d) {
return spotConverter(d);
}),
...
...
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