import request from '@/utils/request'


// 查询作业区域类型-列表page
export function listWorkarea(query) {
  return request({
    url: '/iscs/workarea/getIsWorkareaPage',
    method: 'get',
    params: query
  })
}
// 获取作业区域list
export function getIsWorkareaList(query) {
  return request({
    url: '/iscs/workarea/getIsWorkareaList?workshopId=' + query,
    method: 'get',
  })
}
// 获取作业区域详细信息
export function getWorkareaInfo(repairId) {
  return request({
    url: '/iscs/workarea/selectIsWorkareaById?workareaId=' + repairId,
    method: 'get'
  })
}
// 获取所有车间
export function listAllWorkshop(){
  return request({
    url: '/mes/md/workshop/listAll',
    method: 'get'
  })
}
// 获取区域msp解析数据
export function getMapDataApi(query,query2,query3) {
  return request({
    url: `/iscs/workarea/selectIsWorkareaMapById?workareaId=${query}&sopId=${query2}&ticketId=${query3}`,
    method: 'get',
  })
}

//新增作业区域
export function addWorkarea(query) {
  return request({
    url: '/iscs/workarea/insertIsWorkarea',
    method: 'post',
    data: query
  })
}

// 修改作业区域
export function updateWorkarea(data) {
  return request({
    url: '/iscs/workarea/updateIsWorkarea',
    method: 'post',
    data: data
  })
}

// 删除作业区域
export function delWorkarea(repairId) {
  return request({
    url: '/iscs/workarea/deleteIsWorkareaByWorkareaIds?workareaIds='+ repairId,
    method: 'post'
  })
}
