/**
|
* 协同审批:审批节点 → 流程步骤(与 Web approvalDia 一致)
|
* @param {Array} list approveProcessDetails 返回的节点数组
|
* @returns {Array<{
|
* title: string, approverName: string, status: string, statusText: string,
|
* approveTime: string|null, opinion: string, urlTem: string, isShen: boolean
|
* }>}
|
*/
|
export function mapApprovalSteps(list) {
|
const rows = Array.isArray(list) ? list : [];
|
return rows.map((it, idx) => {
|
let status = "pending";
|
if (it.approveNodeStatus === 1) status = "completed";
|
else if (it.approveNodeStatus === 2) status = "rejected";
|
else if (it.isShen) status = "current";
|
|
let statusText = "未审批";
|
if (it.approveNodeStatus === 2) statusText = "已驳回";
|
else if (it.approveNodeStatus === 1) statusText = "已同意";
|
|
return {
|
title: `第${idx + 1}步审批`,
|
approverName: it.approveNodeUser || "未知用户",
|
status,
|
statusText,
|
approveTime: it.approveTime || null,
|
opinion: it.approveNodeReason || "",
|
urlTem:
|
it.urlTem || (it.url ? String(it.url).replace(/word/g, "img") : ""),
|
isShen: !!it.isShen,
|
};
|
});
|
}
|