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 @@