import http from '@/utils/http'

let baseUrl = '/project'

//新增项目组
export function addGroup(addFrom) {
  return http.post(baseUrl + '/group/add', addFrom)
}

//编辑项目组
export function editGroup(editForm, id) {
  return http.put(baseUrl + '/group/edit/' + id, editForm)
}

//作废项目组
export function removeGroup(id) {
  return http.delete(baseUrl + '/group/' + id)
}

//查询项目组树结构
export function getGroupTree() {
  return http.get(baseUrl + '/group/tree')
}

//分页查询项目列表
export function getProjectPage(queryForm) {
  return http.post(baseUrl + '/page', queryForm)
}

//新增项目基本信息
export function addProject(addForm) {
  return http.post(baseUrl + '/add', addForm)
}

//新增项目分类配置
export function addProCategory(addForm) {
  return http.post(baseUrl + '/category/add', addForm)
}

//新增项目资源配置
export function addProResource(addForm) {
  return http.post(baseUrl + '/resource/add', addForm)
}

//新增项目人员配置
export function addProUsers(addForm) {
  return http.post(baseUrl + '/user/add', addForm)
}

//项目资源分配完成
export function assignComplete(addForm, projectId) {
  return http.post(baseUrl + '/add/complete/' + projectId, addForm)
}

//取消资源分配
export function deleteProject(projectId) {
  return http.delete(baseUrl + '/' + projectId)
}

//查询项目任务列表
export function getTaskPage(projectId, pageNum) {
  return http.get(baseUrl + '/task/page/' + projectId + '?pageNum=' + pageNum)
}

//重新指派
export function reAssignTask(assignForm) {
  return http.put(baseUrl + '/reassign/task', assignForm)
}

//查询任务明细
export function getTaskDetails(taskId) {
  return http.get(baseUrl + '/task-details/' + taskId)
}

//打标
export function markDetail(markForm) {
  return http.post(baseUrl + '/task/mark', markForm)
}

//查询项目信息
export function getProjectById(projectId) {
  return http.get(baseUrl + '/' + projectId)
}

//查询任务信息
export function getTaskById(taskId) {
  return http.get(baseUrl + '/task/' + taskId)
}

//新增抽样验证
export function addTaskSample(sampleForm) {
  return http.post(baseUrl + '/task/sample/add', sampleForm)
}

//验证
export function sampleMark(markForm) {
  return http.post(baseUrl + '/task/sample-mark', markForm)
}

//验证完成项目
export function verifyProject(projectId) {
  return http.put(baseUrl + '/verify/' + projectId)
}

//分页查询任务
export function getTaskPageByParam(queryForm) {
  return http.post(baseUrl + '/my-task/page', queryForm)
}

//查询我的任务状态
export function getMyTaskStatistics() {
  return http.get(baseUrl + '/my-task/statistics')
}

//查询标注结果
export function getMarkResultPage(queryFrom) {
  return http.post(baseUrl + '/mark-result/page', queryFrom)
}

//导出标注结果
export function exportMarkResult(queryForm) {
  return http.post(baseUrl + '/mark-result/export', queryForm)
}

//导出标注结果
export function exportMarkResultJson(queryForm) {
  return http.export(baseUrl + '/mark-result/json', queryForm)
}

//分页查询任务明细
export function getDetailPage(taskId, dataId, type) {
  return http.get(baseUrl + '/task-details/page/' + taskId + '?dataId=' + dataId + '&type=' + type)
}

//查询项目明细
export function getProjectDetail(projectId) {
  return http.get(baseUrl + '/detail/' + projectId)
}

//查询标注结果
export function getTaskDetail(detailId) {
  return http.get(baseUrl + '/task-detail/' + detailId)
}
