feat(approval): ApprovalBar→ApprovalDrawer 抽屉重设计;e2e/artifacts 不入库
- 新增 ApprovalDrawer(业务表单+轨迹+动态按钮),删除旧 ApprovalBar - approval.ts 增审批上下文接口;Dialog/TodoPage 接线 - .gitignore 排除 e2e/artifacts 测试重跑产物(取消跟踪 72 张截图) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -51,3 +51,63 @@ export async function fetchTrace(processInstanceId: string): Promise<TraceNode[]
|
||||
);
|
||||
return Array.isArray(data) ? data : [];
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// WfTemplate 驱动审批 —— 动态按钮 + 业务表单 + 按 type 分派
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/** WfTemplate 解析出的审批按钮(label/type 随节点定制,不写死)。 */
|
||||
export interface ApprovalButton {
|
||||
id: string;
|
||||
label: string;
|
||||
/** approve | reject | reback | agent | assist | circulated */
|
||||
type: string;
|
||||
servicename?: string | null;
|
||||
}
|
||||
|
||||
/** GET /api/task/{id}/approval-meta 返回:审批界面的全部数据驱动元数据。 */
|
||||
export interface ApprovalMeta {
|
||||
found: boolean;
|
||||
taskId: string;
|
||||
taskName?: string | null;
|
||||
formKey?: string | null;
|
||||
buttons: ApprovalButton[];
|
||||
/** wftemplate=模板驱动 / default=无模板回退默认按钮 */
|
||||
buttonsSource: 'wftemplate' | 'default';
|
||||
loadScript?: string | null;
|
||||
showsend: boolean;
|
||||
businessKey?: string | null;
|
||||
businessTable?: string | null;
|
||||
/** 业务表友好中文名(sys_entity.name,如「施工方案审批」);展示用,避免显裸表名。 */
|
||||
businessTableName?: string | null;
|
||||
processInstanceId?: string | null;
|
||||
/** 业务单据 amis schema 模板 id(仅当 WfTemplate pageid 在 sys_page_schema 有 schema 时有值)。 */
|
||||
formTemplateId?: string | null;
|
||||
ended: boolean;
|
||||
suspended: boolean;
|
||||
}
|
||||
|
||||
/** POST /api/task/{id}/action 请求。 */
|
||||
export interface ApprovalActionRequest {
|
||||
actionType: string;
|
||||
/** WfTemplate 按钮 id:后端据此重解析该按钮的 servicename(自定义服务流)并执行。 */
|
||||
buttonId?: string;
|
||||
comment?: string;
|
||||
targetUserId?: string;
|
||||
businessKey?: string;
|
||||
processInstanceId?: string;
|
||||
tableName?: string;
|
||||
}
|
||||
|
||||
export async function fetchApprovalMeta(taskId: string): Promise<ApprovalMeta> {
|
||||
const { data } = await http.get<ApprovalMeta>(`/api/task/${taskId}/approval-meta`);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function submitApprovalAction(
|
||||
taskId: string,
|
||||
req: ApprovalActionRequest,
|
||||
): Promise<Record<string, unknown>> {
|
||||
const { data } = await http.post<Record<string, unknown>>(`/api/task/${taskId}/action`, req);
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user