import request from '@/utils/request'

// 查询工单列表列表
export function listWorkOrder(query) {
  return request({
    url: '/work/workOrder/list',
    method: 'get',
    params: query
  })
}

// 查询工单列表详细
export function getWorkOrder(id) {
  return request({
    url: '/work/workOrder/' + id,
    method: 'get'
  })
}

// 新增工单列表
export function addWorkOrder(data) {
  return request({
    url: '/work/workOrder',
    method: 'post',
    data: data
  })
}

// 修改工单列表
export function updateWorkOrder(data) {
  return request({
    url: '/work/workOrder',
    method: 'put',
    data: data
  })
}

// 删除工单列表
export function delWorkOrder(id) {
  return request({
    url: '/work/workOrder/' + id,
    method: 'delete'
  })
}

export function getNodeList(workOrderId) {
  //默认节点最多只有8个
  const query = {
    pageNum: 1,
    pageSize: 10,
    workOrderId: workOrderId
  }
  return request({
    url: '/work/node/list',
    method: 'get',
    params: query
  })
}


