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

export default {
    async page(form) {
        return HcApi({
            url: '/api/blade-meter/tree/template/page',
            method: 'post',
            data: form,
        })
    },
    async submit(form) {
        return HcApi({
            url: '/api/blade-meter/tree/template/submit',
            method: 'post',
            data: form,
        })
    },
    async del(ids) {
        return HcApi({
            url: '/api/blade-meter/tree/template/remove',
            method: 'get',
            params: { ids },
        })
    },
    //系统树节点懒加载
    async getLazyTree(form) {
        return HcApi({
            url: '/api/blade-meter/tree/system/lazy',
            method: 'get',
            params: form,
        })
    },
    //新增节点
    async add(form) {
        return HcApi({
            url: '/api/blade-meter/tree/system/save',
            method: 'post',
            data: form,
        })
    },
    //修改节点
    async update(form) {
        return HcApi({
            url: '/api/blade-meter/tree/system/update',
            method: 'post',
            data: form,
        })
    },
    //删除节点
    async remove(id) {
        return HcApi({
            url: '/api/blade-meter/tree/system/remove',
            method: 'get',
            params: { id },
        })
    },
    async detail(id) {
        return HcApi({
            url: '/api/blade-meter/tree/system/detail',
            method: 'get',
            params: { id },
        })
    },
    async getChildList(form) {
        return HcApi({
            url: '/api/blade-meter/tree/system/child-list',
            method: 'get',
            params: form,
        })
    },
    async getSameList(form) {
        return HcApi({
            url: '/api/blade-meter/tree/system/same-list',
            method: 'get',
            params: form,
        })
    },
    async sortNode(form) {
        return HcApi({
            url: '/api/blade-meter/tree/system/sort',
            method: 'post',
            params: form,
        })
    },
    async getEngineeringTypeName(form) {
        return HcApi({
            url: '/api/blade-meter/tree/system/getEngineeringTypeName',
            method: 'get',
            params: form,
        })
    },
    async getNodeTypeList(form) {
        return HcApi({
            url: '/api/blade-meter/tree/getNodeTypeList',
            method: 'get',
            params: form,
        })
    },
}
