import type {INumberValueTagStyle} from "@/interface/app/ITagStyle.ts";

export default class ConveyTaskStatusFormatter {

    taskStatus: INumberValueTagStyle[] = [
        {value: 0, label: '新创建', type: 'info'},
        {value: 1, label: '已打印', type: 'warning'},
        {value: 2, label: '输送中', type: 'primary'},
        {value: 3, label: '已到达', type: 'success'},
        {value: 4, label: '任务异常', type: 'danger'},
        {value: 5, label: '任务超时', type: 'danger'},
        {value: 6, label: '任务取消', type: 'danger'},
    ];

    conveyTaskStatusFormatter(value: any): INumberValueTagStyle {
        const findResult = this.taskStatus.find(f => f.value == value);
        if (findResult) {
            return findResult;
        }
        return {value: value.toString(), label: '？' + value.toString(), type: 'danger'};
    }
}