mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
修复案例的浏览记录中,时间戳显示格式问题
This commit is contained in:
@@ -196,7 +196,7 @@
|
|||||||
<div @click="toCaseDetail(item.id, item.refId)" style="cursor: pointer;">
|
<div @click="toCaseDetail(item.id, item.refId)" style="cursor: pointer;">
|
||||||
<div v-if="isTime" class="case_text">
|
<div v-if="isTime" class="case_text">
|
||||||
<span style="margin-right:28px">阅读了案例</span>
|
<span style="margin-right:28px">阅读了案例</span>
|
||||||
<span>{{ item.eventTime }}</span>
|
<span>{{ formatDateTime(item.eventTime) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="case-info-title">
|
<div class="case-info-title">
|
||||||
<div class="case-titdiv">
|
<div class="case-titdiv">
|
||||||
@@ -664,6 +664,12 @@ export default {
|
|||||||
return !this.speciData.some(item => item.fielclass);
|
return !this.speciData.some(item => item.fielclass);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
formatDateTime(dateArray) {
|
||||||
|
if (!dateArray || dateArray.length !== 6) return '';
|
||||||
|
const [year, month, day, hour, minute, second] = dateArray;
|
||||||
|
const pad = (num) => num.toString().padStart(2, '0');
|
||||||
|
return `${year}-${pad(month)}-${pad(day)} ${pad(hour)}:${pad(minute)}:${pad(second)}`;
|
||||||
|
},
|
||||||
beforeRouteLeave (to, from, next) {
|
beforeRouteLeave (to, from, next) {
|
||||||
const isScroll = 'caseDetail,caseCharts,caseExcellent'
|
const isScroll = 'caseDetail,caseCharts,caseExcellent'
|
||||||
if(!isScroll.includes(to.name)){
|
if(!isScroll.includes(to.name)){
|
||||||
|
|||||||
Reference in New Issue
Block a user