feat(fulfillment): 支持共享账号操作并完善时间线

This commit is contained in:
yml
2026-11-18 22:32:45 +08:00
parent 86b586b96d
commit ddead2284d
23 changed files with 538 additions and 15 deletions
@@ -97,6 +97,10 @@ const EVENT_LABELS: Record<string, string> = {
manual_exchange_completed: '人工兑换完成',
marked_manual_required: '转人工处理',
released_to_manual: '释放账号并转人工',
douyu_operation_started: '斗鱼操作已提交',
douyu_operation_succeeded: '斗鱼操作成功',
douyu_operation_failed: '斗鱼操作失败',
douyu_operation_stopped: '斗鱼操作已停止',
task_cancelled: '任务已取消',
task_restored: '恢复已取消任务',
};
@@ -187,7 +191,17 @@ function eventLabel(value: string) {
function eventColor(value: string) {
if (value.includes('failed') || value.includes('cancelled')) return 'red';
if (value.includes('manual_required') || value.includes('released_to_manual')) return 'orange';
if (value.includes('completed') || value.includes('allocated') || value.includes('restored')) return 'green';
if (
value.includes('completed') ||
value.includes('allocated') ||
value.includes('restored') ||
value.includes('succeeded')
) {
return 'green';
}
if (value.includes('douyu_operation_failed') || value.includes('douyu_operation_stopped')) {
return value.includes('stopped') ? 'orange' : 'red';
}
return 'blue';
}
@@ -236,6 +250,16 @@ function eventDescription(event: { eventType: string; detail: Record<string, unk
const status = String(detail.restoredExecutionStatus || '');
return `恢复原因:${String(detail.reason || '误取消恢复')};恢复后状态:${statusLabel(status)}`;
}
if (event.eventType === 'douyu_operation_started') {
return `${String(detail.taskLabel || detail.taskType || '斗鱼操作')};批次 ${String(detail.batchId || '-')}`;
}
if (
event.eventType === 'douyu_operation_succeeded' ||
event.eventType === 'douyu_operation_failed' ||
event.eventType === 'douyu_operation_stopped'
) {
return `${String(detail.taskLabel || detail.taskType || '斗鱼操作')}:${String(detail.message || detail.status || '-')}`;
}
if (event.eventType === 'binding_started') return '已生成客户绑定二维码';
if (event.eventType === 'binding_confirm_started') return '已提交游戏角色绑定确认';
if (event.eventType === 'binding_failed') {
@@ -595,6 +619,7 @@ export default function PlatformFulfillmentPage() {
handbook_scope: 'elite',
concurrency: 1,
payload,
platform_task_id: selected.id,
});
setDouyuActionType(taskType);
setDouyuActionBatchId(result.batch_id);