import createAxios from '@/utils/request'

import { SUPERVISION_BOOT } from '@/utils/constantRequest'

const MAPPING_PATH = SUPERVISION_BOOT + '/deVReport'

/**
 * 提交终端信息表单数据
 */
export const addTerminalFormData = (data: any) => {
    return createAxios({
        url: '/supervision-boot/deVReport/add',
        method: 'POST',
        data: data
    })
}

/**
 * 编辑终端信息表单数据(重新发起)
 */
export const updateTerminalFormData = (data: any) => {
    return createAxios({
        url: '/supervision-boot/deVReport/update',
        method: 'POST',
        data: data
    })
}

/**
 * 编辑终端信息表单数据(重新发起)
 */
export const cancelTerminalFormData = (data: any) => {
    return createAxios({
        url: '/supervision-boot/deVReport/cancel',
        method: 'POST',
        data: data
    })
}

/**
 * 获取关联终端列表
 */
export const getDeviceList = () => {
    return createAxios({
        url: '/supervision-boot/deVReport/getDeviceList',
        method: 'POST',
    })
}



/**
 * 获取电站和电压等级
 */
export const getSubstationVoltageLevel = (obj:any) => {
    return createAxios({
        url: '/device-boot/commTerminal/tagOrIdGetSub',
        method: 'POST',
        data:obj
    })
}


/**
 * 根据id获取终端录入的详细数据
 */
export const getTerminalDetailsById = (obj: any) => {
    let form = new FormData()
    form.append('id', obj.id)
    return createAxios({
        url:MAPPING_PATH + '/queryDeviceDetail',
        method: 'POST',
        data:form
    })
}

