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
226a4000
Commit
226a4000
authored
Jan 20, 2022
by
何钱贝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:realtime
parent
920a1086
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
9 deletions
+64
-9
RealTime.vue
components/RealTime/RealTime.vue
+64
-9
No files found.
components/RealTime/RealTime.vue
View file @
226a4000
<
template
>
<
template
>
<view>
<view>
<div
class=
"timer"
>
<div
:style=
"
{
'font-size':`${elementInfo.option.title.textStyle.fontSize}px`,
'color': elementInfo.option.title.textStyle.color,
'font-weight': elementInfo.option.title.textStyle.fontWeight,
'text-align': elementInfo.option.title.left,
}"
>
{{
realTime
}}
</div>
</div>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
import
uniEcCanvas
from
'@/components/uni-ec-canvas/uni-ec-canvas'
name
:
"RealTime"
,
import
*
as
echarts
from
'@/components/uni-ec-canvas/echarts'
import
echartElementData
from
'@/mixins/echartElementData.js'
let
chart
=
null
export
default
{
name
:
"BasicText"
,
mixins
:
[
echartElementData
],
data
()
{
data
()
{
return
{
return
{
};
};
},
onReady
()
{
},
components
:
{
uniEcCanvas
},
methods
:
{
initChart
()
{
const
refreshTime
=
()
=>
{
timer
.
value
=
setInterval
(()
=>
{
realTime
.
value
=
dateFormat
(
new
Date
(),
props
.
elementInfo
.
option
.
dateFormart
)
},
1000
)
}
}
onMounted
(()
=>
{
refreshTime
()
})
onUnmounted
(()
=>
{
clearInterval
(
timer
.
value
)
timer
.
value
=
null
})
return
{
realTime
,
}
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
lang=
"less"
scoped
>
.timer {
display: flex;
flex-flow: column;
justify-content: center;
width: 100%;
color: #fff;
}
</
style
>
</
style
>
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