fix(web): support approval history drawer
This commit is contained in:
@@ -52,6 +52,13 @@ export async function fetchTrace(processInstanceId: string): Promise<TraceNode[]
|
||||
return Array.isArray(data) ? data : [];
|
||||
}
|
||||
|
||||
export async function fetchTraceByBusiness(businessKey: string): Promise<TraceNode[]> {
|
||||
const { data } = await http.get<TraceNode[]>(
|
||||
`/api/flow/business/${encodeURIComponent(businessKey)}/trace`,
|
||||
);
|
||||
return Array.isArray(data) ? data : [];
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// WfTemplate 驱动审批 —— 动态按钮 + 业务表单 + 按 type 分派
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -104,6 +111,30 @@ export async function fetchApprovalMeta(taskId: string): Promise<ApprovalMeta> {
|
||||
return data;
|
||||
}
|
||||
|
||||
export interface ApprovalHistoryParams {
|
||||
businessKey?: string;
|
||||
processInstanceId?: string;
|
||||
businessTable?: string;
|
||||
}
|
||||
|
||||
function historyQuery(params: ApprovalHistoryParams): string {
|
||||
const query = new URLSearchParams();
|
||||
if (params.businessKey) query.set('businessKey', params.businessKey);
|
||||
if (params.processInstanceId) query.set('processInstanceId', params.processInstanceId);
|
||||
if (params.businessTable) query.set('businessTable', params.businessTable);
|
||||
const s = query.toString();
|
||||
return s ? `?${s}` : '';
|
||||
}
|
||||
|
||||
export async function fetchApprovalHistoryMeta(params: ApprovalHistoryParams): Promise<ApprovalMeta> {
|
||||
const { data } = await http.get<ApprovalMeta>(`/api/approval/history/meta${historyQuery(params)}`);
|
||||
return data;
|
||||
}
|
||||
|
||||
export function approvalHistoryBusinessDataApi(params: ApprovalHistoryParams): string {
|
||||
return `get:/api/approval/history/business-data${historyQuery(params)}`;
|
||||
}
|
||||
|
||||
export async function submitApprovalAction(
|
||||
taskId: string,
|
||||
req: ApprovalActionRequest,
|
||||
|
||||
Reference in New Issue
Block a user