吸收数字员工多步审批跨端回写
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
getSchedulerJobs,
|
||||
governanceCommand,
|
||||
postDigitalEmployeeWorkdayAction,
|
||||
pullApprovalUpdates,
|
||||
pullPlanStepDispatchPolicy,
|
||||
pullRiskApprovalPolicy,
|
||||
recordApprovalAction,
|
||||
@@ -1413,6 +1414,27 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit
|
||||
}
|
||||
}, [fetchProjection]);
|
||||
|
||||
const refreshApprovalUpdates = useCallback(async () => {
|
||||
setActionBusy('pull_approval_updates');
|
||||
setActionError(null);
|
||||
setActionNotice(null);
|
||||
try {
|
||||
const result = await pullApprovalUpdates();
|
||||
if (!mountedRef.current) return;
|
||||
await fetchProjection();
|
||||
if (!mountedRef.current) return;
|
||||
setActionNotice(result.ok
|
||||
? `审批更新已拉取:应用 ${result.applied ?? 0} 条,忽略 ${result.ignored ?? 0} 条。`
|
||||
: `审批更新拉取失败:${result.error || '未知错误'}。`);
|
||||
} catch (error) {
|
||||
if (mountedRef.current) {
|
||||
setActionError(error instanceof Error ? error.message : '拉取审批更新失败');
|
||||
}
|
||||
} finally {
|
||||
if (mountedRef.current) setActionBusy(null);
|
||||
}
|
||||
}, [fetchProjection]);
|
||||
|
||||
const copySyncFailureDiagnostic = useCallback(async (failure: ManagementSyncFailure) => {
|
||||
const diagnostic = buildSyncFailureDiagnostic(failure, managementSyncStatus);
|
||||
try {
|
||||
@@ -2081,6 +2103,16 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit
|
||||
<ShieldAlert size={13} aria-hidden="true" />
|
||||
<span>{actionBusy === 'pull_risk_approval_policy' ? '拉取中...' : '风险策略'}</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="de-btn-secondary de-btn-sm"
|
||||
disabled={projectionLoading || actionBusy === 'pull_approval_updates'}
|
||||
onClick={refreshApprovalUpdates}
|
||||
title="从管理端拉取审批更新"
|
||||
>
|
||||
<RefreshCw size={13} aria-hidden="true" />
|
||||
<span>{actionBusy === 'pull_approval_updates' ? '拉取中...' : '审批更新'}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className={`de-management-sync-strip de-management-sync-strip--${managementSyncTone}`} title={managementSyncError || managementSyncSummary}>
|
||||
@@ -3227,6 +3259,10 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit
|
||||
<span>{decision.comment_count ? `评论 ${decision.comment_count} 条` : '暂无评论'}</span>
|
||||
<span>{decision.delegate_to ? `转交 ${decision.delegate_to}` : '未转交'}</span>
|
||||
<span>{decision.last_action ? `最近 ${approvalActionLabel(decision.last_action)} · ${decision.last_actor || '未知'}` : '暂无审批动作'}</span>
|
||||
<span>{decision.approval_step_count ? `步骤 ${decision.approval_step_index || 1}/${decision.approval_step_count}` : '单步审批'}</span>
|
||||
<span>{decision.current_step_label ? `当前 ${decision.current_step_label}` : '当前步骤待确认'}</span>
|
||||
<span>{decision.current_participant ? `处理人 ${decision.current_participant}` : '未指定处理人'}</span>
|
||||
<span>{decision.next_step_label ? `下一步 ${decision.next_step_label}` : '无后续步骤'}</span>
|
||||
</div>
|
||||
<div className="de-approval-action-fields">
|
||||
<input
|
||||
|
||||
Reference in New Issue
Block a user