fix(review): 验收冲突显示与闸门对齐 — 验收报 CONFLICT_UNRESOLVED 时回拉最新审稿并回灌冲突;未审稿不再误显「可直接验收」

This commit is contained in:
Yaojia Wang
2026-06-24 16:17:54 +02:00
parent d0c301349c
commit a4ef250fc9
4 changed files with 37 additions and 8 deletions

View File

@@ -13,6 +13,9 @@ export interface AcceptOutcome {
result: AcceptResponse | null;
// 409 CONFLICT_UNRESOLVED 缺判下标(高亮报告卡)。
missingIndices: number[];
// 后端验收闸报「有未裁决冲突」——即便本页当前未显示冲突(快照过期/未审稿)。
// 调用方据此回拉持久化最新审稿、回灌冲突供裁决(修「显示 0 冲突却被拦」)。
conflictUnresolved: boolean;
}
export interface UseAccept {
@@ -58,16 +61,15 @@ export function useAccept(): UseAccept {
const code = env?.error?.code;
const missing = env?.error?.details?.missing_conflict_indices ?? [];
if (code === "CONFLICT_UNRESOLVED") {
toast("尚有冲突未裁决,请先处理高亮项", "error");
return { result: null, missingIndices: missing };
return { result: null, missingIndices: missing, conflictUnresolved: true };
}
toast("验收失败,请重试(正文未丢失)", "error");
return { result: null, missingIndices: [] };
return { result: null, missingIndices: [], conflictUnresolved: false };
}
setResult(data);
setStatus("accepted");
toast("本章已验收", "success");
return { result: data, missingIndices: [] };
return { result: data, missingIndices: [], conflictUnresolved: false };
},
[toast],
);