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

//  项目计量单元
export default {
    //懒加载系统树
    async lazyTree(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/project/lazy',
            method: 'get',
            params: form,
        }, msg)
    },
    //获取默认项目
    async refresh(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/project/refresh',
            method: 'get',
            params: form,
        }, msg)
    },
      //获取节点详情
      async getNodeDetail(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/project/detail',
            method: 'get',
            params: form,
        }, msg)
    },
    //修改节点
   async updateForm(form, msg = true) {
    return HcApi({
        url: '/api/blade-meter/tree/project/update',
        method: 'post',
        data: form,
    }, msg)
   },
    //新增节点
    async addNode(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/project/save',
            method: 'post',
            data: form,
        }, msg)
    },
    //删除节点
       async deleteNode(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/project/remove',
            method: 'get',
            params: form,
        }, msg)
    },
    //调整排序
    async sortForm(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/project/sort',
            method: 'post',
            params: form,
        }, msg)
    },

    //项目树节点项目树节点新增获取工程类型名称
    async getEngineeringTypeName(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/project/getEngineeringTypeName',
            method: 'get',
            params: form,
        }, msg)
    },
    //系统、项目、合同段获取节点类型列表接口：
    async getNodeTypeList(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/getNodeTypeList',
            method: 'get',
            params: form,
        }, msg)
    },
}