feat(workbench): expand SCADA monitoring and investigation presentation

This commit is contained in:
2026-11-07 19:50:14 +08:00
parent 0801e161ec
commit ba71e2d529
133 changed files with 6754 additions and 1438 deletions
@@ -5,7 +5,7 @@ import {
type AnswerUiBlock
} from "@/features/agent";
import { type InvestigationPresentationCommand } from "../api/investigation-presentation";
import type { InvestigationMapTarget } from "../api/investigation-report";
import { INVESTIGATION_DEV_NETWORK } from "./investigation-dev-network";
import type { OperationalTask } from "../api/operational-task-client";
export type InvestigationDevPreview = {
@@ -150,16 +150,8 @@ export function investigationReportUiSummary(task: OperationalTask | null) {
return counts;
}
export function normalizeDevCenter([longitude, latitude]: [number, number]): [number, number] {
if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) throw new Error("地图中心坐标必须为有限数值。");
return [((((longitude + 180) % 360) + 360) % 360) - 180, Math.max(-89.99, Math.min(89.99, latitude))];
}
export function createInvestigationDevSample(
center: [number, number],
target?: InvestigationMapTarget
): string {
center = normalizeDevCenter(center);
export function createInvestigationDevSample(): string {
const center: [number, number] = [...INVESTIGATION_DEV_NETWORK.center];
const chart = {
title: "本地合成压力趋势",
chart_type: "line" as const,
@@ -189,8 +181,8 @@ export function createInvestigationDevSample(
title: "合成候选对比",
columns: ["候选", "排序", "说明"],
rows: [
["DEMO-PIPE-01", "1", "仅测试表格展示"],
["DEMO-PIPE-02", "2", "未执行定位分析"]
[INVESTIGATION_DEV_NETWORK.pipeIds[0], "1", "仅测试表格展示"],
[INVESTIGATION_DEV_NETWORK.pipeIds[1], "2", "未执行定位分析"]
]
},
children: []
@@ -199,15 +191,6 @@ export function createInvestigationDevSample(
}
};
const records: unknown[] = [];
if (target)
records.push(
createPresentationRecord({
action: "highlight_features",
layer: target.source_id,
feature_ids: [target.feature_id],
effect: "pulse"
})
);
records.push(
createPresentationRecord({
action: "set_overlay",
@@ -220,7 +203,7 @@ export function createInvestigationDevSample(
features: [
{
type: "Feature",
properties: { origin: "synthetic" },
properties: { project_code: INVESTIGATION_DEV_NETWORK.projectCode, origin: "synthetic" },
geometry: { type: "Point", coordinates: center }
}
]
@@ -237,7 +220,7 @@ export function createInvestigationDevSample(
record_type: "candidate",
origin: "synthetic",
source_evidence_refs: [],
element_id: "DEMO-PIPE-01",
element_id: INVESTIGATION_DEV_NETWORK.pipeIds[0],
rank: 1,
status: "example_only"
}