From 2e68b1338ea04125ce4360e6d2ddf03f54df86ac Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Wed, 19 Aug 2026 14:11:30 +0800
Subject: [PATCH] feat: init异常检测

---
 apps/workbench-console/src/stores/artifacts.ts |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/apps/workbench-console/src/stores/artifacts.ts b/apps/workbench-console/src/stores/artifacts.ts
index 1ada0d7..7f7082d 100644
--- a/apps/workbench-console/src/stores/artifacts.ts
+++ b/apps/workbench-console/src/stores/artifacts.ts
@@ -6,11 +6,13 @@
   loadSemanticArtifacts,
   loadMeasurementArtifacts,
   loadTrajectoryArtifacts,
+  loadAnomalyArtifacts,
   type DetectionCase,
   type ChangeCase,
   type SemanticCase,
   type MeasurementCase,
-  type TrajectoryCase
+  type TrajectoryCase,
+  type AnomalyCase
 } from "@/api/artifacts";
 
 interface ArtifactState {
@@ -19,6 +21,7 @@
   semanticCases: Record<string, SemanticCase>;
   measurementCases: Record<string, MeasurementCase>;
   changeCases: Record<string, ChangeCase>;
+  anomalyCases: Record<string, AnomalyCase>;
   loading: boolean;
   error: string | null;
 }
@@ -28,7 +31,7 @@
     detectionRun: (state) => Object.values(state.detectionCases)[0]?.run ?? null,
     detectionImages: (state) => Object.values(state.detectionCases)[0]?.images ?? []
   },
-  state: (): ArtifactState => ({ detectionCases: {}, trajectoryCases: {}, semanticCases: {}, measurementCases: {}, changeCases: {}, loading: false, error: null }),
+  state: (): ArtifactState => ({ detectionCases: {}, trajectoryCases: {}, semanticCases: {}, measurementCases: {}, changeCases: {}, anomalyCases: {}, loading: false, error: null }),
   actions: {
     async loadChange(force = false) {
       if (!force && Object.keys(this.changeCases).length) return;
@@ -64,6 +67,13 @@
       try { this.measurementCases = await loadMeasurementArtifacts(); }
       catch (error) { this.error = error instanceof Error ? error.message : "空间测量结果读取失败"; }
       finally { this.loading = false; }
+    },
+    async loadAnomaly(force = false) {
+      if (!force && Object.keys(this.anomalyCases).length) return;
+      this.loading = true; this.error = null;
+      try { this.anomalyCases = await loadAnomalyArtifacts(); }
+      catch (error) { this.error = error instanceof Error ? error.message : "异常检测结果读取失败"; }
+      finally { this.loading = false; }
     }
   }
 });

--
Gitblit v1.9.3