import request from '@/utils/request'

export function listTicket(data) {
  return request({
    url: '/ticketLiset',
    method: 'post',
    data: {
      id: data.id,
      type: data.type,
      createUserNmae: data.createUserNmae,
      ticketTitle: data.ticketTitle,
      createUser: data.createUser,
      status: data.status,
      tpUserId: data.tpUserId,
      updateUserNmae: data.updateUserNmae,
      pageNum: data.pageNum,
      pageSize: data.pageSize
    }
  })
}
export function ticketEdit(data) {
  return request({
    url: '/ticketDetails',
    method: 'post',
    data: {
      id: data.id
    }
  })
}
export function addRecordComment(data) {
  return request({
    url: '/addRecordComment',
    method: 'post',
    data: {
      ticketId: data.id,
      content: data.textContent,
      imageUrl: data.img
    }
  })
}
export function addRecord(data) {
  return request({
    url: '/addRecord',
    method: 'post',
    data: {
      ticketId: data.id,
      id: data.selectVale
    }
  })
}

export function updateTicketStatus(data) {
  return request({
    url: '/updateTicketStatus',
    method: 'post',
    data: {
      ticketId: data.id,
      textContent: data.noAcceptContent
    }
  })
}

export function updateTicket(data) {
  return request({
    url: '/updateTicket',
    method: 'post',
    data: {
      ticketId: data.id,
      content: data.relationContent,
      imageUrl: data.imgIO
    }
  })
}

// // headers: {
//   'Content-Type': 'application/x-www-form-urlencoded'
// },
export function imgAdd(data) {
  return request({
    url: '/uploadimageBase64',
    method: 'post',
    data: data
  })
}

