Translate freeflow.back and refine payment and CC actions

This commit is contained in:
gitea committed 2026-09-14 17:42:09 +08:00
1 parent 6c351b34df
commit 2d4b0b1d36
3 files changed
+23 -15

No files matched your search

+3 -2
View File
@@ -956,10 +956,11 @@ describe("Hose Flow Domain", () => {
// 2. Duplicate comment deduplicated (appears only once)
const matches = r.eHumanComment.match(/高思琦: ETA2026年家庭日费用报销/g);
expect(matches?.length).toBe(1);
// 3. freeflow.pay mapped to 支付完成
expect(r.eHumanComment).toContain("高思琦: 支付完成");
// 3. freeflow.pay mapped to 支付成功
expect(r.eHumanComment).toContain("高思琦: 支付成功");
// 4. freeflow.carbonCopy omitted
expect(r.eHumanComment).not.toContain("freeflow.carbonCopy");
expect(r.eHumanComment).not.toContain("抄送单据");
expect(r.eHumanComment).not.toContain("抄送通知");
// 5. No pending node appended
expect(r.eHumanComment).not.toContain("当前审核节点");
+15 -9
View File
@@ -692,11 +692,15 @@ export function formatHumanOpinionLines(events: HoseFlowTimelineEntry[]): string
const lines: string[] = [];
for (const ev of events) {
if (
(ev.rawAction === "freeflow.carbonCopy" ||
ev.rawAction === "freeflow.cc" ||
ev.rawAction === "freeflow.print" ||
ev.action === "打印提醒" ||
ev.action === "抄送通知") &&
ev.rawAction === "freeflow.carbonCopy" ||
ev.rawAction === "freeflow.cc" ||
ev.action === "抄送单据" ||
ev.action === "抄送通知"
) {
continue;
}
if (
(ev.rawAction === "freeflow.print" || ev.action === "打印提醒" || ev.action === "打印单据") &&
!ev.comment
) {
continue;
@@ -710,12 +714,14 @@ export function formatHumanOpinionLines(events: HoseFlowTimelineEntry[]): string
comment = "同意";
} else if (ev.rawAction === "freeflow.autoAgree") {
comment = "自动同意";
} else if (ev.rawAction === "freeflow.pay" || ev.action === "支付完成") {
comment = "支付完成";
} else if (ev.rawAction === "freeflow.paying" || ev.action === "支付中") {
comment = "支付中";
} else if (ev.rawAction === "freeflow.pay" || ev.action === "支付成功" || ev.action === "支付完成") {
comment = "支付成功";
} else if (ev.rawAction === "freeflow.paying" || ev.action === "发起支付" || ev.action === "支付中") {
comment = "发起支付";
} else if (ev.rawAction === "freeflow.reject" || ev.action === "审批驳回") {
comment = "驳回";
} else if (ev.rawAction === "freeflow.back" || ev.action === "审批退回") {
comment = "退回修改";
} else if (ev.rawAction === "freeflow.retract" || ev.action === "单据撤回") {
comment = "单据撤回";
} else {
+5 -4
View File
@@ -5,14 +5,15 @@ export const HOSE_FLOW_ACTION_LABELS: Record<string, string> = {
"freeflow.agree": "审批同意",
"freeflow.autoAgree": "自动同意",
"freeflow.reject": "审批驳回",
"freeflow.back": "审批退回",
"freeflow.print": "打印单据",
"freeflow.retract": "单据撤回",
"freeflow.addnode": "加签/转交",
"freeflow.comment": "发表评论",
"freeflow.pay": "支付完成",
"freeflow.paying": "支付中",
"freeflow.carbonCopy": "抄送通知",
"freeflow.cc": "抄送通知"
"freeflow.pay": "支付成功",
"freeflow.paying": "发起支付",
"freeflow.carbonCopy": "抄送单据",
"freeflow.cc": "抄送单据"
};
export const HOSE_FLOW_STATE_LABELS: Record<string, string> = {