import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/dmMeeting',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/dmMeeting/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/dmMeeting',
    method: 'put',
    data
  })
}

// 取消申请
export function cancel(data) {
  return request({
    url: 'api/dmMeeting/cancel',
    method: 'post',
    data
  })
}

// export function crudDmMeeting(data) {
//   return request({
//     url: 'api/dmMeeting/approveList',
//     method: 'get',
//     data
//   })
// }

// 延期申请
export function delay(data) {
  return request({
    url: 'api/dmMeeting/delay',
    method: 'post',
    data
  })
}

// 获取权限用户/使用设备/审批人数据
export function getRelationInfo(data) {
  return request({
    url: 'api/dmMeeting/getRelationInfo',
    method: 'post',
    data
  })
}

// 结束会议
export function close(data) {
  return request({
    url: 'api/dmMeeting/closeMeeting',
    method: 'post',
    data
  })
}

export function signList(data) {
  return request({
    url: 'api/dmMeeting/meetingSignList',
    method: 'post',
    data
  })
}

export function signOn(data) {
  return request({
    url: 'api/dmMeeting/signOn',
    method: 'post',
    data
  })
}

export function getDmMeeting(data) {
  return request({
    url: 'api/dmMeeting/getDmMeeting?' + data,
    method: 'get'/* ,
    data */
  })
}

export function approve(data) {
  return request({
    url: 'api/dmMeeting/approve?meetingId=' + data,
    method: 'get'/* ,
    data */
  })
}

export function getMettingById(param) {
  return request({
    url: '/api/thirdparty/meeting/getDmMeetingByMeetingId?meetingId=' + param,
    method: 'GET'
    // param
  })
}

export default { add, edit, del, approve, cancel, delay, getRelationInfo, close, signList, signOn, getDmMeeting, getMettingById }
