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
fc501814
Commit
fc501814
authored
Aug 22, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 增加统计查看
parent
14a4cb57
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
10 deletions
+14
-10
index.js
...nd-components/EC_StatisticalHistoryView/src/apis/index.js
+1
-1
index.js
.../extend-components/EC_StatisticalHistoryView/src/index.js
+12
-8
index.less
...xtend-components/EC_StatisticalHistoryView/src/index.less
+1
-1
No files found.
packages/extend-components/EC_StatisticalHistoryView/src/apis/index.js
View file @
fc501814
...
...
@@ -8,7 +8,7 @@ const baseURI = typeof DUMI_TYPE !== 'undefined' && DUMI_TYPE === 'dumi' ? '/api
// 获取统计数据
export
function
getStatisticsInfo
(
data
)
{
return
request
({
url
:
`
${
baseURI
}
/PandaMonitor/Monitor/Device/EquipmentDataReport`
,
url
:
`
${
baseURI
}
/PandaMonitor/Monitor/Device/EquipmentDataReport
ByBack
`
,
method
:
REQUEST_METHOD_POST
,
data
,
});
...
...
packages/extend-components/EC_StatisticalHistoryView/src/index.js
View file @
fc501814
...
...
@@ -41,8 +41,8 @@ const StatisticalHistoryView = (props) => {
// 自定义时间类型
const
onPickerChange
=
(
value
)
=>
{
setPicker
(
value
);
const
start
=
moment
(
dateTime
).
subtract
(
2
,
value
).
format
(
'YYYY-MM-DD 00:00:00'
);
const
end
=
moment
(
dateTim
e
).
format
(
'YYYY-MM-DD 23:59:59'
);
let
start
=
moment
(
dateTime
).
subtract
(
2
,
value
).
startOf
(
value
).
format
(
'YYYY-MM-DD 00:00:00'
);
let
end
=
moment
(
dateTime
).
endOf
(
valu
e
).
format
(
'YYYY-MM-DD 23:59:59'
);
setTime
({
startDate
:
start
,
endDate
:
end
});
};
...
...
@@ -156,8 +156,9 @@ const StatisticalHistoryView = (props) => {
const
dataTable
=
data0
.
map
((
item
,
index
)
=>
{
return
{
...
item
,
value1
:
data1
[
index
]?.
value
,
value2
:
data1
[
index
]?.
value
,
value0
:
item
?.
value
===
0
||
item
?.
value
?
item
?.
value
:
'-'
,
value1
:
data1
[
index
]?.
value
===
0
||
data1
[
index
]?.
value
?
data1
[
index
]?.
value
:
'-'
,
value2
:
data2
[
index
]?.
value
===
0
||
data2
[
index
]?.
value
?
data2
[
index
]?.
value
:
'-'
,
};
});
renderChart
(
dataChart
,
data
);
...
...
@@ -169,11 +170,14 @@ const StatisticalHistoryView = (props) => {
const
{
unit
,
dName
}
=
data
;
const
series
=
[];
dataInfo
.
data
.
forEach
((
item
,
index
)
=>
{
const
config
=
dName
.
indexOf
(
'流量'
)
>
-
1
?
{
areaStyle
:
{}
}
:
{};
const
config
=
!
index
&&
dName
.
indexOf
(
'流量'
)
>
-
1
?
{
areaStyle
:
{}
}
:
{};
const
style
=
index
?
{
lineStyle
:{
normal
:{
type
:
'dashed'
}}}
:
{}
const
list
=
{
name
:
dataInfo
.
name
[
index
],
type
:
'line'
,
smooth
:
true
,
...
config
,
...
style
,
data
:
item
.
map
((
arr
)
=>
{
return
{
name
:
arr
.
pt
,
...
...
@@ -198,8 +202,8 @@ const StatisticalHistoryView = (props) => {
containLabel
:
true
,
left
:
10
,
right
:
10
,
top
:
1
0
,
bottom
:
10
// top: 2
0,
bottom
:
10
,
},
toolbox
:
{
show
:
false
,
...
...
@@ -235,7 +239,7 @@ const StatisticalHistoryView = (props) => {
};
const
renderTable
=
(
dataInfo
,
timeName
)
=>
{
const
dataIndex
=
[
'value'
,
'value1'
,
'value2'
];
const
dataIndex
=
[
'value
0
'
,
'value1'
,
'value2'
];
const
column1
=
[
{
title
:
'时间'
,
...
...
packages/extend-components/EC_StatisticalHistoryView/src/index.less
View file @
fc501814
...
...
@@ -51,7 +51,7 @@
}
&-chart {
flex:
3
;
flex:
4
;
overflow: hidden;
}
...
...
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