Map EXEMPT_APPROVE to 备注通过 and ERROR to 错误 in AI decision column

This commit is contained in:
gitea committed 2026-09-14 17:27:05 +08:00
1 parent 1a2c41c70c
commit d5f68ea2f3
2 files changed
+19 -7

No files matched your search

+6 -2
View File
@@ -698,6 +698,10 @@ export function alignApprovalRunsWithHoseFlow(
const normDecision = aiDecisionStr.toUpperCase();
const isReject = normDecision === "REJECT" || normDecision === "驳回";
const isApprove = normDecision === "APPROVE" || normDecision === "通过";
const isExemptApprove =
normDecision === "EXEMPT_APPROVE" ||
normDecision === "免审通过" ||
normDecision === "备注通过";
const taskMode = run.taskMode || run.finalExecutionMode || "";
const normMode = String(taskMode).toLowerCase();
@@ -708,7 +712,7 @@ export function alignApprovalRunsWithHoseFlow(
taskMode === "fully_automatic";
let aiAction = "-";
if (isApprove) aiAction = "添加评论";
if (isApprove || isExemptApprove) aiAction = "添加评论";
else if (isReject) aiAction = isAutomatic ? "驳回" : "添加评论";
else if (normDecision === "REVIEW" || normDecision === "转交复核") aiAction = "转交复核";
@@ -738,7 +742,7 @@ export function alignApprovalRunsWithHoseFlow(
let operator: FlowPerson | undefined;
// Check for Post-AI Mutation / Audit Drift
const isAiApproved = isApprove || normDecision === "EXEMPT_APPROVE" || normDecision === "免审通过";
const isAiApproved = isApprove || isExemptApprove;
const postAiEvents = history.filter((e) => (e.time ?? 0) > runTime + 5000);
const hasPostAiRetract = postAiEvents.some(
(e) => e.rawAction === "freeflow.retract" || e.action === "单据撤回"
+13 -5
View File
@@ -670,17 +670,24 @@ export async function exportApprovalRunsToExcel(
// 4. AI 决策与行为
const aiDecision = res.decision || (record as any).aiDecision || "-";
let aiDecisionDesc = aiDecision;
const normAiDec = String(aiDecision).toUpperCase();
let aiDecisionDesc = String(aiDecision);
let aiAction = "-";
if (aiDecision === "APPROVE") {
if (normAiDec === "APPROVE" || normAiDec === "通过") {
aiDecisionDesc = "通过";
aiAction = "添加评论";
} else if (aiDecision === "REVIEW") {
} else if (normAiDec === "EXEMPT_APPROVE" || normAiDec === "免审通过" || normAiDec === "备注通过") {
aiDecisionDesc = "备注通过";
aiAction = "添加评论";
} else if (normAiDec === "REVIEW" || normAiDec === "转交复核") {
aiDecisionDesc = "转交复核";
aiAction = "转交复核";
} else if (aiDecision === "REJECT") {
} else if (normAiDec === "REJECT" || normAiDec === "驳回") {
aiDecisionDesc = "驳回";
aiAction = "驳回";
} else if (normAiDec === "ERROR" || normAiDec === "错误") {
aiDecisionDesc = "错误";
aiAction = "-";
}
// 5. 耗时计算
@@ -802,9 +809,10 @@ export async function exportApprovalRunsToExcel(
// AI 决策颜色区分
if (colNumber === 7) {
if (val === "通过") cell.font = { color: { argb: "FF16A34A" }, bold: true };
if (val === "通过" || val === "备注通过") cell.font = { color: { argb: "FF16A34A" }, bold: true };
else if (val === "转交复核") cell.font = { color: { argb: "FFD97706" }, bold: true };
else if (val === "驳回") cell.font = { color: { argb: "FFDC2626" }, bold: true };
else if (val === "错误" || val === "ERROR") cell.font = { color: { argb: "FFDC2626" }, bold: true };
}
// 人工审核高亮