Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
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
lihuizhen
ec-report-refactor
Commits
812ae707
Commit
812ae707
authored
Jan 20, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:dashboard proogress
parent
4386a9c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
0 deletions
+117
-0
DashboardProgress.vue
components/DashboardProgress/DashboardProgress.vue
+113
-0
NormalProgress.vue
components/NormalProgress/NormalProgress.vue
+4
-0
No files found.
components/DashboardProgress/DashboardProgress.vue
0 → 100644
View file @
812ae707
<
template
>
<view>
<uni-ec-canvas
class=
"uni-ec-canvas"
id=
"dashboard-progress"
ref=
"dashboardProgressCanvas"
canvas-id=
"dashboard-progress-chart"
:ec=
"ec"
></uni-ec-canvas>
</view>
</
template
>
<
script
>
import
uniEcCanvas
from
'@/components/uni-ec-canvas/uni-ec-canvas'
import
*
as
echarts
from
'@/components/uni-ec-canvas/echarts'
import
echartElementData
from
'@/mixins/echartElementData.js'
let
chart
=
null
export
default
{
name
:
"DashboardProgress"
,
mixins
:
[
echartElementData
],
data
()
{
return
{
ec
:
{
lazyLoad
:
true
}
};
},
onReady
()
{
},
components
:
{
uniEcCanvas
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'dashboardProgressCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
})
canvas
.
setChart
(
chart
)
const
guageChart
=
[{
name
:
""
,
value
:
this
.
elementData
.
dataList
.
endVal
}]
const
color
=
[
[
this
.
elementData
.
dataList
.
endVal
/
100
,
this
.
elementInfo
.
option
.
progress
.
strokeColor
],
[
1
,
this
.
elementInfo
.
option
.
progress
.
trailColor
]
]
const
strokeWidth
=
this
.
elementInfo
.
option
.
progress
.
strokeWidth
const
options
=
{
...
this
.
elementInfo
.
option
,
tooltip
:
{
formatter
:
'{a} <br/>{b} : {c}%'
},
title
:
[{
text
:
this
.
elementData
.
dataList
.
endVal
+
'%'
,
x
:
'center'
,
top
:
'45%'
,
textStyle
:
{
fontSize
:
30
,
color
:
'#000000'
,
},
}],
series
:
[{
type
:
'gauge'
,
// center: ['50%', '50%'],
radius
:
'50%'
,
startAngle
:
'180'
,
endAngle
:
'0'
,
pointer
:
{
show
:
false
,
},
axisLine
:
{
show
:
true
,
lineStyle
:
{
color
:
color
,
width
:
strokeWidth
,
shadowOffsetX
:
0
,
shadowOffsetY
:
0
,
opacity
:
1
,
},
},
splitLine
:
{
show
:
false
},
axisLabel
:
{
show
:
false
},
axisTick
:
{
show
:
false
},
radius
:
'90%'
,
// data: guageChart
}]
}
chart
.
setOption
(
options
)
return
chart
})
})
}
}
}
</
script
>
<
style
>
</
style
>
components/NormalProgress/NormalProgress.vue
View file @
812ae707
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
:bg-color=
"00000000"
>
:bg-color=
"00000000"
>
<view
class=
"u-progress-text"
>
{{
elementInfo
.
data
.
dataList
.
endVal
}}
%
</view>
<view
class=
"u-progress-text"
>
{{
elementInfo
.
data
.
dataList
.
endVal
}}
%
</view>
</u-circle-progress>
</u-circle-progress>
<DashboardProgress
v-if=
"elementInfo.option.progress.type === 'dashboard'"
:elementInfo=
"elementInfo"
></DashboardProgress>
</view>
</view>
</
template
>
</
template
>
...
@@ -47,6 +49,8 @@ export default {
...
@@ -47,6 +49,8 @@ export default {
uniEcCanvas
uniEcCanvas
},
},
methods
:
{
methods
:
{
initChart
(){
}
}
}
}
}
</
script
>
</
script
>
...
...
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