Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
conferenceLy
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
FC
conferenceLy
Commits
21c85fc1
提交
21c85fc1
authored
2月 08, 2023
作者:
FC
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'fc' 到 'master'
fc 查看合并请求
!1
上级
d2b18ae0
5b83d759
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
74 行增加
和
83 行删除
+74
-83
TimeRecord.vue
src/views/meeting/componets/TimeRecord.vue
+74
-83
没有找到文件。
src/views/meeting/componets/TimeRecord.vue
浏览文件 @
21c85fc1
<
template
>
<div
class=
"count_wrap"
>
<div
class=
"time_record"
><span
v-if=
"tagFlag"
>
计时
</span>
{{
timeRecord
}}
</div>
<div
class=
"time_record"
>
<span
v-if=
"tagFlag"
>
计时
</span>
{{
timeRecord
}}
</div>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
// startTime:'',
endTime
:
""
,
date
:
"00"
,
hour
:
"00"
,
minute
:
"00"
,
second
:
"00"
,
record
:
{},
};
export
default
{
data
()
{
return
{
// startTime:'',
endTime
:
''
,
date
:
'00'
,
hour
:
'00'
,
minute
:
'00'
,
second
:
'00'
,
record
:
{},
}
},
mounted
()
{
let
that
=
this
this
.
$nextTick
(
function
()
{
//整个视图都渲染完毕
that
.
timeRecording
()
})
},
props
:
[
'startTime'
,
'tagFlag'
],
computed
:
{
timeRecord
()
{
if
(
this
.
startTime
!==
''
)
{
//递归每秒调用countTime方法,显示动态时间效果
this
.
record
=
setTimeout
(
this
.
timeRecording
,
1000
)
}
return
this
.
date
+
'天'
+
this
.
hour
+
'时'
+
this
.
minute
+
'分'
+
this
.
second
+
'秒'
},
mounted
()
{
let
that
=
this
;
this
.
$nextTick
(
function
()
{
//整个视图都渲染完毕
that
.
timeRecording
();
});
},
methods
:
{
// startRecord() {
// // //获取当前时间,记录下当前时间保存到后台
// // let date = new Date();
// // this.startTime = date.getTime();
// /*
// * 调用后台接口保存开始时间后,再重新获取开始时间
// * this.$emit("update:IframeFlag", false);
// */
// this.timeRecording()
// },
endRecord
()
{
let
date
=
new
Date
()
this
.
endTime
=
date
.
getTime
()
clearTimeout
(
this
.
record
)
/*
* 调用后台接口保存结束时间
*/
},
props
:
[
"startTime"
,
"tagFlag"
],
computed
:
{
timeRecord
()
{
if
(
this
.
startTime
!==
""
)
{
//递归每秒调用countTime方法,显示动态时间效果
this
.
record
=
setTimeout
(
this
.
timeRecording
,
1000
);
}
return
(
this
.
date
+
"天"
+
this
.
hour
+
"时"
+
this
.
minute
+
"分"
+
this
.
second
+
"秒"
);
},
timeRecording
()
{
let
curTime
=
new
Date
().
getTime
()
let
startTime
=
new
Date
(
this
.
startTime
).
getTime
()
//时间差
let
leftTime
=
curTime
-
startTime
if
(
leftTime
>=
0
)
{
this
.
date
=
this
.
checkedZero
(
Math
.
floor
(
leftTime
/
1000
/
60
/
60
/
24
))
this
.
hour
=
this
.
checkedZero
(
Math
.
floor
((
leftTime
/
1000
/
60
/
60
)
%
24
))
this
.
minute
=
this
.
checkedZero
(
Math
.
floor
((
leftTime
/
1000
/
60
)
%
60
))
this
.
second
=
this
.
checkedZero
(
Math
.
floor
((
leftTime
/
1000
)
%
60
))
}
},
methods
:
{
// startRecord() {
// // //获取当前时间,记录下当前时间保存到后台
// // let date = new Date();
// // this.startTime = date.getTime();
// /*
// * 调用后台接口保存开始时间后,再重新获取开始时间
// * this.$emit("update:IframeFlag", false);
// */
// this.timeRecording()
// },
endRecord
()
{
let
date
=
new
Date
();
this
.
endTime
=
date
.
getTime
();
clearTimeout
(
this
.
record
);
/*
* 调用后台接口保存结束时间
*/
},
timeRecording
()
{
let
curTime
=
new
Date
().
getTime
();
let
startTime
=
new
Date
(
this
.
startTime
).
getTime
();
//时间差
let
leftTime
=
curTime
-
startTime
;
if
(
leftTime
>=
0
)
{
this
.
date
=
this
.
checkedZero
(
Math
.
floor
(
leftTime
/
1000
/
60
/
60
/
24
)
);
this
.
hour
=
this
.
checkedZero
(
Math
.
floor
((
leftTime
/
1000
/
60
/
60
)
%
24
)
);
this
.
minute
=
this
.
checkedZero
(
Math
.
floor
((
leftTime
/
1000
/
60
)
%
60
));
this
.
second
=
this
.
checkedZero
(
Math
.
floor
((
leftTime
/
1000
)
%
60
));
}
},
checkedZero
(
number
)
{
//补0
if
(
number
<=
9
)
{
// eslint-disable-next-line no-param-reassign
number
=
`0
${
number
}
`
;
}
return
number
;
},
checkedZero
(
number
)
{
//补0
if
(
number
<=
9
)
{
// eslint-disable-next-line no-param-reassign
number
=
`0
${
number
}
`
}
return
number
},
};
},
}
</
script
>
<
style
scoped
lang=
"less"
>
.count_wrap {
height: 100%;
}
.count_wrap {
height: 100%;
}
</
style
>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论