feat(client): persist digital governance events

This commit is contained in:
baiyanyun
2026-06-07 18:59:59 +08:00
parent 5e76828afe
commit e37024bdbe
14 changed files with 925 additions and 158 deletions

View File

@@ -86,6 +86,7 @@ interface ManagementSyncFailure {
id: string;
entityType: string;
entityId: string;
entitySummary?: ManagementSyncEntitySummary | null;
operation: string;
attempts: number;
lastAttemptAt: string | null;
@@ -98,6 +99,12 @@ interface ManagementSyncFailure {
updatedAt: string;
}
interface ManagementSyncEntitySummary {
title?: string | null;
status?: string | null;
summary?: string | null;
}
// 技术侧 PlanTemplate 是任务模板来源;用户侧只展示为“任务”,运行时 Task/PlanStep 展示为“步骤”。
interface EmployeeVisualStateOption {
@@ -523,7 +530,9 @@ function failureGroupSummary(summary: ManagementSyncFailureSummary): string {
function syncFailureSummary(failure: ManagementSyncFailure): string {
const error = summarizeSyncError(failure.error);
const title = compactText(failure.entitySummary?.title);
return [
title,
`${entityTypeLabel(failure.entityType)} / ${failure.operation}`,
`重试 ${failure.attempts}`,
failure.dueForRetry ? '等待补偿' : `下次 ${syncFailureRetryTime(failure)}`,
@@ -2009,6 +2018,12 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit
<div className="de-event-detail-grid">
<div><span>Outbox</span><strong>{selectedSyncFailure.id}</strong></div>
<div><span></span><strong>{selectedSyncFailure.entityId}</strong></div>
{selectedSyncFailure.entitySummary?.title && (
<div><span></span><strong>{selectedSyncFailure.entitySummary.title}</strong></div>
)}
{selectedSyncFailure.entitySummary?.status && (
<div><span></span><strong>{selectedSyncFailure.entitySummary.status}</strong></div>
)}
<div><span></span><strong>{entityTypeLabel(selectedSyncFailure.entityType)}</strong></div>
<div><span></span><strong>{selectedSyncFailure.operation}</strong></div>
<div><span></span><strong>{selectedSyncFailure.attempts} </strong></div>
@@ -2020,6 +2035,12 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit
<span></span>
<p>{selectedSyncFailure.error || '暂无错误详情。'}</p>
</div>
{selectedSyncFailure.entitySummary?.summary && (
<div className="de-event-detail-result">
<span></span>
<p>{selectedSyncFailure.entitySummary.summary}</p>
</div>
)}
{(selectedSyncFailure.attemptHistory?.length ?? 0) > 0 && (
<div className="de-sync-attempt-history">
<span></span>