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

export default class StackerLocationStatusFormatter {

    forbiddenCode: number = 9;
    emptyCode: number = 0;

    stackerLocationStatusTagStyle : INumberValueTagStyle[] = [
        {
            value: this.emptyCode,
            type: "success",
            label: "空闲",
        },
        {
            value: 1,
            type: "primary",
            label: "入库中",
        },
        {
            value: 2,
            type: "info",
            label: "出库中",
        },
        {
            value: 3,
            type: "warning",
            label: "占用",
        },
        {
            value: this.forbiddenCode,
            type: "danger",
            label: "禁用",
        },
    ];



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


}