import { HcApi } from "../../request/index";

export default {
    async updateBatchElements(list, initTableName) {
        return HcApi({
            url:
                "/api/blade-manager/wbsTree/update-batch-elements?initTableName=" +
                initTableName,
            method: "post",
            data: list,
        });
    },
    async saveFormAndElement(form) {
        return HcApi({
            url: "/api/blade-manager/wbsTree/save-table-element",
            method: "post",
            data: form,
        });
    },
    async getExportTem(form) {
        return HcApi({
            url: "/api/blade-manager/wbsFormElement/export-template",
            method: "get",
            params: form,
        });
    },
    async upateBatchNodeTableInfo(form) {
        return HcApi({
            url: "/api/blade-manager/wbsTree/update-batch-node-tableInfo",
            method: "post",
            data: form,
        });
    },
    async submitTableSort(form) {
        return HcApi({
            url: "/api/blade-manager/wbsFormElement/submit-table-sort",
            method: "post",
            data: form,
        });
    },
    async getTableElements(form) {
        return HcApi({
            url: "/api/blade-manager/wbsTree/get-table-elements",
            method: "get",
            params: form,
        });
    },
    async updateBatchElements(list, initTableName) {
        return HcApi({
            url:
                "/api/blade-manager/wbsTree/update-batch-elements?initTableName=" +
                initTableName,
            method: "post",
            data: list,
        });
    },
    //保存新元素
    async saveElement(form) {
        return HcApi({
            url: "/api/blade-manager/wbsFormElement/save",
            method: "post",
            data: form,
        });
    },
    //删除元素
    async removeElement(form) {
        return HcApi({
            url: "/api/blade-manager/wbsFormElement/remove",
            method: "post",
            params: form,
        });
    },
    //删除表
    async removeTable(form) {
        return HcApi({
            url: "/api/blade-manager/wbsTree/remove-table",
            method: "get",
            params: form,
        });
    },
};
