From 3436e73e720b5a15cf038369a88f2e99c1ad17f5 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 30 Jan 2024 10:55:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=91=E7=AB=AF=E5=BD=95?= =?UTF-8?q?=E5=83=8F=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/CloudRecord.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web_src/src/components/CloudRecord.vue b/web_src/src/components/CloudRecord.vue index 4a4a74b1..9f8d7a04 100755 --- a/web_src/src/components/CloudRecord.vue +++ b/web_src/src/components/CloudRecord.vue @@ -264,14 +264,16 @@ export default { }); }, formatTime(time) { - const h = parseInt(time / 3600) - const minute = parseInt(time / 60 % 60) - const second = Math.ceil(time % 60) - - return (h > 0 ? h + `小时` : '') + (minute > 0 ? minute + '分' : '') + second + '秒' + const h = parseInt(time / 3600 / 1000) + const minute = parseInt((time - h * 3600 * 1000) / 60 / 1000) + let second = Math.ceil((time - h * 3600 * 1000 - minute * 60 * 1000) / 1000) + if (second < 0) { + second = 0; + } + return (h > 0 ? h + `小时` : '') + (minute > 0 ? minute + '分' : '') + (second > 0 ? second + '秒' : '') }, formatTimeStamp(time) { - return moment.unix(time).format('yyyy-MM-DD HH:mm:ss') + return moment.unix(time/1000).format('yyyy-MM-DD HH:mm:ss') } }