import { defAxios as request } from '@/utils/http'

/**
 * @description: 获取工单列表
 * @param {*} params
 * @return {*}
 */
export function generateOrder(ids) {
  return request({
    url: `/workOrder/generate/${ids}`,
    method: 'POST'
  })
}

/**
 * @description: 获取工单列表
 * @param {*} params
 * @return {*}
 */
export function getOrderList(params) {
  return request({
    url: '/workOrder/page',
    method: 'GET',
    params
  })
}

/**
 * @description: 分配工单
 * @param {*} data
 * @return {*}
 */
export function assignOrder(data) {
  return request({
    url: '/workOrder/assign',
    method: 'POST',
    data
  })
}

/**
 * @description: 获取工单下的问题
 * @param {*} data
 * @return {*}
 */
export function getOrderQuesList(params) {
  return request({
    url: '/workOrder/question/page',
    method: 'GET',
    params
  })
}

/**
 * @description: 处理问题
 * @param {*} data
 * @return {*}
 */
export function handleOrder(data) {
  return request({
    url: '/workOrder/handle',
    method: 'POST',
    data
  })
}

/**
 * @description: 问题详情
 * @param {*} data
 * @return {*}
 */
export function orderDetail(params) {
  return request({
    url: '/workOrder/question/detail',
    method: 'GET',
    params
  })
}
