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

/**
 * 机架列表分页查询
 * @param {查询条件} data
 */
export function listOdfRacks(query) {
  return request({
    url: 'business/OdfRacks/list',
    method: 'get',
    params: query,
  })
}

/**
 * 新增机架列表
 * @param data
 */
export function addOdfRacks(data) {
  return request({
    url: 'business/OdfRacks',
    method: 'post',
    data: data,
  })
}
/**
 * 新增机架列表
 * @param data
 */
export function addOdfRacksExpert(data) {
  return request({
    url: 'business/OdfRacks/expert',
    method: 'post',
    data: data,
  })
}
/**
 * 修改机架列表
 * @param data
 */
export function updateOdfRacks(data) {
  return request({
    url: 'business/OdfRacks',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取机架列表详情
 * @param {Id}
 */
export function getOdfRacks(id) {
  return request({
    url: 'business/OdfRacks/' + id,
    method: 'get'
  })
}

/**
 * 删除机架列表
 * @param {主键} pid
 */
export function delOdfRacks(pid) {
  return request({
    url: 'business/OdfRacks/delete/' + pid,
    method: 'POST'
  })
}
// 导出机架列表
export async function exportOdfRacks(query) {
  await downFile('business/OdfRacks/export', { ...query })
}
