23 lines
909 B
TypeScript
23 lines
909 B
TypeScript
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'};
|
||
}
|
||
}
|