import request from '@/utils/request'

// 查询列表
export function listDevcie(query) {
    return request({
        url: '/bracelet/device/list',
        method: 'get',
        params: query
    })
}

// 查询人员
export function getPersonList(data) {
    return request({
        url: '/bracelet/team/getPersonList',
        method: 'post',
        data: data
    })
}

// 添加
export function addDevice(data) {
    return request({
        url: '/bracelet/device/addDevice',
        method: 'post',
        data: data
    })
}

// 手环管理页面新增设备属性
export function addAttribute(data) {
    return request({
        headers: { // 修改请求头
            'decrypt': 'decrypt',
            'Content-Type': 'multipart/form-data'
        },
        url: '/bracelet/device/addAttribute',
        method: 'post',
        data: data
    })
}

// 详情
export function getDeviceInfo(deviceId) {
    return request({
        url: '/bracelet/device/' + deviceId,
        method: 'get',
    })
}

// 查看设备属性
export function listDeviceAttribute(query) {
    return request({
        url: '/bracelet/device/listDeviceAttribute',
        method: 'get',
        params: query
    })
}

// 设备属性详情
export function getAttributeInfo(data) {
    return request({
        url: '/bracelet/device/getAttributeInfo',
        method: 'post',
        data: data
    })
}

// 编辑
export function editAttribute(data) {
    return request({
        headers: { // 修改请求头
            'decrypt': 'decrypt',
            'Content-Type': 'multipart/form-data'
        },
        url: '/bracelet/device/editAttribute',
        method: 'post',
        data: data
    })
}

// 修改
export function editDevice(data) {
    return request({
        url: '/bracelet/device/editDevice',
        method: 'post',
        data: data
    })
}

// 删除
export function delDevice(data) {
    return request({
        url: '/bracelet/device/delDevice',
       method: 'post',
       data: data
    })
}

// 删除设备属性
export function delDeviceAttribute(data) {
    return request({
        url: '/bracelet/device/delDeviceAttribute',
       method: 'post',
       data: data
    })
}


// 导出
export function exportDevice(query) {
    return request({
        url: '/bracelet/export/exportDevice',
        method: 'get',
        responseType: 'blob',
        params: query
    })
}

// 批量导出
export function exportDeviceSome(query) {
    return request({
        url: '/bracelet/device/exportDeviceSome',
        method: 'get',
        responseType: 'blob',
        params: query
    })
}

// 查询班组成员列表
export function getWorkPersonList(query) {
    return request({
        url: '/bracelet/team/getWorkPersonList',
        method: 'get',
        params: query
    })
}