import { getBusiness } from "@/views/kzyWMS/api/business";
import { intRuleModule } from "./int";

export let businessRuleModule = {
    methods: {
        execute(config, type) {
            return getBusiness().then(business => {
                if (business === 'int') {
                    intRuleModule.do(config, type);
                } else {
                    intRuleModule.undo(config, type);
                }
                return config;
            });
            // return config
        },
        isBusiness(b) {
            return getBusiness().then(business => {
                return business == b;
            });
        },
        getBusiness(b) {
            return getBusiness().then(business => {
                return business;
            });
        },
    }
}