import createAxios from '@/utils/request'

// 查询分组
export function getGroup(dataSet: string) {
    let form = new FormData()
    form.append('dataSet', dataSet)
    return createAxios({
        url: '/cs-device-boot/csGroup/getGroup',
        method: 'POST',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        data: form
    })
}

// 设备分组实时数据
export function deviceHisData(data: any) {
    return createAxios({
        url: '/cs-device-boot/csGroup/deviceHistoryData',
        method: 'POST',
        data: Object.assign(
            {
                endTime: '',
                id: '',
                lineId: '',
                pageNum: 1,
                pageSize: 20,
                startTime: ''
            },
            data
        )
    })
}

// 设备分组历史数据
export function deviceRtData(data: any) {
    let form = new FormData()
    form.append('id', data.id)
    form.append('lineId', data.lineId)
    form.append('pageNum', data.pageNum)
    form.append('pageSize', data.pageSize)
    form.append('searchValue', data.searchValue)
    form.append('dataLevel', data.dataLevel)
    return createAxios({
        url: '/cs-device-boot/csGroup/deviceRtData',
        method: 'POST',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        data: form
    })
}
// 设备分组历史数据
export function realTimeData(data: any) {
    let form = new FormData()
    form.append('id', data.id)
    form.append('lineId', data.lineId)
    form.append('pageNum', data.pageNum)
    form.append('pageSize', data.pageSize)
    form.append('searchValue', data.searchValue)
    form.append('targetType', data.targetType)
    form.append('dataLevel', data.dataLevel)
    return createAxios({
        url: '/cs-harmonic-boot/data/realTimeData',
        method: 'POST',

        data
    })
}
// 设备监控-》测试项数据
export function getTestData(data: any) {
    return createAxios({
        url: '/cs-harmonic-boot/data/getTestData',
        method: 'POST',
        data
    })
}
// 设备监控-删除设备测试项
export function deleteItem(data: any) {
    return createAxios({
        url: '/cs-device-boot/wlRecord/deleteItem',
        method: 'POST',
        params: data
    })
}
