From 404ab607688ce9c02a0b1155406446cf6026d664 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 17 Aug 2026 17:59:09 +0800
Subject: [PATCH] feat:变化检测的

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

diff --git a/apps/workbench-console/src/stores/artifacts.ts b/apps/workbench-console/src/stores/artifacts.ts
index a0cf239..1ada0d7 100644
--- a/apps/workbench-console/src/stores/artifacts.ts
+++ b/apps/workbench-console/src/stores/artifacts.ts
@@ -2,10 +2,14 @@
 
 import {
   loadDetectionArtifacts,
+  loadChangeArtifacts,
   loadSemanticArtifacts,
+  loadMeasurementArtifacts,
   loadTrajectoryArtifacts,
   type DetectionCase,
+  type ChangeCase,
   type SemanticCase,
+  type MeasurementCase,
   type TrajectoryCase
 } from "@/api/artifacts";
 
@@ -13,6 +17,8 @@
   detectionCases: Record<string, DetectionCase>;
   trajectoryCases: Record<string, TrajectoryCase>;
   semanticCases: Record<string, SemanticCase>;
+  measurementCases: Record<string, MeasurementCase>;
+  changeCases: Record<string, ChangeCase>;
   loading: boolean;
   error: string | null;
 }
@@ -22,8 +28,15 @@
     detectionRun: (state) => Object.values(state.detectionCases)[0]?.run ?? null,
     detectionImages: (state) => Object.values(state.detectionCases)[0]?.images ?? []
   },
-  state: (): ArtifactState => ({ detectionCases: {}, trajectoryCases: {}, semanticCases: {}, loading: false, error: null }),
+  state: (): ArtifactState => ({ detectionCases: {}, trajectoryCases: {}, semanticCases: {}, measurementCases: {}, changeCases: {}, loading: false, error: null }),
   actions: {
+    async loadChange(force = false) {
+      if (!force && Object.keys(this.changeCases).length) return;
+      this.loading = true; this.error = null;
+      try { this.changeCases = await loadChangeArtifacts(); }
+      catch (error) { this.error = error instanceof Error ? error.message : "变化检测结果读取失败"; }
+      finally { this.loading = false; }
+    },
     async loadDetection(force = false) {
       if (!force && Object.keys(this.detectionCases).length) return;
       this.loading = true; this.error = null;
@@ -44,6 +57,13 @@
       try { this.semanticCases = await loadSemanticArtifacts(); }
       catch (error) { this.error = error instanceof Error ? error.message : "语义分割结果读取失败"; }
       finally { this.loading = false; }
+    },
+    async loadMeasurement(force = false) {
+      if (!force && Object.keys(this.measurementCases).length) return;
+      this.loading = true; this.error = null;
+      try { this.measurementCases = await loadMeasurementArtifacts(); }
+      catch (error) { this.error = error instanceof Error ? error.message : "空间测量结果读取失败"; }
+      finally { this.loading = false; }
     }
   }
 });

--
Gitblit v1.9.3