feat(data-process): 完善后台生成与失败重试

This commit is contained in:
caoxiaozhu
2026-07-28 10:56:05 +08:00
parent 8a6a6574bb
commit 01d2e6c76a
178 changed files with 4472 additions and 595 deletions

View File

@@ -2,12 +2,18 @@
* 将数据处理任务的执行状态与当前轮发布指针合并为用户可理解的状态。
* 上一轮保留的 output_datasets 不参与判断,避免将尚未重新发布的当前轮误标为已发布。
*
* @param {{ status?: string, output_dataset_id?: string | number | null }} task
* @param {{ status?: string, preview_status?: string, output_dataset_id?: string | number | null, results_confirmed?: boolean }} task
* @returns {{ label: string, type: 'primary' | 'success' | 'warning' | 'danger' | 'info' }}
*/
export function dataProcessDisplayStatus(task) {
if (task.preview_status === 'running' || task.preview_status === 'queued') {
return { label: '切分中', type: 'primary' }
}
if (task.preview_status === 'failed') return { label: '切分失败', type: 'danger' }
if (task.preview_status === 'cancelled') return { label: '切分已取消', type: 'warning' }
if (task.status === 'running') return { label: '生成中', type: 'primary' }
if (task.status === 'completed') {
if (task.results_confirmed === false) return { label: '待确认', type: 'warning' }
return task.output_dataset_id
? { label: '已发布', type: 'success' }
: { label: '已生成', type: 'warning' }