import request from '@/utils/request'

// 查询设备管理列表
export function listEquipment(query) {
  return request({
    url: '/gxt/equipment/list',
    method: 'get',
    params: query
  })
}

// 查询所有品牌列表（去重）
export function listBrands() {
  return request({
    url: '/gxt/equipment/brands',
    method: 'get'
  })
}

// 根据品牌查询机型列表（去重）
export function listModelsByBrand(brand) {
  return request({
    url: '/gxt/equipment/models/' + brand,
    method: 'get'
  })
}

// 查询设备管理详细
export function getEquipment(equipmentId) {
  return request({
    url: '/gxt/equipment/' + equipmentId,
    method: 'get'
  })
}

// 新增设备管理
export function addEquipment(data) {
  return request({
    url: '/gxt/equipment',
    method: 'post',
    data: data
  })
}

// 修改设备管理
export function updateEquipment(data) {
  return request({
    url: '/gxt/equipment',
    method: 'put',
    data: data
  })
}

// 删除设备管理
export function delEquipment(equipmentId) {
  return request({
    url: '/gxt/equipment/' + equipmentId,
    method: 'delete'
  })
}

// 导入设备管理数据
export function importEquipment(data) {
  return request({
    url: '/gxt/equipment/importData',
    method: 'post',
    data: data
  })
}