import request from '@/utils/request'

// 获取网关设备监测点树
export function getEnergyTree() {
    return request({
        url: '/energy-boot/logic/getEnergyTree',
        method: 'get'
    })

}


// 获取设备详情
export function getEnergyDevInfoById(id) {
    return request({
        url: '/energy-boot/logic/getEnergyDevInfoById',
        method: 'get',
        params: { id: id }
    })
}


// 获取设备模板
export function getTabTemplateById(id) {
    return request({
        url: '/energy-boot/logic/getTabTemplateById',
        method: 'get',
        params: { id: id }
    })
}


// 获取设备数据详情
export function getDevDetailInfoById(id, pageNum, pageSize) {
    return request({
        url: '/energy-boot/logic/getEnergyTemplateById',
        method: 'get',
        params: { id: id, pageNum: pageNum, pageSize: pageSize }
    })
}




export function getHistoryTemplateById(data) {
    return request({
        url: '/energy-boot/logic/getHistoryTemplateById',
        method: 'post',
        data: data
    })




}

export function getStatisTemplateById(id, pageNum, pageSize, lineId) {
    return request({
        url: '/energy-boot/logic/getStatisTemplateById',
        method: 'get',
        params: { id: id, pageNum: pageNum, pageSize: pageSize, lineId: lineId }
    })

}



export function getRealGroupTemplateById(id, pageNum, pageSize) {
    return request({
        url: '/energy-boot/logic/getRealGroupTemplateById',
        method: 'get',
        params: { id: id, pageNum: pageNum, pageSize: pageSize }
    })
}


export function getGroupDetailList(id) {
    return request({
        url: '/energy-boot/logic/getGroupDetailList',
        method: 'get',
        params: { id: id }
    })
}


export function addGroupArr(data) {
    return request({
        url: '/energy-boot/logic/addGroupArr',
        method: 'post',
        data: data
    })
}

export function getParseTemplate(id) {
    return request({
        url: '/energy-boot/logic/getParseTemplate',
        method: 'get',
        params: { setId: id }
    })
}


//获取一个组里面的趋势数据
export function getHisData(data) {
    return request({
        url: '/energy-boot/logic/getHisData',
        method: 'post',
        data: data
    })
}