import { HcApi } from '../../../../request/index'

//  合同计量单元
export default {
    //懒加载系统树
    async lazyTree(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/lazy',
            method: 'get',
            params: form,
        })
    },
    //合同段树初始化（新增、增量同步）
    async refresh(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/refresh',
            method: 'get',
            params: form,
        })
    },
      //获取节点详情
      async getNodeDetail(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/detail',
            method: 'get',
            params: form,
        })
    },
    //修改节点
   async updateForm(form) {
    return HcApi({
        url: '/api/blade-meter/tree/contract/update',
        method: 'post',
        data: form,
    })
   },
    //新增节点
    async addNode(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/save',
            method: 'post',
            data: form,
        })
    },
    //删除节点
       async deleteNode(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/remove',
            method: 'get',
            params: form,
        })
    },
    //调整排序
    async sortForm(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/sort',
            method: 'post',
            params: form,
        })
    },
      //合同段树节点锁定-解锁
      async getLock(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/lock',
            method: 'get',
            params: form,
        })
    },
    //合同段-新增-增补单元-左边节点列表
    async getLeftList(form) {
    return HcApi({
            url: '/api/blade-meter/tree/contract/left-list',
            method: 'get',
            params: form,
        })
    },
    //系统、项目、合同段获取节点类型列表接口：
    async getNodeTypeList(form) {
        return HcApi({
            url: '/api/blade-meter/tree/getNodeTypeList',
            method: 'get',
            params: form,
        })
    },
       //合同段修改时获取下级节点类型列表接口：
    async getNodeTypeListUpdate(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/update/getNodeTypeList',
            method: 'get',
            params: form,
        })
    },
    async removeInfo(form) {
        return HcApi({
            url: '/api/blade-meter/inventoryFormMeter/removeInfo',
            method: 'post',
            params: form,
        })
    },
    //获取当前节点下，当期未被计量的所有清单
    async getCurrentNodeAllForm(form) {
        return HcApi({
            url: '/api/blade-meter/middleMeterApply/getWbsNodeInfo',
            method: 'post',
            data: form,
        })
    },
    //获取计量和WBS全加载树
    async getMeterTreeAndWbsTree(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/meterTreeAndWbsTree',
            method: 'get',
            params: form,
        })
    },
    //获取当前节点下，当期未被计量的所有清单
    async LinkMeterTreeAndWbsTree(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/LinkMeterTreeAndWbsTree',
            method: 'post',
            data: form,
        })
    },
    //删除合同计量单元关联WBS节点
    async deleteLinkWbsTree(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/deleteLinkWbsTree',
            method: 'post',
            data: form,
        })
    },
    //获取合同计量单元导入模板
    async importTemplate(form) {
        return HcApi({
                url: '/api/blade-meter/tree/contract/importTemplate',
                method: 'get',
                params: form,
            })
    },
    //复制节点，获取子树
    async getCurrentNodeTree(form) {
        return HcApi({
                url: '/api/blade-meter/tree/contract/getCurrentNodeTree',
                method: 'get',
                params: form,
            })
    },
    //删除合同计量单元关联WBS节点
    async copyNode(form) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/copyNode',
            method: 'post',
            data: form,
        })
    },
}
