feat(client): persist digital governance events
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user