import { useAuthStore } from "@/stores/modules/auth";

import Add from "../components/Add.vue";
import Generate from "../components/Generate.vue";
import Print from "../components/Print.vue";
import Switch from "../components/Switch.vue";
import numberCode from "../components/numberCode.vue";
const authStore = useAuthStore();
// 路由跳转映射表
export const OPENS: Record<string, string> = {
    mateList: "/material/list/details"
};

export const BTNS_ROUTE = () => {
    const SHOW_BTBS: any = authStore.btnsAuthList;
    const btnsCom: any = {
        boxMarkDetails: []
    };

    for (let key in SHOW_BTBS) {
        let length = SHOW_BTBS[key].length;
        if (SHOW_BTBS[key] && SHOW_BTBS[key].length > 0) {
            for (let i = 0; i < length; i++) {
                if (SHOW_BTBS[key][i] === "boxMarkDetailsAdd") {
                    btnsCom[key].push(Add);
                }
                if (SHOW_BTBS[key][i] === "boxMarkDetailsGenerate") {
                    btnsCom[key].push(Generate);
                }
                if (SHOW_BTBS[key][i] === "boxMarkDetailsPrint") {
                    btnsCom[key].push(Print);
                }
                if (SHOW_BTBS[key][i] === "boxMarkDetailsSwitch") {
                    btnsCom[key].push(Switch);
                }

                if (SHOW_BTBS[key][i] === "boxMarkDetailsNumberCode") {
                    btnsCom[key].push(numberCode);
                }
            }
        }
    }
    return btnsCom;
};
