import { axios } from '@/utils/request'

// 列表查询
export const getBoxList = (params) => {
  const url = `deviceType/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 查箱体类型列表  不分页
export const deviceTypeListQuery = (params) => {
  return axios.request({
    url: `/deviceType/queryList`,
    method: 'post',
    data: params
  })
}
// 确认保存
export const saveBoxSetting = (params) => {
  const url = `deviceType/save`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 查详情
export const viewBoxSetting = (params) => {
  const url = `deviceType/findById/${params.id}`
  return axios({
    url: url,
    data: {},
    method: 'get'
  })
}

// 删除
export const deleteBoxSetting = (params) => {
  const url = `deviceType/delete/${params.id}`
  return axios({
    url: url,
    data: {},
    method: 'get'
  })
}

// 导出
export const exportDevice = (params) => {
  return axios.request({
    url: 'device/exportDevice',
    data: params,
    method: 'post',
    responseType: 'blob'
  })
}
