fix: resume incomplete SCADA presentations
This commit is contained in:
@@ -107,6 +107,7 @@ export const taskReportSchema = z.object({
|
||||
data_gaps: z.array(dataGapSchema),
|
||||
diagram: investigationDiagramSchema.nullish(),
|
||||
ui_blocks: z.array(reportUiBlockSchema).max(8).optional(),
|
||||
scada_device_ids: z.array(text.max(128)).max(1000).optional(),
|
||||
}).strict().superRefine((report, ctx) => {
|
||||
const invalid = (message: string, path: (string | number)[] = []) =>
|
||||
ctx.addIssue({ code: z.ZodIssueCode.custom, message, path });
|
||||
|
||||
@@ -404,6 +404,12 @@ export class OperationalTaskClientError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
/** Feed a concrete Server coverage rejection back into the same active investigation. */
|
||||
export function scadaPresentationContinuation(error: unknown): string | null {
|
||||
if (!(error instanceof OperationalTaskClientError) || error.code !== "SCADA_PRESENTATION_INCOMPLETE") return null;
|
||||
return `Server尚未接受本轮调查结束:${error.message}\n请按返回设备补充publish_task_presentation监测图,必要时更新publish_task_report。保留目标设备与真实缺测说明,完成后再结束本轮。`;
|
||||
}
|
||||
|
||||
const parseJson = (text: string): unknown => {
|
||||
if (!text.trim()) return {};
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user