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

23 lines
909 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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'};
}
}