Просмотр исходного кода

fix(cockpit): 报警终态与当前列表状态对齐

- 报警 HANDLED 按终态收口到流程关闭步,不再停在处置步
- 打开详情后重取当前事件,避免列表停留在外部管理端更新前的旧状态
ChenJZ 23 часов назад
Родитель
Сommit
41bc09e733
1 измененных файлов с 13 добавлено и 2 удалено
  1. 13 2
      src/modules/cockpit/components/WarningResponsePane.vue

+ 13 - 2
src/modules/cockpit/components/WarningResponsePane.vue

@@ -109,14 +109,25 @@ function onCardAction(action) {
     const prefill = row.identityPayload || row
     if (action.kind === 'event') {
         eventStore.closeEvent()
-        return entityDetailStore.show({ kind: 'event', id, family: row.identityFamily || row.family || eventStore.mode }, prefill, { side: side.value })
+        const opened = entityDetailStore.show({ kind: 'event', id, family: row.identityFamily || row.family || eventStore.mode }, prefill, { side: side.value })
+        refreshAfterOpen(opened)
+        return opened
     }
     if (action.kind === 'work-order') {
-        return entityDetailStore.show({ kind: 'work-order', id }, prefill, { side: side.value })
+        const opened = entityDetailStore.show({ kind: 'work-order', id }, prefill, { side: side.value })
+        refreshAfterOpen(opened)
+        return opened
     }
     return false
 }
 
+/** 详情打开后顺手重取当前事件:外部管理端刚改完状态时,列表不会停留在旧快照。 */
+function refreshAfterOpen(opened) {
+    Promise.resolve(opened)
+        .then((ok) => { if (ok) return eventStore.loadCurrentEvents() })
+        .catch(() => {})
+}
+
 </script>
 
 <style scoped>