import http from '@/http'

export const getReviewMeetingList = params => http.get('/api/v1/meeting/listReviewProject', { params }) // 会议评审列表java
export const getMeetingProjectList = params => http.get('/api/v1/meeting/option/project', { params }) // 评审会议项目列表java
export const createMeeting = data => http.post('/api/v1/meeting/create', data) // 新建会议java
export const meetingList = params => http.get('/api/v1/meeting/manager/meetingList', { params }) // 评审会议列表

export const meetingBasicInfo = meetingId => http.get(`/api/v1/meeting/basicInfo/${meetingId}`) // 会议详情-基本信息
export const meetingInviteRuleDetail = meetingId => http.get(`/api/v1/meeting/inviteRuleDetail/${meetingId}`) // 会议详情-抽取规则
export const projects = meetingId => http.get(`/api/v1/meeting/${meetingId}/projects`) // 会议关联项目
export const inviteExpertList = meetingId => http.get(`/api/v1/meeting/inviteExpertList/${meetingId}`) // 抽取情况
export const expertConfirm = data => http.post(`/api/v1/meeting/expert/confirm`, data) // 确认参加
export const setUpHeadman = data => http.post(`/api/v1/meeting/setUpHeadman`, data) // 设置组长
export const stopInvite = meetingId => http.get(`/api/v1/meeting/stopInvite/${meetingId}`) // 停止抽取
export const confirmedRoster = data => http.post(`/api/v1/meeting/confirmedRoster`, data) // 重发短信
export const expertRelease = data => http.post(`/api/v1/meeting/expert/release`, data) // 释放专家
export const meetingCancel = data => http.post(`/api/v1/meeting/cancel`, data) // 取消会议
export const batchAppoint = data => http.post(`/api/v1/meeting/expert/batchAppoint`, data) // 补充专家
export const convertToAppoint = data => http.post(`/api/v1/meeting/convertToAppoint`, data) // 转为指定抽取
export const continueInvite = data => http.post(`/api/v1/meeting/continueInvite`, data) // 续抽
export const listReview = ({ projectId, meetingId }) => http.get(`/api/v1/expertReview/list/${projectId}/${meetingId}`) // 所有组员意见以及最终意见
export const expertRemove = data => http.post(`/api/v1/meeting/expertRemove`, data) // 指定专家-移除

const exportUrl = {
  1: '/api/v1/meeting/export/laborFeeAuditTable/',
  2: '/api/v1/meeting/export/expertFeeTable/',
  3: '/api/v1/meeting/export/expertInviteTable/',
  4: '/api/v1/meeting/export/expertReviewTable/'
}
export const exportTable = (state, meetingId) => http.get(`${exportUrl[state]}${meetingId}`, { responseType: 'blob' }) // 导出
