import request from '@/router/axios';

export const getList = (current, size, params) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const getTree = () => {
    return request({
        url: '/api/galaxy-business/rtu/manage/tree',
        method: 'get',
    })
}

export const remove = (ids) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/remove',
        method: 'post',
        params: {
            ids,
        }
    })
}

export const add = (row) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/save',
        method: 'post',
        data: row
    })
}

export const update = (row) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/update',
        method: 'post',
        data: row
    })
}

export const getDetail = (id) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const equipmentExport = (adCode, adName) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/equipmentlist/export',
        method: 'get',
        params: {
            adCode,
            adName
        }
    })
}

export const getCountInfo = (adCode) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/count',
        method: 'get',
        params: {
            adCode
        }
    })
}

export const getRtuReplaceList = (params) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/rtu/replace/list',
        method: 'get',
        params: {
            ...params,
        }
    })
}

export const getRainSensorReplaceList = (params) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/rainsensor/replace/list',
        method: 'get',
        params: {
            ...params,
        }
    })
}

export const getWaterSensorReplaceList = (params) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/watersensor/replace/list',
        method: 'get',
        params: {
            ...params,
        }
    })
}

export const getGroundSensorReplaceList = (params) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/groundsensor/replace/list',
        method: 'get',
        params: {
            ...params,
        }
    })
}

export const getBatteryReplaceList = (params) => {
    return request({
        url: '/api/galaxy-business/rtu/manage/battery/replace/list',
        method: 'get',
        params: {
            ...params,
        }
    })
}





