refactor: 第一批低风险收敛——任务缓存服务泛型化 + 前端死代码清理与状态映射统一
This commit is contained in:
@@ -289,6 +289,7 @@ import {
|
||||
sanitizeCountryCodes,
|
||||
} from "@/shared/country-options";
|
||||
import { formatDateTime } from '@/shared/utils/datetime'
|
||||
import { RUNNING_UNTIL_DONE_STATUS_OPTIONS, taskStatusClass, taskStatusText } from '@/shared/utils/task-status-text'
|
||||
import { useHistoryPolling } from '@/shared/composables/useHistoryPolling'
|
||||
import { runBatchDelete } from '@/shared/utils/batch-delete'
|
||||
import { isRecordMissingError } from '@/shared/utils/task-queue-state.ts'
|
||||
@@ -645,17 +646,11 @@ function isTaskTerminal(status?: string) {
|
||||
}
|
||||
|
||||
function statusText(status?: string) {
|
||||
if (status === "SUCCESS" || status === "COMPLETED") return "已完成";
|
||||
if (status === "FAILED") return "失败";
|
||||
return "执行中";
|
||||
return taskStatusText(status, RUNNING_UNTIL_DONE_STATUS_OPTIONS);
|
||||
}
|
||||
|
||||
function statusClass(status?: string) {
|
||||
return status === "SUCCESS" || status === "COMPLETED"
|
||||
? "success"
|
||||
: status === "FAILED"
|
||||
? "failed"
|
||||
: "running";
|
||||
return taskStatusClass(status, RUNNING_UNTIL_DONE_STATUS_OPTIONS);
|
||||
}
|
||||
|
||||
function canDownload(item: PatrolDeleteHistoryItem) {
|
||||
|
||||
Reference in New Issue
Block a user