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
fa5598fa
Commit
fa5598fa
authored
Jan 24, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add function px change to rpx
parent
c63d4d40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
DashboardProgress.vue
components/DashboardProgress/DashboardProgress.vue
+9
-4
NormalProgress.vue
components/NormalProgress/NormalProgress.vue
+0
-1
common.js
utils/common.js
+14
-1
No files found.
components/DashboardProgress/DashboardProgress.vue
View file @
fa5598fa
<
template
>
<view>
<uni-ec-canvas
class=
"uni-ec-canvas"
id=
"dashboard-progress"
ref=
"dashboardProgressCanvas"
canvas-id=
"dashboard-progress-chart"
:ec=
"ec"
></uni-ec-canvas>
<uni-ec-canvas
class=
"uni-ec-canvas"
id=
"dashboard-progress"
ref=
"dashboardProgressCanvas"
canvas-id=
"dashboard-progress-chart"
:ec=
"ec"
:style=
"[elStyleObject]"
></uni-ec-canvas>
</view>
</
template
>
...
...
@@ -51,7 +57,7 @@
],
[
1
,
this
.
elementInfo
.
option
.
progress
.
trailColor
]
]
const
strokeWidth
=
this
.
elementInfo
.
option
.
progress
.
strokeWidth
const
strokeWidth
=
this
.
$u
.
common
.
pxToRpx
(
this
.
elementInfo
.
option
.
progress
.
strokeWidth
)
var
startAngle
=
180
var
endAngle
=
0
switch
(
this
.
elementInfo
.
option
.
progress
.
gapPosition
)
{
...
...
@@ -132,7 +138,6 @@
},
radius
:
'90%'
,
// data: guageChart
}]
}
chart
.
setOption
(
options
)
...
...
components/NormalProgress/NormalProgress.vue
View file @
fa5598fa
...
...
@@ -23,7 +23,6 @@
<view
class=
"u-progress-text"
>
{{
elementInfo
.
data
.
dataList
.
endVal
}}
%
</view>
</u-circle-progress>
<DashboardProgress
v-if=
"elementInfo.option.progress.type === 'dashboard'"
:elementInfo=
"elementInfo"
></DashboardProgress>
</view>
</
template
>
...
...
utils/common.js
View file @
fa5598fa
...
...
@@ -44,11 +44,24 @@ const install = (Vue, vm) => {
return
year
+
"-"
+
month
+
"-"
+
day
+
" "
+
hours
+
":"
+
minutes
+
":"
+
seconds
;
// return year + "-" + month + "-" + day;
}
// px转换为rpx
const
pxToRpx
=
(
value
)
=>
{
return
value
/
uni
.
getSystemInfoSync
().
windowWidth
*
750
}
// rpx转换为px
const
rpxToPx
=
(
value
)
=>
{
return
value
/
750
*
uni
.
getSystemInfoSync
().
windowWidth
}
vm
.
$u
.
common
=
{
converFunction
,
fillDigit
,
toThousands
,
dateFormat
dateFormat
,
pxToRpx
,
rpxToPx
}
}
...
...
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