更新xx并部署

This commit is contained in:
zhougf committed 2026-04-23 22:46:15 +08:00
1 parent be8de4c00a
commit 96d6b8e8af
4 files changed
+17 -52

No files matched your search

+13 -31
View File
@@ -133,23 +133,11 @@ const weeklyProduceTotal = computed(() => {
return totals
})
/** 魔盒报警行上的发生时间(不同版本字段名不一,尽量兼容) */
function laserAlarmOccurAt(a) {
const raw =
a?.AlarmTime ??
a?.alarmTime ??
a?.CreateTime ??
a?.createTime ??
a?.OccurTime ??
a?.occurTime ??
a?.Time ??
a?.time
if (raw == null || raw === '') return null
const d = new Date(raw)
return Number.isNaN(d.getTime()) ? null : d
}
// 报警汇总:B/C 仍为「设备处于报警态」一条;A 类(魔盒)为近 1 小时 alarm/v2 多条,不按 AlarmCount 标设备报警态
/**
* 报警汇总:
* - B/C:仍为「设备处于报警态」一条摘要
* - A 类:不再调用 alarm/v2,直接展示机台状态接口的 NcState.AlarmMsg(有内容则展示一条)
*/
const alarms = computed(() => {
const rows = []
const now = new Date()
@@ -162,7 +150,6 @@ const alarms = computed(() => {
const a = d.machineData.alarm
const msg = a?.length ? a[0] : 'CNC系统报警'
rows.push({
at: now.getTime(),
time: now.toLocaleTimeString('zh-CN', { hour12: false }),
device: `CNC-${d.name}`,
message: msg
@@ -171,22 +158,17 @@ const alarms = computed(() => {
laserListForUi.value.forEach((d) => {
if (!d.online || d.type !== 'laser') return
const list = d._laser?.alarmsLastHour
if (!Array.isArray(list) || !list.length) return
list.forEach((a) => {
const at = laserAlarmOccurAt(a) || now
const msg = a?.AlarmDesc || a?.alarmDesc || a?.message || a?.msg || ''
rows.push({
at: at.getTime(),
time: at.toLocaleTimeString('zh-CN', { hour12: false }),
device: d.name,
message: msg || '报警'
})
const nc = d.machineData?.CutSystemState?.NcState
const msg = String(nc?.AlarmMsg || '').trim()
if (!msg) return
rows.push({
time: now.toLocaleTimeString('zh-CN', { hour12: false }),
device: d.name,
message: msg
})
})
rows.sort((x, y) => y.at - x.at)
return rows.map(({ at: _t, ...rest }) => rest)
return rows
})
function goDetail(id) {