From 15feb577696fde6c335a8e654eee99a3b88f71f4 Mon Sep 17 00:00:00 2001 From: zhaofang <752743406@qq.com> Date: Fri, 28 Oct 2022 15:09:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=94=E8=AE=B0=E6=97=B6=E9=97=B4=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/tools.js | 7 +++++++ src/views/user/Mynotes.vue | 11 ++--------- src/views/user/Noteedit.vue | 5 +++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/utils/tools.js b/src/utils/tools.js index 09c04fb0..55b28a3f 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -440,3 +440,10 @@ export function formatSecondToHour(second) { h = h.toFixed(n); return h; } +// 秒换成时分秒 +export function getHMS(time) { + const hour = parseInt(time / 3600) < 10 ? '0' + parseInt(time / 3600) : parseInt(time / 3600) + const min = parseInt(time % 3600 / 60) < 10 ? '0' + parseInt(time % 3600 / 60) : parseInt(time % 3600 / 60) + const sec = parseInt(time % 3600 % 60) < 10 ? '0' + parseInt(time % 3600 % 60) : parseInt(time % 3600 % 60) + return hour + ':' + min + ':' + sec +} diff --git a/src/views/user/Mynotes.vue b/src/views/user/Mynotes.vue index 2bc46702..a97ca89c 100644 --- a/src/views/user/Mynotes.vue +++ b/src/views/user/Mynotes.vue @@ -184,7 +184,7 @@ import interactBar from '@/components/Portal/interactBar.vue'; import FileUpload from '@/components/NoteUpload/index.vue'; import AuthorImg from '@/components/Portal/authorImg.vue'; import { mapGetters } from 'vuex'; -import {formatDate,formatDateShort} from '@/utils/tools.js'; +import {formatDate,formatDateShort,getHMS} from '@/utils/tools.js'; import apiUser from "@/api/system/user.js"; export default { components:{interactBar,FileUpload,AuthorImg}, @@ -193,6 +193,7 @@ export default { }, data(){ return{ + getHMS, dialogVisibleBigImage:false, // 显示图片放大框 true-显示弹框;false-隐藏弹框 currentImagePath:'', userData:{}, @@ -540,14 +541,6 @@ export default { }) }, - -// 根据秒数转换成对应的时分秒 - getHMS(time) { - const hour = parseInt(time / 3600) < 10 ? '0' + parseInt(time / 3600) : parseInt(time / 3600) - const min = parseInt(time % 3600 / 60) < 10 ? '0' + parseInt(time % 3600 / 60) : parseInt(time % 3600 / 60) - const sec = parseInt(time % 3600 % 60) < 10 ? '0' + parseInt(time % 3600 % 60) : parseInt(time % 3600 % 60) - return hour + ':' + min + ':' + sec - }, handleSizeChange(val) { this.paegSize = val; this.pageIndex = 1; diff --git a/src/views/user/Noteedit.vue b/src/views/user/Noteedit.vue index 2daf4f95..22c7db73 100644 --- a/src/views/user/Noteedit.vue +++ b/src/views/user/Noteedit.vue @@ -8,8 +8,7 @@