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

export default {
    async page(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/page",
            method: "get",
            params: form,
        });
    },
    //详情
    async detail(id) {
        return HcApi({
            url: "/api/blade-manager/exceltab/detail",
            method: "get",
            params: { id },
        });
    },
    async submit(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/submit",
            method: "post",
            data: form,
        });
    },
    async del(ids) {
        return HcApi({
            url: "/api/blade-manager/exceltab/remove",
            method: "post",
            params: { ids },
        });
    },
    //清表树（懒加载）
    async tabLazyTree(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/tab-lazytree",
            method: "get",
            params: form,
        });
    },
    //清表树（全加载）
    async tabLazyTreeAll(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/tab-lazytree-all",
            method: "get",
            params: form,
        });
    },
    //获取清表详情
    async detailExcel(id) {
        return HcApi({
            url: "/api/blade-manager/exceltab/detail",
            method: "get",
            params: { id },
        });
    },
    //清表编辑 wbs 下拉框选择
    async getWbsTypeList(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/getWbsTypeList",
            method: "get",
            params: form,
        });
    },
    //懒加载节点树形结构
    async wbsTree(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/lazy-tree",
            method: "get",
            params: form,
        });
    },
    //wbs树获取表
    async selectByNodeTable(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/selectByNodeTable",
            method: "get",
            params: form,
        });
    },
    //添加编辑清表
    async savaDataInfo(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/sava-dataInfo",
            method: "post",
            data: form,
        });
    },
    //清表模板树节点排序
    async excTabSort(ids) {
        return HcApi({
            url: "/api/blade-manager/exceltab/tab-sort",
            method: "post",
            params: { ids },
        });
    },
    //批量上清表
    async batchUploadExcelTab(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/batchUploadExcelTab",
            method: "post",
            data: form,
        });
    },
    //批量上清表
    async uploadExcel(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/put-file-attach",
            method: "post",
            data: form,
        });
    },
    //删除excel文件
    async deleteExcel(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/update",
            method: "post",
            data: form,
        });
    },
    //删除excel文件
    async deleteExcelModel(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/delete-template",
            method: "post",
            data: form,
        });
    },
    //下载excel表
    async downExcelFile(fileId) {
        return HcApi({
            url: "/api/blade-manager/exceltab/down-Excel-file",
            method: "get",
            params: { fileId },
            responseType: "arraybuffer",
        });
    },
    //下载模板
    async downExcelFileModel(fileId) {
        return HcApi({
            url: "/api/blade-manager/exceltab/down-template-file",
            method: "get",
            params: { fileId },
            responseType: "arraybuffer",
        });
    },
    //元素识别获取列表信息
    async getExcelHtmlCol(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/get-excel-html-col",
            method: "get",
            params: form,
        });
    },
    //清表生成html
    async getExcelHtml(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/get-excel-html",
            method: "get",
            params: form,
        });
    },
    //获取字段信息
    async getColByTabId(form) {
        return HcApi({
            url: "/api/blade-manager/exctabcell/getColByTabId",
            method: "get",
            params: form,
        });
    },
    //保存字段信息
    async saveColByTabId(form) {
        return HcApi({
            url: "/api/blade-manager/exctabcell/update",
            method: "post",
            data: form,
        });
    },
    //删除字段信息
    async delColByTabId(ids) {
        return HcApi({
            url: "/api/blade-manager/exctabcell/remove",
            method: "post",
            params: { ids },
        });
    },
    //新增字段信息
    async addColByTabId(form) {
        return HcApi({
            url: "/api/blade-manager/exctabcell/save",
            method: "post",
            data: form,
        });
    },
    //添加到元素库
    async submitExcelElement(form) {
        return HcApi({
            url: "/api/blade-manager/wbsFormElement/submit-excel-relation-wbsTree-element",
            method: "post",
            data: form,
        });
    },
    async getLazyTree(form) {
        return HcApi({
            url: "/api/blade-manager/wbsTree/lazy-tree",
            method: "get",
            params: form,
        });
    },
    async getAllTree(form) {
        return HcApi({
            url: "/api/blade-manager/wbsTree/tree",
            method: "get",
            params: form,
        });
    },
    //获取清表信息
    async getNodeTable(form) {
        return HcApi({
            url: "/api/blade-manager/wbsTree/get-node-table",
            method: "get",
            params: form,
        });
    },
    //元素库获取表
    async getNodeTables(form) {
        return HcApi({
            url: "/api/blade-manager/wbsFormElement/get-node-tables",
            method: "get",
            params: form,
        });
    },
    //保存关联
    async saveRelation(form) {
        return HcApi({
            url: "/api/blade-manager/wbsFormElement/save-relation",
            method: "post",
            data: form,
        });
    },
    //关联
    async saveLinkTableInfo(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/save-link-tableInfo",
            method: "get",
            params: form,
        });
    },
    //取消关联
    async cancelRelation(form) {
        return HcApi({
            url: "/api/blade-manager/wbsFormElement/cancel-relation",
            method: "get",
            params: form,
        });
    },
    //分页获取清表
    async getList(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/list",
            method: "get",
            params: form,
        });
    },
    //关联清表保存
    async saveLinkTab(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/save-linkTab",
            method: "get",
            params: form,
        });
    },
    //获取excel字段信息
    async getElementInfoByTabId(form) {
        return HcApi({
            url: "/api/blade-manager/linkdatainfo/getElementInfoByTabId",
            method: "get",
            params: form,
        });
    },
    //提取未匹配的元素字段
    async getUnMatchField(form) {
        return HcApi({
            url: "/api/blade-manager/exceltab/getUnMatchField",
            method: "get",
            params: form,
        });
    },
    //删除元素
    async delExcelElement(form) {
        return HcApi({
            url: "/api/blade-manager/linkdatainfo/saveTabColInfo",
            method: "post",
            data: form,
        });
    },
    //保存匹配元素
    async saveTabColInfo(form) {
        return HcApi({
            url: "/api/blade-manager/linkdatainfo/saveTabColInfo2",
            method: "post",
            data: form,
        });
    },
    //添加新元素
    async submitBatch(form) {
        return HcApi({
            url: "/api/blade-manager/wbsFormElement/submit-batch",
            method: "post",
            data: form,
        });
    },
};
