wcs_java/wcs_web/src/plugin/formatter/StockComposeTaskStatusFormatter.ts

23 lines
909 B
TypeScript
Raw Normal View History

2026-01-22 11:07:07 +08:00
import type {INumberValueTagStyle} from "@/interface/app/ITagStyle.ts";
export default class StockComposeTaskStatusFormatter {
taskStatusTagStyle: INumberValueTagStyle[] = [
{value: 0, label: '待执行', type: 'info'},
{value: 1, label: '排队中', type: 'info'},
{value: 2, label: '执行中', type: 'primary'},
{value: 3, label: '任务完成', type: 'success'},
{value: 4, label: '任务取消', type: 'danger'},
{value: 5, label: '任务异常', type: 'danger'},
{value: 6, label: '任务超时', type: 'warning'},
];
stockComposeTaskStatusFormatter(value: any): INumberValueTagStyle {
const findResult = this.taskStatusTagStyle.find(f => f.value == value);
if (findResult) {
return findResult;
}
return {value: value.toString(), label: '' + value.toString(), type: 'danger'};
}
}