import request from '@/utils/request'
//big/getScreen

// 查询部门列表
export function getDeviceList(query) {
    return request({
        url: 'screen/manage/selectDeviceByParam',
        method: 'get',
        params: query
    })
}
// 修改部门
export function updateDevice(query) {
    return request({
        url: 'screen/manage/updateDevice',
        method: 'post',
        params: query
    })
}

// 添加部门
export function addDevice(query) {
    return request({
        url: 'screen/manage/addDevice',
        method: 'get',
        params: query
    })
}

// 删除部门
export function delDevice(id) {
    return request({
        url: 'screen/manage/delDevice',
        method: 'get',
        params: { ids: id }
    })
}
// 获取设备详情
export function getDeviceinfo() {
    return new Promise((resolve,reject)=>{
        let val ={
            msg:'',
            code:200,
            data:{
                name: "默认",
                devconfig:"",
                label:"",
                checkbox: ["是否网关"],
                model:"model",
            }
        }
        resolve(val)
    })
}
// 获取设备属性
export function getDeviceattribute(data) {
    return new Promise((resolve,reject)=>{
       
        let val ={
            msg:'',
            code:200,
            data:[],
            total:''
        }
        for(var i=data.page*10-10+1;i<=data.pageSize;i++){
            val.data.push({
                nowTime: i+'时间',
                keyName: i+'键名',
                keyValue: i+'值',
            })
        }
        val.total=val.data.length
        resolve(val)
    })
}
// 获取最新遥测数据
export function gettelemetrydata(data) {
    return new Promise((resolve,reject)=>{
        let val ={
            msg:'',
            code:200,
            data:[],
            total:''
        }
        for(var i=data.page*10-10+1;i<=data.pageSize;i++){
            val.data.push({
                nowTime: i+'时间',
                keyName: i+'键名',
                keyValue: i+'值',
            })
        }
        val.total=val.data.length
        resolve(val)
    })
}
// 获取PDF
export function getDevicePDF(data) {
    return new Promise((resolve,reject)=>{
        let val ={
            msg:'',
            code:200,
            data:[],
            total:''
        }
        for(var i=data.page*10-10+1;i<=data.pageSize;i++){
            val.data.push({
                nowTime: i+'时间',
                Name: i+'名称',
                address: i+'地址',
                more: i+'更多',
            })
        }
        val.total=val.data.length
        resolve(val)
    })
}