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
b8a70811
Commit
b8a70811
authored
Dec 21, 2022
by
崔佳豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复历史曲线图表尺寸显示
parent
39ffa3f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
27 deletions
+22
-27
SingleChart.js
packages/extend-components/EC_HistoryView/src/SingleChart.js
+11
-7
index.js
packages/extend-components/EC_HistoryView/src/index.js
+1
-1
index.less
packages/extend-components/EC_HistoryView/src/index.less
+10
-19
No files found.
packages/extend-components/EC_HistoryView/src/SingleChart.js
View file @
b8a70811
import
React
,
{
memo
,
useEffect
,
useMemo
,
useRef
}
from
'react'
;
import
React
,
{
memo
,
useMemo
}
from
'react'
;
import
{
BasicChart
}
from
'@wisdom-components/basicchart'
;
import
{
BasicChart
}
from
'@wisdom-components/basicchart'
;
import
optionGenerator
from
'./utils'
;
import
optionGenerator
from
'./utils'
;
const
SimgleChart
=
memo
((
props
)
=>
{
const
SimgleChart
=
memo
((
props
)
=>
{
const
{
dataSource
,
contrast
=
false
,
contrastOption
=
'day'
,
smooth
=
true
}
=
props
;
const
{
dataSource
,
contrast
=
false
,
contrastOption
=
'day'
,
smooth
=
true
}
=
props
;
const
chartRef
=
useRef
();
const
option
=
useMemo
(()
=>
{
const
option
=
useMemo
(()
=>
{
const
config
=
{
const
config
=
{
...
@@ -14,7 +13,13 @@ const SimgleChart = memo((props) => {
...
@@ -14,7 +13,13 @@ const SimgleChart = memo((props) => {
return
optionGenerator
(
dataSource
,
null
,
contrast
,
contrastOption
,
smooth
,
config
);
return
optionGenerator
(
dataSource
,
null
,
contrast
,
contrastOption
,
smooth
,
config
);
},
[
dataSource
,
smooth
]);
},
[
dataSource
,
smooth
]);
return
<
BasicChart
option
=
{
option
}
notMerge
style
=
{{
width
:
'100%'
,
height
:
'100%'
}}
/
>
useEffect
(()
=>
{
chartRef
.
current
?.
resize
?.();
},
[]);
return
(
<
BasicChart
ref
=
{
chartRef
}
option
=
{
option
}
notMerge
style
=
{{
width
:
'100%'
,
height
:
'100%'
}}
/
>
);
});
});
export
default
SimgleChart
;
export
default
SimgleChart
;
\ No newline at end of file
packages/extend-components/EC_HistoryView/src/index.js
View file @
b8a70811
...
@@ -312,7 +312,7 @@ const HistoryView = (props) => {
...
@@ -312,7 +312,7 @@ const HistoryView = (props) => {
const
renderTimeOption
=
()
=>
{
const
renderTimeOption
=
()
=>
{
return
(
return
(
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-date`
)}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-date`
)}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-label`
)}
>
时间
<
/div
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-label`
)}
>
时间
选择
<
/div
>
<
Radio
.
Group
value
=
{
timeValue
}
onChange
=
{
onTimeSetChange
}
>
<
Radio
.
Group
value
=
{
timeValue
}
onChange
=
{
onTimeSetChange
}
>
<
Radio
.
Button
value
=
"customer"
>
自定义
<
/Radio.Button
>
<
Radio
.
Button
value
=
"customer"
>
自定义
<
/Radio.Button
>
<
Radio
.
Button
value
=
"contrast"
>
同期对比
<
/Radio.Button
>
<
Radio
.
Button
value
=
"contrast"
>
同期对比
<
/Radio.Button
>
...
...
packages/extend-components/EC_HistoryView/src/index.less
View file @
b8a70811
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
.@{history-view} {
.@{history-view} {
height: 100%;
height: 100%;
padding: @padding-md;
&-label {
&-label {
position: relative;
position: relative;
...
@@ -40,14 +41,6 @@
...
@@ -40,14 +41,6 @@
align-items: center;
align-items: center;
white-space: nowrap;
white-space: nowrap;
.@{history-view}-label {
letter-spacing: 27px;
&::after {
right: -20px;
}
}
.@{ant-prefix}-radio-group,
.@{ant-prefix}-radio-group,
.@{ant-prefix}-select {
.@{ant-prefix}-select {
margin-right: 16px;
margin-right: 16px;
...
@@ -59,8 +52,6 @@
...
@@ -59,8 +52,6 @@
font-size: 16px;
font-size: 16px;
cursor: pointer;
cursor: pointer;
}
}
}
}
.@{history-view}-contrast {
.@{history-view}-contrast {
...
@@ -99,11 +90,11 @@
...
@@ -99,11 +90,11 @@
.@{history-view}-options {
.@{history-view}-options {
display: flex;
display: flex;
align-items: center;
flex-wrap: wrap;
flex-wrap: wrap;
align-items: center;
padding-bottom: 10px;
column-gap: 20px;
column-gap: 20px;
row-gap: 10px;
row-gap: 10px;
padding-bottom: 10px;
}
}
.@{history-view}-cover {
.@{history-view}-cover {
...
@@ -118,21 +109,22 @@
...
@@ -118,21 +109,22 @@
}
}
.@{history-view}-grid {
.@{history-view}-grid {
height: 100%;
overflow-y: auto;
display: flex;
display: flex;
flex-wrap: wrap;
flex-wrap: wrap;
background-color: #F0F2F5
;
height: 100%
;
padding: 4px;
padding: 4px;
overflow-y: auto;
background-color: #f0f2f5;
&-item {
&-item {
width: 50%;
width: 50%;
height: 50%;
padding: 4px;
padding: 4px;
}
}
&-item-wrap {
&-item-wrap {
height:
350px
;
height:
100%
;
background-color: #
FFF
;
background-color: #
fff
;
border-radius: 4px;
border-radius: 4px;
}
}
}
}
\ No newline at end of file
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