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

/**
 * 电子标签任务状态表
 */
export default class EtagTaskStatusFormatter {

    etagTaskStatus: INumberValueTagStyle[] = [
        {value: 0, label: '待激活', type: 'info'},
        {value: 1, label: '待点亮', type: 'primary'},
        {value: 2, label: '点亮中', type: 'success'},
        {value: 3, label: '已确认', type: 'warning'},
        {value: 4, label: '异常', type: 'danger'},
    ];

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