import request from '@/utils/request'

const baseUrl = import.meta.env.VITE_APP_BASE_API

// 查询设备类别管理列表
export function listCategory(query) {
  return request({
    url: baseUrl + '/business/equipmentCategory/list',
    method: 'get',
    params:query

  })
}

// 查询设备类别管理详细
export function getCategory(id) {
  return request({
    url: baseUrl + '/business/equipmentCategory/getInfo/' + id,
    method: 'get'
  })
}

// 保存设备类别管理
export function saveCategory(data) {
  return request({
    url: baseUrl + '/business/equipmentCategory/save',
    method: 'post',
    data: data
  })
}

// 删除设备类别管理
export function delCategory(id) {
  return request({
    url: baseUrl + '/business/equipmentCategory/remove/' + id,
    method: 'delete'
  })
}

// 查询部门下拉树结构
export function categoryTreeSelect() {
  return request({
    url: baseUrl + '/business/equipmentCategory/deptTree',
    method: 'get'
  })
}

// 查询设备档案列表
export function listEquipment(data) {
  return request({
    url: baseUrl + '/business/equipment/list',
    method: 'post',
    data: data
  })
}

// 查询设备档案详细
export function getEquipment(id) {
  return request({
    url: baseUrl + '/business/equipment/getInfo/' + id,
    method: 'get'
  })
}

// 保存设备档案
export function saveEquipment(data) {
  return request({
    url: baseUrl + '/business/equipment/save',
    method: 'post',
    data: data
  })
}

// 删除设备档案
export function delEquipment(id) {
  return request({
    url: baseUrl + '/business/equipment/remove/' + id,
    method: 'delete'
  })
}

// 查询设备详情列表
export function listDetails(data) {
  return request({
    url: baseUrl + '/business/equipmentDetail/list',
    method: 'post',
    data: data
  })
}

export function listCategories(data) {
  return request({
    url: baseUrl + '/business/equipmentCategory/listCategories',
    method: 'post',
    data: data
  })
}

// 查询设备详情列表
export function detailList(query) {
  return request({
    url: baseUrl + '/business/equipmentDetail/detailList',
    method: 'get',
    params: query
  })
}


// 查询调机设备列表
export function getResourceAllocation(data) {
  return request({
    url: baseUrl + '/business/equipmentDetail/resourceAllocation',
    method: 'post',
    data: data
  })
}

// 查询设备详情详细
export function getDetails(id) {
  return request({
    url: baseUrl + '/business/equipmentDetail/getInfo/' + id,
    method: 'get'
  })
}

// 保存设备详情
export function saveDetails(data) {
  return request({
    url: baseUrl + '/business/equipmentDetail/save',
    method: 'post',
    data: data
  })
}

// 工段批量分配资源
export function updateBacth(data) {
  return request({
    url: baseUrl + '/business/equipmentDetail/updateBacth',
    method: 'post',
    data: data
  })
}

// 删除设备详情
export function delDetails(id) {
  return request({
    url: baseUrl + '/business/equipmentDetail/remove/' + id,
    method: 'delete'
  })
}

export function downloadQcImgs(query) {
  return request({
    url: baseUrl + '/business/equipmentDetail/downloadQcImgs',
    method: 'get',
    params: query
  })
}


// 查询设备详情列表
export function download(query) {
  return request({
    url: baseUrl + '/business/equipmentDetail/download',
    method: 'get',
    params: query
  })
}

