import request from '@/utils/request'

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

// 查询手环箱列表
export function listShbox(query) {
    return request({
        url: '/bracelet/bracelet/listShbox',
        method: 'get',
        params: query
    })
}

// 查询手环箱管理页面手环箱列表
export function listShboxall(query) {
    return request({
        url: '/bracelet/bracelet/listShboxall',
        method: 'get',
        params: query
    })
}

// 查询手环绑定选择列表
export function listShboxBind(query) {
    return request({
        url: '/bracelet/bracelet/listShboxBind',
        method: 'get',
        params: query
    })
}

// 查询手环箱管理页面手环列表
export function listShBind(query) {
    return request({
        url: '/bracelet/bracelet/listShBind',
        method: 'get',
        params: query
    })
}

// 查询手环箱管理页面未绑定手环列表
export function listShNoBind(query) {
    return request({
        url: '/bracelet/bracelet/listShNoBind',
        method: 'get',
        params: query
    })
}

// 添加手环
export function addSh(data) {
    return request({
        url: '/bracelet/bracelet/addSh',
        method: 'post',
        data: data
    })
}

// 手环箱管理页面添加手环箱
export function addBox(data) {
    return request({
        url: '/bracelet/bracelet/addBox',
        method: 'post',
        data: data
    })
}

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

// 手环绑定选择页面绑定手环
export function addShBind(data) {
    return request({
        url: '/bracelet/bracelet/addShBind',
        method: 'post',
        data: data
    })
}


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

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

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


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

// 手环箱管理页面修改
export function editBox(data) {
    return request({
        url: '/bracelet/bracelet/editBox',
        method: 'post',
        data: data
    })
}


// 解除绑定
export function delSh(data) {
    return request({
        url: '/bracelet/bracelet/delSh',
       method: 'post',
       data: data
    })
}


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

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

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


// 详情
export function getBoxInfo(shboxId) {
    return request({
        url: '/bracelet/bracelet/' + shboxId,
        method: 'get',
    })
}

// 详情
export function getBoxNewInfo(shboxId) {
    return request({
        url: '/bracelet/bracelet/new/' + shboxId,
        method: 'get',
    })
}

//绑定
export function bindSh(data) {
    return request({
        url: '/bracelet/bracelet/bindSh',
        method: 'post',
        data:data
    })
}

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

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

