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
7f08ee1a
Commit
7f08ee1a
authored
Aug 16, 2023
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改月份图表的显示
parent
e12c8750
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+1
-1
index.js
packages/extend-components/EC_HistoryView/src/index.js
+3
-1
utils.js
packages/extend-components/EC_HistoryView/src/utils.js
+3
-3
No files found.
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
7f08ee1a
...
@@ -40,7 +40,7 @@ const deviceParams = [
...
@@ -40,7 +40,7 @@ const deviceParams = [
// 邳州张楼水厂
// 邳州张楼水厂
{
{
"deviceCode"
:
"LLJ00000004"
,
"deviceCode"
:
"LLJ00000004"
,
"sensors"
:
"瞬时流量
,是否在线
"
,
"sensors"
:
"瞬时流量"
,
"deviceType"
:
"流量计"
"deviceType"
:
"流量计"
}
}
];
];
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
7f08ee1a
...
@@ -11,6 +11,7 @@ import {
...
@@ -11,6 +11,7 @@ import {
Tabs
,
Tabs
,
Tooltip
,
Tooltip
,
Button
,
Button
,
message
}
from
'antd'
;
}
from
'antd'
;
import
{
import
{
CloseCircleFilled
,
CloseCircleFilled
,
...
@@ -782,6 +783,7 @@ const HistoryView = (props) => {
...
@@ -782,6 +783,7 @@ const HistoryView = (props) => {
setChartDataSource(data);
setChartDataSource(data);
}
}
}).catch(err => {
}).catch(err => {
message.error('数据请求失败,请重试~')
setLoading(false)
setLoading(false)
});
});
};
};
...
@@ -886,7 +888,7 @@ const HistoryView = (props) => {
...
@@ -886,7 +888,7 @@ const HistoryView = (props) => {
};
};
return
(
return
(
<
div
className
=
{
classNames
(
prefixCls
)}
>
<
div
className
=
{
classNames
(
prefixCls
,
'wkt-scroll-light'
)}
>
<
Spin
spinning
=
{
loading
}
wrapperClassName
=
{
classNames
(
`
${
prefixCls
}
-spin`
)}
>
<
Spin
spinning
=
{
loading
}
wrapperClassName
=
{
classNames
(
`
${
prefixCls
}
-spin`
)}
>
{
showModels
.
length
===
1
&&
(
{
showModels
.
length
===
1
&&
(
<
div
className
=
{
`
${
prefixCls
}
-single-panel`
}
>
{
renderPanel
(
showModels
[
0
])}
<
/div
>
<
div
className
=
{
`
${
prefixCls
}
-single-panel`
}
>
{
renderPanel
(
showModels
[
0
])}
<
/div
>
...
...
packages/extend-components/EC_HistoryView/src/utils.js
View file @
7f08ee1a
...
@@ -305,7 +305,7 @@ export const buildDefaultLegend = (option) => {
...
@@ -305,7 +305,7 @@ export const buildDefaultLegend = (option) => {
const
headTemplate
=
(
param
,
opt
)
=>
{
const
headTemplate
=
(
param
,
opt
)
=>
{
if
(
!
param
)
return
''
;
if
(
!
param
)
return
''
;
const
{
name
,
axisValueLabel
,
axisType
,
axisValue
}
=
param
;
const
{
name
,
axisValueLabel
,
axisType
,
axisValue
}
=
param
;
const
timeFormat
=
opt
&&
opt
.
contrast
?
(
opt
.
contrastOption
===
'day'
?
'HH:mm:ss'
:
'
YYYY-MM-DD
'
)
:
'YYYY-MM-DD HH:mm:ss'
;
const
timeFormat
=
opt
&&
opt
.
contrast
?
(
opt
.
contrastOption
===
'day'
?
'HH:mm:ss'
:
'
DD日
'
)
:
'YYYY-MM-DD HH:mm:ss'
;
const
text
=
const
text
=
axisType
===
'xAxis.time'
?
moment
(
axisValue
).
format
(
timeFormat
)
:
name
||
axisValueLabel
;
axisType
===
'xAxis.time'
?
moment
(
axisValue
).
format
(
timeFormat
)
:
name
||
axisValueLabel
;
return
`<div style="border-bottom: 1px solid #F0F0F0; color: #808080; margin-bottom:
${
handlePx
(
5
,
'px'
)}
; padding-bottom:
${
handlePx
(
5
,
'px'
)}
;">
${
text
}
</div>`
;
return
`<div style="border-bottom: 1px solid #F0F0F0; color: #808080; margin-bottom:
${
handlePx
(
5
,
'px'
)}
; padding-bottom:
${
handlePx
(
5
,
'px'
)}
;">
${
text
}
</div>`
;
...
@@ -591,8 +591,8 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
...
@@ -591,8 +591,8 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
const grid = {
const grid = {
top: needUnit ? 80 : 60,
top: needUnit ? 80 : 60,
// top: 200,
// top: 200,
left:
1
0 + leftNum * AXIS_WIDTH,
left:
3
0 + leftNum * AXIS_WIDTH,
right: rightNum === 0 ?
2
0 : rightNum * AXIS_WIDTH,
right: rightNum === 0 ?
4
0 : rightNum * AXIS_WIDTH,
bottom: 60,
bottom: 60,
};
};
...
...
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