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
324501af
Commit
324501af
authored
Feb 28, 2022
by
Jenny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 实时时间
parent
280dfa8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
RealTime.vue
components/RealTime/RealTime.vue
+16
-14
No files found.
components/RealTime/RealTime.vue
View file @
324501af
<
template
>
<
template
>
<view>
<view
class=
"timer"
>
<div
class=
"timer"
>
<NormalTitle
:elementInfo=
"elementInfo"
></NormalTitle>
<NormalTitle
:elementInfo=
"elementInfo"
></NormalTitle>
<view
:style=
"
{
<div
:style=
"
{
'font-size':`${elementInfo.option.time.textStyle.fontSize}px`,
'font-size':`${elementInfo.option.time.textStyle.fontSize}px`,
'color': elementInfo.option.time.textStyle.color,
'color': elementInfo.option.time.textStyle.color,
'font-weight': elementInfo.option.time.textStyle.fontWeight,
'font-weight': elementInfo.option.time.textStyle.fontWeight,
'text-align': elementInfo.option.time.left,
'text-align': elementInfo.option.time.left,
}">
}">
{{
realTime
}}
{{
realTime
}}
</view>
</div>
</div>
</view>
</view>
</
template
>
</
template
>
...
@@ -26,17 +24,21 @@
...
@@ -26,17 +24,21 @@
timer
:
null
timer
:
null
};
};
},
},
onReady
()
{
this
.
getRealTime
()
},
onUnLoad
()
{
onUnLoad
()
{
clearInterval
(
this
.
timer
)
clearInterval
(
this
.
timer
)
this
.
timer
=
null
},
},
methods
:
{
methods
:
{
initChart
()
{
getRealTime
()
{
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
const
timestamp
=
new
Date
().
getTime
()
const
timestamp
=
new
Date
().
getTime
()
this
.
realTime
=
this
.
$u
.
timeFormat
(
timestamp
,
this
.
getDateFormat
())
this
.
realTime
=
this
.
$u
.
timeFormat
(
timestamp
,
this
.
getDateFormat
())
},
1000
)
},
1000
)
},
},
initChart
()
{},
// 大屏报表时间格式和uniapp的不一致,需要转换
// 大屏报表时间格式和uniapp的不一致,需要转换
getDateFormat
()
{
getDateFormat
()
{
...
...
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