From e4debe98827b39f521b8461ac184ee793a026fdd Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 28 九月 2026 23:30:57 +0800
Subject: [PATCH] feat(utils): 添加日期格式化工具函数并统一应用到各个组件
---
src/views/productionManagement/safetyMonitoring/index.vue | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/views/productionManagement/safetyMonitoring/index.vue b/src/views/productionManagement/safetyMonitoring/index.vue
index 12922e7..3c59af9 100644
--- a/src/views/productionManagement/safetyMonitoring/index.vue
+++ b/src/views/productionManagement/safetyMonitoring/index.vue
@@ -248,6 +248,7 @@
<script>
import * as echarts from 'echarts'
+import { dateOnly } from '@/utils/index'
export default {
name: 'SafetyMonitoring',
@@ -553,7 +554,7 @@
const now = new Date()
const record = {
id: `EM${Date.now()}`,
- time: now.toLocaleString('zh-CN'),
+ time: dateOnly(now),
location: sensor.name,
type: sensor.methane > 2.5 ? '鐢茬兎瓒呮爣' : '纭寲姘㈣秴鏍�',
status: 'processing',
@@ -628,13 +629,13 @@
},
{
id: 2,
- timestamp: new Date(new Date(record.time).getTime() + 3000).toLocaleString('zh-CN'),
+ timestamp: dateOnly(new Date(new Date(record.time).getTime() + 3000)),
type: 'action',
description: '鍚姩鍠锋穻绯荤粺闄嶆俯'
},
{
id: 3,
- timestamp: new Date(new Date(record.time).getTime() + 5000).toLocaleString('zh-CN'),
+ timestamp: dateOnly(new Date(new Date(record.time).getTime() + 5000)),
type: 'action',
description: '鍙戦�佺揣鎬ョ枏鏁e箍鎾�'
}
--
Gitblit v1.9.3