import { useMsg } from "@/hooks/useMsg";
const WARN: any = {
    name: "产品名称不能为空 !",
    model: "型号不能为空 !",
    type: "产品分类不能为空 !",
    sort: "产品排序不能为空 !"
};
const warnFunction = (data: any) => {
    if (!data.name) {
        useMsg("warning", WARN["name"]);
        return false;
    }
    if (!data.model) {
        useMsg("warning", WARN["model"]);
        return false;
    }
    if (!data.type) {
        useMsg("warning", WARN["type"]);
        return false;
    }
    if (!data.name) {
        useMsg("warning", WARN["sort"]);
        return false;
    }
    return true;
};
export const handleSubmit = async (infoRef: any) => {
    console.log(infoRef.ruleForm, "============ruleForm===========");

    let is = await warnFunction(infoRef.ruleForm);
    if (!is) {
        return false;
    }
};
