//@ts-ignore
import ltRest from "lt-request";

const LtRest = new ltRest({
    service: "FormularService",
});

const LtRestEX = new ltRest({
    service: "InterpretateService",
});
export default {
    LoadBaseParam: function () {
        //获取配方基础配置信息5个参数
        //@ts-ignore
        const promise = LtRest.get("LoadFormularParam");
        return promise;
    },
    LoadFunction: function () {
        //加载生产工艺
        //@ts-ignore
        const promise = LtRestEX.get("QueryFunction");
        return promise;
    },
    LoadFomurlaPhase: function (data:any) {
        //加载配方投料位置
        //@ts-ignore
        const promise = LtRestEX.get("QueryFomurlaPhase");
        return promise;
    },
    LoadExtraFunction: function (data:any) {
        //配方工艺要求
        //@ts-ignore
        const promise = LtRestEX.get("QueryExtraFunction");
        return promise;
    },
    LoadProductCategory: function () {
        const LtRestEX1 = new ltRest({
            service: "InterpretateMaterialService",
        });
        //@ts-ignore
        const promise = LtRestEX1.get("QueryProductCategory");
        return promise;
    },
    LoadMaterialCategory: function () {
        const LtRestEX1 = new ltRest({
            service: "InterpretateMaterialService",
        });
        //@ts-ignore
        const promise = LtRestEX1.get("QueryMaterialCategory");
        return promise;
    },
    LoadFormularColor: function () {
        //@ts-ignore
        return LtRest.get("LoadFormularColor"); //加载配方颜色
    },
    SaveFormularColor: function (data:any) {
        //@ts-ignore
        return LtRest.post("SaveFormularColor", data); //保存配方颜色
    },
    LoadSystemType: function () {
        const LtRestEX1 = new ltRest({
            service: "WorkPlanService",
        });
        //@ts-ignore
        const promise = LtRestEX1.get("CheckSystemType");
        return promise;
    },
    LoadEditWorkFlowFunction() {
        //获取工艺流程图编辑属性
        //@ts-ignore
        const promise = LtRestEX.get("QueryEditFlowFunction?value=false");
        return promise;
    },
    loadAllDevice: function () {
        //获取所有产线设备
        const LtRestEXIS = new ltRest({
            service: "InterpretateService",
        });
        //@ts-ignore
        const promise = LtRestEXIS.get("QueryAllPlanDevice");
        return promise;
    },
    getProdLine: function () {
        //加载有权限产线   2022-2-16更改
        const LtRestEXWP = new ltRest({
            service: "WorkPlanService",
        });
        const sendData = {}
        //@ts-ignore
        const promise = LtRestEXWP.post("LoadProdlineOfUser", sendData);
        return promise;
    },
    getProdLineGroup: function () {
        //获取产线组
        const LtRestGROUP = new ltRest({
            service: "WorkPlanService",
        });
        //@ts-ignore
        const promise = LtRestGROUP.get("LoadProdLineGroups");
        return promise;
    },
    getSFColor: function () {
        //@ts-ignore
        return LtRest.get("LoadSFCColor"); //加载并行配方颜色
    },
    LoadQCCalItems: function () {
        const LtRestEXQC = new ltRest({
            service: "QCSystemService",
        });
        //@ts-ignore
        const promise = LtRestEXQC.get("LoadQCCalItems");
        return promise;
    },
    LoadQCSelectedVariables: function () {
        const LtRestEXQC = new ltRest({
            service: "QCSystemService",
        });
        //@ts-ignore
        const promise = LtRestEXQC.post("LoadQCSelectedVariables", {
            PageSize: 0,
            Page: 0,
            Conditions: [],
        });
        return promise;
    },
    getMaxRow: function () {
        const LtRestParentRow = new ltRest({
            service: "InterpretateService",
        });
        //@ts-ignore
        const promise = LtRestParentRow.get("QueryFunctionparamDisplayMaxRow");
        return promise;
    },
    loadScriptVar: function () {
        const sendData = {
            Value: "",
        };
        //@ts-ignore
        const promise = LtRest.post("QueryScriptVariant", sendData);
        return promise;
    },
    LoadBaseQCParama() {
        const LtRestEXQC = new ltRest({
            service: "QCSystemService",
        });
        //@ts-ignore
        const promise = LtRestEXQC.post("LoadQCParam", {});
        return promise;
    },
    getErrorFiled() {
        //@ts-ignore
        const promise = LtRest.get("QueryErrorField");
        return promise;
    },
    getErrorDefaultVal() {
        const LtRestWorkPlan = new ltRest({
            service: "WorkPlanService",
        });
        //@ts-ignore
        const promise = LtRestWorkPlan.get("LoadWorkPlanParam");
        return promise;
    },
    getWorkSub() {
        const data = {
            PageSize: 0,
            Page: 0,
            Conditions: [],
        };
        //@ts-ignore
        const promise = LtRest.post("LoadWorkSubs", data);
        return promise;
    },
};