feat(workbench): expand SCADA monitoring and investigation presentation
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
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 { complexInvestigationDevCases, createComplexInvestigationDevCase } from "./investigation-dev-complex-cases";
|
||||
import {
|
||||
createInvestigationDevSample,
|
||||
createPresentationRecord,
|
||||
createUiRecord,
|
||||
normalizeDevCenter,
|
||||
serializeInvestigationDevJsonl
|
||||
} from "./investigation-dev-preview";
|
||||
|
||||
@@ -13,13 +13,9 @@ export const investigationDevCases = [
|
||||
{
|
||||
id: "combined",
|
||||
label: "组合联动",
|
||||
expected: "合成空间点、压力曲线、候选表格与数据一同展示;有调查地图目标时同时高亮。"
|
||||
},
|
||||
{
|
||||
id: "map_targets",
|
||||
label: "地图定位与高亮",
|
||||
expected: "显示地图中心附近的合成点,并高亮所选调查已有的地图目标;无目标时仅显示合成点。"
|
||||
expected: "合成空间点、压力曲线与候选表格一起展示;要素定位和高亮请使用地图调试页签。"
|
||||
},
|
||||
...complexInvestigationDevCases,
|
||||
{
|
||||
id: "pressure_line",
|
||||
label: "压力趋势对比",
|
||||
@@ -101,14 +97,12 @@ function table(id: string, title: string, columns: string[], rows: string[][]):
|
||||
return createUiRecord(block);
|
||||
}
|
||||
|
||||
/** Fixtures use current map coordinates and existing task targets, never invented query IDs. */
|
||||
/** Synthetic fixtures use current map coordinates and never query invented asset IDs. */
|
||||
export function createInvestigationDevCase(
|
||||
caseId: InvestigationDevCaseId,
|
||||
center: [number, number],
|
||||
target?: InvestigationMapTarget
|
||||
caseId: InvestigationDevCaseId
|
||||
): string {
|
||||
const [longitude, latitude] = normalizeDevCenter(center);
|
||||
if (caseId === "combined") return createInvestigationDevSample([longitude, latitude], target);
|
||||
const [longitude, latitude] = INVESTIGATION_DEV_NETWORK.center;
|
||||
if (caseId === "combined") return createInvestigationDevSample();
|
||||
const point = (dx = 0, dy = 0): [number, number] => [
|
||||
Math.max(-180, Math.min(180, longitude + dx)),
|
||||
latitude + dy
|
||||
@@ -131,26 +125,10 @@ export function createInvestigationDevCase(
|
||||
});
|
||||
|
||||
switch (caseId) {
|
||||
case "map_targets":
|
||||
return jsonl([
|
||||
...(target
|
||||
? [
|
||||
presentation({
|
||||
action: "highlight_features",
|
||||
layer: target.source_id,
|
||||
feature_ids: [target.feature_id],
|
||||
effect: "pulse"
|
||||
})
|
||||
]
|
||||
: []),
|
||||
overlay("geometry", "本地合成定位点", [
|
||||
{
|
||||
type: "Feature",
|
||||
properties: { origin: "synthetic" },
|
||||
geometry: { type: "Point", coordinates: point() }
|
||||
}
|
||||
])
|
||||
]);
|
||||
case "complex_investigation":
|
||||
case "complex_tables":
|
||||
case "complex_charts":
|
||||
return createComplexInvestigationDevCase(caseId, [longitude, latitude]);
|
||||
case "pressure_line":
|
||||
return jsonl([
|
||||
presentation({
|
||||
@@ -187,7 +165,7 @@ export function createInvestigationDevCase(
|
||||
overlay("geometry", "本地合成影响范围", [
|
||||
{
|
||||
type: "Feature",
|
||||
properties: { origin: "synthetic", purpose: "display_test_only" },
|
||||
properties: { project_code: INVESTIGATION_DEV_NETWORK.projectCode, origin: "synthetic", purpose: "display_test_only" },
|
||||
geometry: {
|
||||
type: "Polygon",
|
||||
coordinates: [
|
||||
@@ -210,7 +188,7 @@ export function createInvestigationDevCase(
|
||||
"本地合成投诉热力",
|
||||
[-0.0015, 0, 0.0015].map((offset, index) => ({
|
||||
type: "Feature",
|
||||
properties: { origin: "synthetic", weight: [1, 3, 2][index] },
|
||||
properties: { project_code: INVESTIGATION_DEV_NETWORK.projectCode, origin: "synthetic", weight: [1, 3, 2][index] },
|
||||
geometry: { type: "Point", coordinates: point(offset, offset / 2) }
|
||||
}))
|
||||
)
|
||||
@@ -222,12 +200,12 @@ export function createInvestigationDevCase(
|
||||
"合成候选管段对比",
|
||||
["候选", "优先级", "核查依据"],
|
||||
[
|
||||
["DEMO-PIPE-01", "1", "合成压力降幅较大,待核查"],
|
||||
["DEMO-PIPE-02", "2", "合成相关性较弱,待排除"]
|
||||
[INVESTIGATION_DEV_NETWORK.pipeIds[0], "1", "合成压力降幅较大,待核查"],
|
||||
[INVESTIGATION_DEV_NETWORK.pipeIds[1], "2", "合成相关性较弱,待排除"]
|
||||
]
|
||||
),
|
||||
data("candidate", { element_id: "DEMO-PIPE-01", rank: 1, status: "unverified" }),
|
||||
data("candidate", { element_id: "DEMO-PIPE-02", rank: 2, status: "unverified" })
|
||||
data("candidate", { element_id: INVESTIGATION_DEV_NETWORK.pipeIds[0], rank: 1, status: "unverified" }),
|
||||
data("candidate", { element_id: INVESTIGATION_DEV_NETWORK.pipeIds[1], rank: 2, status: "unverified" })
|
||||
]);
|
||||
case "valves_table":
|
||||
return jsonl([
|
||||
@@ -236,17 +214,17 @@ export function createInvestigationDevCase(
|
||||
"合成隔离阀门清单",
|
||||
["阀门", "操作建议", "核查要求"],
|
||||
[
|
||||
["DEMO-VALVE-01", "待评估", "位置与可操作性未核实"],
|
||||
["DEMO-VALVE-02", "待评估", "连通性与影响范围未核实"]
|
||||
[INVESTIGATION_DEV_NETWORK.valveIds[0], "待评估", "位置与可操作性未核实"],
|
||||
[INVESTIGATION_DEV_NETWORK.valveIds[1], "待评估", "连通性与影响范围未核实"]
|
||||
]
|
||||
),
|
||||
data("valve", { element_id: "DEMO-VALVE-01", status: "unverified", executed: false }),
|
||||
data("valve", { element_id: "DEMO-VALVE-02", status: "unverified", executed: false })
|
||||
data("valve", { element_id: INVESTIGATION_DEV_NETWORK.valveIds[0], status: "unverified", executed: false }),
|
||||
data("valve", { element_id: INVESTIGATION_DEV_NETWORK.valveIds[1], status: "unverified", executed: false })
|
||||
]);
|
||||
case "data_only":
|
||||
return jsonl([
|
||||
data("candidate", {
|
||||
element_id: "DEMO-PIPE-03",
|
||||
element_id: INVESTIGATION_DEV_NETWORK.pipeIds[2],
|
||||
action: "clear_highlights",
|
||||
status: "data_only"
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user