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

/**
 * 电子标签小标签的业务类型
 */
export default class EtagTagBusinessTypeFormatter {

    tagBusinessType: INumberValueTagStyle[] = [
        {
            value: 0,
            type: 'info',
            label: '普通'
        },
        {
            value: 1,
            type: 'warning',
            label: '区域标签'
        },
        {
            value: 2,
            type: 'success',
            label: '巷道灯'
        }
    ];

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

}