refactor: 第一批低风险收敛——任务缓存服务泛型化 + 前端死代码清理与状态映射统一
This commit is contained in:
@@ -181,6 +181,7 @@ import {
|
||||
} from '@/shared/api/java-modules'
|
||||
import { getPollingProgressBatch } from '@/shared/api/task-progress-polling.ts'
|
||||
import { formatDateTime } from '@/shared/utils/datetime'
|
||||
import { taskStatusClass, taskStatusText } from '@/shared/utils/task-status-text'
|
||||
import { uploadPathsToJava } from '@/shared/utils/upload-to-java'
|
||||
import { runBatchDelete } from '@/shared/utils/batch-delete'
|
||||
import { confirmTaskDeletion } from '@/shared/task-delete-confirm'
|
||||
@@ -540,19 +541,17 @@ function normalizeTaskStatus(item: CollectDataHistoryItem) {
|
||||
|
||||
function statusText(item: CollectDataHistoryItem) {
|
||||
const status = normalizeTaskStatus(item)
|
||||
if (status === 'RUNNING') return '执行中'
|
||||
if (status === 'PENDING') return '等待中'
|
||||
if (status === 'SUCCESS' || item.success) return '已完成'
|
||||
if (status === 'FAILED') return '失败'
|
||||
return '等待中'
|
||||
if (status === 'RUNNING' || status === 'PENDING') return taskStatusText(status)
|
||||
if (status === 'SUCCESS' || item.success) return taskStatusText('SUCCESS')
|
||||
return status === 'FAILED' ? taskStatusText('FAILED') : '等待中'
|
||||
}
|
||||
|
||||
function statusClass(item: CollectDataHistoryItem) {
|
||||
const status = normalizeTaskStatus(item)
|
||||
if (status === 'RUNNING') return 'running'
|
||||
if (status === 'FAILED') return 'failed'
|
||||
if (status === 'SUCCESS' || item.success) return 'success'
|
||||
return 'pending'
|
||||
if (status === 'RUNNING' || status === 'FAILED') return taskStatusClass(status)
|
||||
if (status === 'SUCCESS' || item.success) return taskStatusClass('SUCCESS')
|
||||
// 其余(含 PENDING/CANCELLED)保持 'pending'
|
||||
return taskStatusClass(status, { classMap: { CANCELLED: 'pending' } })
|
||||
}
|
||||
|
||||
function taskFilterSummary(item: CollectDataHistoryItem) {
|
||||
|
||||
Reference in New Issue
Block a user