应急处置修改右侧时间

This commit is contained in:
huangchenhao 2025-11-24 17:59:04 +08:00
parent 626e0480b9
commit 4edac208d2
2 changed files with 23 additions and 5 deletions

View File

@ -16,7 +16,8 @@
<!-- 视频播放器 -->
<video :src="monitor.videoSrc" autoplay loop muted playsinline />
<div class="video-time">{{ currentTime }}</div>
<!-- 如果需要显示当前时间则取消下面注释 -->
<!-- <div class="video-time">{{ currentTime }}</div> -->
</div>
<!-- 控制条叠加在视频底部 -->
<div class="video-controls">

View File

@ -50,14 +50,31 @@ export function useDisasterData() {
}
})
// 获取当前日期
function getCurrentDate() {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
// 获取当前日期加上指定时间
function getCurrentDateTime(time) {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day} ${time}`;
}
// 协同信息
const collaborationInfo = ref([
{
id: 1,
source: '气象预警',
content:
'巫溪县气象台2025年10月17日12时30分升级发布"暴雨黄色预警信号"过去6小时文峰、红池坝、天元、长桂等乡镇累计降雨量已达70毫米以上。',
timestamp: '2025-10-17 12:30'
`巫溪县气象台${getCurrentDate()} 08:30分升级发布"暴雨黄色预警信号"过去6小时文峰、红池坝、天元、长桂等乡镇累计降雨量已达70毫米以上。`,
timestamp: getCurrentDateTime('08:30')
},
{
id: 2,
@ -69,8 +86,8 @@ export function useDisasterData() {
id: 3,
source: '融媒体中心',
content:
'发布了阻断信息巴南G348武大线三湾于6月28日发生山体滑坡边坡有继续垮塌风险需断道观察车辆从桥口坝绕行金田村预计2025年10月17日18时30分恢复通行。',
timestamp: '2025-10-17 14:30'
`发布了阻断信息巴南G348武大线三湾于6月28日发生山体滑坡边坡有继续垮塌风险需断道观察车辆从桥口坝绕行金田村预计${getCurrentDate()} 24:00恢复通行。`,
timestamp: getCurrentDateTime('24:00')
}
])