import createAxios from '@/utils/request'

//根据Id获取台账信息
export function getInfoById(id: any) {
    let form = new FormData()
    form.append('id', id)
    return createAxios({
        url: '/cs-device-boot/icd/getLedgerById',
        method: 'POST',
        data: form
    })
}

//工程查询通过id获取
export function getEngineerById(id: any) {
    let form = new FormData()
    form.append('id', id)
    return createAxios({
        url: '/cs-device-boot/engineering/queryEngineeringById',
        method: 'POST',
        data: form
    })
}

//项目查询通过id获取
export function getProjectById(id: any) {
    let form = new FormData()
    form.append('ids', id)
    return createAxios({
        url: '/cs-device-boot/project/queryProjectById',
        method: 'POST',
        data: form
    })
}

//设备查询通过id获取
export function getEquipmentById(id: any) {
    let form = new FormData()
    form.append('ids', id)
    return createAxios({
        url: '/cs-device-boot/EquipmentDelivery/queryEquipmentById',
        method: 'POST',
        data: form
    })
}

//根据监测点id获取监测点详情
export function getById(id: any) {
    let form = new FormData()
    form.append('lineId', id)
    return createAxios({
        url: '/cs-device-boot/csline/getById',
        method: 'POST',
        data: form
    })
}

//获取前置机
export function nodeAllList() {
    return createAxios({
        url: '/cs-device-boot/node/nodeAllList',
        method: 'get'
    })
}

//新增台账信息
export function addLedger(data: any) {
    return createAxios({
        url: '/cs-device-boot/icd/addLedgerInfo',
        method: 'post',
        data: data
    })
}

//修改-删除项目
export function deleteProject(id: any, name: any, area: any, description: any, status: any, sort: any, topoIds: any) {
    let form = new FormData()
    form.append('id', id)
    form.append('name', name)
    form.append('area', area)
    form.append('description', description)
    form.append('status', status)
    form.append('sort', sort)
    form.append('topoIds', topoIds)
    return createAxios({
        url: '/cs-device-boot/project/auditAppProject',
        method: 'post',
        data: form
    })
}

//删除设备
export function deleteEquipment(id: any) {
    let form = new FormData()
    form.append('id', id)
    return createAxios({
        url: '/cs-device-boot/EquipmentDelivery/delCldDev',
        method: 'POST',
        data: form
    })
}

//删除监测点
export const deleteLine = (id: any) => {
    let form = new FormData()
    form.append('id', id)
    return createAxios({
        url: '/cs-device-boot/csline/delCldLine',
        method: 'POST',
        data: form
    })
}

//修改设备
export function updateEquipment(data: any) {
    return createAxios({
        url: '/cs-device-boot/EquipmentDelivery/updateCldDev',
        method: 'post',
        data: data
    })
}

//修改监测点
export function updateLine(data: any) {
    return createAxios({
        url: '/cs-device-boot/csline/updateCldLine',
        method: 'post',
        data: data
    })
}

//推送日志台账信息
export function pushLog() {
    return createAxios({
        url: '/cs-device-boot/csTerminalLogs/pushCldInfo',
        method: 'post'
    })
}

//查询推送结果
export function queryPushResult() {
    return createAxios({
        url: '/cs-device-boot/csTerminalReply/queryData',
        method: 'post'
    })
}
//查询升级日志
export function getByDevId(data: any) {
    return createAxios({
        url: '/cs-device-boot/csUpgradeLogs/getByDevId',
        method: 'get',
        params:data
    })
}
