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

// 设备列表
export const deviceList = (params) => {
  const url = `/device/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
// 查设备列表  不分页
export const deviceListQuery = (params) => {
  return axios.request({
    url: `/device/query`,
    method: 'post',
    data: params
  })
}
// 设备启禁用   0禁用   1启用
export const deviceEnable = (params) => {
  return axios.request({
    url: `/device/enable/${params.id}/${params.state}`,
    method: 'get'
  })
}
// 设备更换箱体类型
export const deviceTypeUpdate = (params) => {
  return axios.request({
    url: `/device/enable/${params.id}/${params.deviceTypeNo}`,
    method: 'get'
  })
}
// 根据设备编号查询设备
export const deviceFindDevice = (params) => {
  return axios.request({
    url: `/device/findBySrcDeviceNo/${params.srcDeviceCode}`,
    method: 'get'
  })
}
// 设备更换箱体类型
export const deviceUpdateDeviceType = (params) => {
  return axios.request({
    url: `/device/updateDeviceType/${params.id}/${params.deviceTypeNo}`,
    method: 'get'
  })
}
// 设备日志列表
export const deviceLogList = (params) => {
  const url = `/deviceLog/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
