import request from '@/utils/request'

// 获取课件库树
export function getCoursewareTreeTable(query) {
  return request({
    url: '/exam/coursewareLibrary/getCoursewareTreeTable',
    method: 'get',
    params: query,
  })
}

// 新增/移动 题库文件树
export function getCoursewareLibraryTree(query) {
  return request({
    url: '/exam/coursewareLibrary/getCoursewareLibraryTree',
    method: 'get',
    params: query,
  })
}

// 添加课件库
export function addFolder(data) {
  return request({
    url: '/exam/coursewareLibrary/addFolder',
    method: 'post',
    data,
  })
}

// 课件操作
export function operFolderOrFile(data) {
  return request({
    url: '/exam/coursewareLibrary/operFolderOrFile',
    method: 'post',
    data,
  })
}

// 上传课件
export function uploadFiles(data) {
  console.log('uploadFiles data===' + JSON.stringify(data))
  return request({
    url: '/exam/coursewareLibrary/uploadFiles',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}

// 下载课件
export function downLoadFile(query) {
  return request({
    url: '/exam/coursewareLibrary/downLoadFile',
    method: 'get',
    params: query,
    // responseType: 'blob',
  })
}

// 试题库-列表
export function testQuestLibraryList(query) {
  return request({
    url: '/exam/testQuestLibrary/list',
    method: 'get',
    params: query,
  })
}

// 试题库-新增
export function addTestQuest(data) {
  return request({
    url: '/exam/testQuestLibrary/addTestQuest',
    method: 'post',
    data,
  })
}

// 试题库-重命名
export function editTestQuest(data) {
  return request({
    url: '/exam//testQuestLibrary/renameTestQuest',
    method: 'post',
    data,
  })
}

// 试题库-删除
export function delTestQuest(data) {
  return request({
    url: '/exam/testQuestLibrary/delTestQuest',
    method: 'post',
    data,
  })
}

// 题库详情-列表
export function getQuestionsExamList(query) {
  return request({
    url: '/exam/testQuestLibrary/getQuestionsExamList',
    method: 'get',
    params: query,
  })
}

// 获取标签-列表
export function getLabels(query) {
  return request({
    url: '/exam/testQuestLibrary/getLabels',
    method: 'get',
    params: query,
  })
}

// 新增-试题
export function addTopic(data) {
  return request({
    url: '/exam/testQuestLibrary/addTopic',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}

// 编辑-试题
export function editTopic(data) {
  return request({
    url: '/exam/testQuestLibrary/editTopic',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}

// 删除-试题
export function delTopic(data) {
  return request({
    url: '/exam/testQuestLibrary/delTopic',
    method: 'post',
    data,
  })
}

// 编辑-试题详情
export function getTopicDetail(query) {
  return request({
    url: '/exam/testQuestLibrary/getTopicDetail',
    method: 'get',
    params: query,
  })
}

// 获取试题数量
export function getQuestionsExamNums(query) {
  return request({
    url: '/exam/testQuestLibrary/getQuestionsExamNums',
    method: 'get',
    params: query,
  })
}

// 标签库-列表
export function labelLibraryList(query) {
  return request({
    url: '/exam/labelLibrary/list',
    method: 'get',
    params: query,
  })
}

// 标签库-新增标签
export function addLabel(data) {
  return request({
    url: '/exam/labelLibrary/addLabel',
    method: 'post',
    data,
  })
}

// 标签库-编辑标签
export function editLabel(data) {
  return request({
    url: '/exam/labelLibrary/renameLabel',
    method: 'post',
    data,
  })
}

// 标签库-删除标签
export function delLabel(data) {
  return request({
    url: '/exam/labelLibrary/delLabel',
    method: 'post',
    data,
  })
}

// 标签库-启用/禁用标签
export function editEnabled(data) {
  return request({
    url: '/exam/labelLibrary/editEnabled',
    method: 'post',
    data,
  })
}

// 练习库-列表
export function practiceTemplateList(query) {
  return request({
    url: '/exam/practiceTemplate/list',
    method: 'get',
    params: query,
  })
}

// 练习库-新增
export function addExam(data) {
  return request({
    url: '/exam/practiceTemplate/addExam',
    method: 'post',
    data,
  })
}

// 练习库-重命名
export function renameExam(data) {
  return request({
    url: '/exam/practiceTemplate/renameExam',
    method: 'post',
    data,
  })
}

// 练习库-删除
export function delExam(data) {
  return request({
    url: '/exam/practiceTemplate/delExam',
    method: 'post',
    data,
  })
}

// 练习库-练习题库-下拉
export function getQuestionAndLibrary(query) {
  return request({
    url: '/exam/practiceTemplate/getQuestionAndLibrary',
    method: 'get',
    params: query,
  })
}

// 练习库-抽取试题
export function extractTestQuestions(data) {
  return request({
    url: '/exam/practiceTemplate/extractTestQuestions',
    method: 'post',
    data,
  })
}

// 练习库-获取抽取试题-列表
export function getTestQuestions(query) {
  return request({
    url: '/exam/practiceTemplate/getTestQuestions',
    method: 'get',
    params: query,
  })
}

// 练习库-删除抽取试题
export function delTemplateExamQuestion(data) {
  return request({
    url: '/exam/practiceTemplate/delTemplateExamQuestion',
    method: 'post',
    data,
  })
}

// 练习库-保存抽取试题
export function saveTemplateExamQuestion(data) {
  return request({
    url: '/exam/practiceTemplate/saveTemplateExamQuestion',
    method: 'post',
    data,
  })
}

// 练习库-试题详情
export function getTestQuestionDetail(query) {
  return request({
    url: '/exam/practiceTemplate/getTestQuestionDetail',
    method: 'get',
    params: query,
  })
}

// 试卷模版-列表
export function examTemplateList(query) {
  return request({
    url: '/exam/examTemplate/list',
    method: 'get',
    params: query,
  })
}

// 试卷模版-新增
export function addExamTemplate(data) {
  return request({
    url: '/exam/examTemplate/addExam',
    method: 'post',
    data,
  })
}

// 试卷模版-重命名
export function renameExamTemplate(data) {
  return request({
    url: '/exam/examTemplate/renameExam',
    method: 'post',
    data,
  })
}

// 试卷模版-删除
export function delExamTemplate(data) {
  return request({
    url: '/exam/examTemplate/delExam',
    method: 'post',
    data,
  })
}

// 试卷模版-试卷题库-下拉
export function getQuestionAndLibraryExam(query) {
  return request({
    url: '/exam/examTemplate/getQuestionAndLibrary',
    method: 'get',
    params: query,
  })
}

// 试卷模版-抽取试题
export function extractTestQuestionsExam(data) {
  return request({
    url: '/exam/examTemplate/extractTestQuestions',
    method: 'post',
    data,
  })
}

// 试卷模版-获取抽取试题-列表
export function getTestQuestionsExam(query) {
  return request({
    url: '/exam/examTemplate/getTestQuestions',
    method: 'get',
    params: query,
  })
}

// 试卷模版-删除抽取试题
export function delTemplateExamQuestionExam(data) {
  return request({
    url: '/exam/examTemplate/delTemplateExamQuestion',
    method: 'post',
    data,
  })
}

// 试卷模版-保存抽取试题
export function saveTemplateExamQuestionExam(data) {
  return request({
    url: '/exam/examTemplate/saveTemplateExamQuestion',
    method: 'post',
    data,
  })
}

// 试卷模版-试题详情
export function getTestQuestionDetailExam(query) {
  return request({
    url: '/exam/examTemplate/getTestQuestionDetail',
    method: 'get',
    params: query,
  })
}

// 学习任务-列表
export function learningTaskList(query) {
  return request({
    url: '/exam/learningTask/list',
    method: 'get',
    params: query,
  })
}

// 学习任务-工程-下拉
export function getProsSelectByStudyTask(query) {
  return request({
    url: '/exam/learningTask/getProsSelectByStudyTask',
    method: 'get',
    params: query,
  })
}

// 学习任务-人员树
export function getPersonTreeByType(query) {
  return request({
    url: '/exam/learningTask/getPersonTreeByType',
    method: 'get',
    params: query,
  })
}

// 学习任务-添加课件-列表
export function getCoursewareTreeTableByTask(query) {
  return request({
    url: '/exam/learningTask/getCoursewareTreeTable',
    method: 'get',
    params: query,
  })
}

// 学习任务-添加考试/练习-列表
export function getExamTemplateLists(query) {
  return request({
    url: '/exam/learningTask/getExamTemplateLists',
    method: 'get',
    params: query,
  })
}

// 学习任务-添加考试-创建试卷-自选题库/全部题库
export function getQuestionAndLibraryByTask(query) {
  return request({
    url: '/exam/selfBuildExam/getQuestionAndLibrary',
    method: 'get',
    params: query,
  })
}

// 学习任务-添加考试-创建试卷-抽取试题
export function extractTestQuestionsByTask(data) {
  return request({
    url: '/exam/selfBuildExam/extractTestQuestions',
    method: 'post',
    data,
  })
}

// 学习任务-添加考试-创建试卷-创建试题
export function addTopicByTask(data) {
  return request({
    url: '/exam/selfBuildExam/addTopic',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}

// 学习任务-添加考试-创建试卷-保存
export function saveTemplateExamQuestionByTask(data) {
  return request({
    url: '/exam/selfBuildExam/saveTemplateExamQuestion',
    method: 'post',
    data,
  })
}

// 学习任务-新增任务
export function addStudyTask(data) {
  return request({
    url: '/exam/learningTask/addStudyTask',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}

// 学习任务-获取详情
export function getStudyTaskById(query) {
  return request({
    url: '/exam/learningTask/getStudyTaskById',
    method: 'get',
    params: query,
  })
}

// 学习任务-编辑任务
export function editStudyTask(data) {
  return request({
    url: '/exam/learningTask/editStudyTask',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}
// 学习任务-学习任务数据详情
export function getStudyTaskDataDetail(query) {
  return request({
    url: '/exam/learningTask/getStudyTaskDataDetail',
    method: 'get',
    params: query,
  })
}
// 学习任务数据-培训人员数据
export function getStudyTaskDataList(query) {
  return request({
    url: '/exam/learningTask/getStudyTaskDataList',
    method: 'get',
    params: query,
  })
}

// 学习任务-删除任务
export function delStudyTaskById(data) {
  return request({
    url: '/exam/learningTask/delStudyTaskById',
    method: 'post',
    data,
  })
}

// 培训-列表
export function getTrainingTasksList(query) {
  return request({
    url: '/exam/trainingTasks/list',
    method: 'get',
    params: query,
  })
}
// 培训-新增任务
export function addTrainingTask(data) {
  return request({
    url: '/exam/trainingTasks/addTrainingTask',
    method: 'post',
    data: data,
  })
}

// 培训-编辑任务
export function editTrainingTask(data) {
  return request({
    url: '/exam/trainingTasks/editTrainingTask',
    method: 'post',
    data: data,
  })
}

// 培训-获取详情
export function getTrainingTaskDetail(query) {
  return request({
    url: '/exam/trainingTasks/getTrainingTaskDetail',
    method: 'get',
    params: query,
  })
}

// 培训-改变任务状态
export function changeSignStatus(query) {
  return request({
    url: '/exam/trainingTasks/changeSignStatus',
    method: 'post',
    data: query,
  })
}
// 培训-删除任务
export function delTrainingTaskById(query) {
  return request({
    url: '/exam/trainingTasks/delTrainingTaskById',
    method: 'post',
    data: query,
  })
}

// 培训-数据详情表格
export function selectTrainingDataList(query) {
  return request({
    url: '/exam/trainingTasks/selectTrainingDataList',
    method: 'get',
    params: query,
  })
}

// 培训 -上传现场照片
export function uploadScenePhoto(data) {
  return request({
    url: '/exam/trainingTasks/uploadScenePhoto',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  })
}
// 培训 -获取现场照片
export function selectScenePhoto(query) {
  return request({
    url: '/exam/trainingTasks/selectScenePhoto',
    method: 'get',
    params: query,
  })
}
// 培训 -获取数据详情表头
export function selectTrainingDataHeader(query) {
  return request({
    url: '/exam/trainingTasks/selectTrainingDataHeader',
    method: 'get',
    params: query,
  })
}

export function getTaskUsersByChecked(params) {
  return request({
    url: '/exam/examTask/getTaskUsersByChecked',
    method: 'post',
    data: params,
  })
}
//考试 -新增
export function addExamTask(data) {
  return request({
    url: '/exam/examTask/addExamTask',
    method: 'post',
    data: data,
  })
}
//考试 -修改
export function editExamTask(data) {
  return request({
    url: '/exam/examTask/editExamTask',
    method: 'post',
    data: data,
  })
}

//考试 -列表
export function getExamList(query) {
  return request({
    url: '/exam/examTask/list',
    method: 'get',
    params: query,
  })
}
// 考试 -获取详情
export function getExamTaskById(query) {
  return request({
    url: '/exam/examTask/getExamTaskById',
    method: 'get',
    params: query,
  })
}
// 考试 -删除
export function delExamTask(data) {
  return request({
    url: '/exam/examTask/delExamTask',
    method: 'post',
    data: data,
  })
}

// 考试 -学员数据列表
export function getTaskUsers(params) {
  return request({
    url: '/exam/examTask/getTaskUsers',
    method: 'get',
    params: params,
  })
}
// 考试 -试题数据列表
export function getExamPaperQuestions(params) {
  return request({
    url: '/exam/examTask/getExamPaperQuestions',
    method: 'get',
    params: params,
  })
}
// 考试 -试题详情
export function getExamPaperDetail(params) {
  return request({
    url: '/exam/examTask/getExamPaperDetail',
    method: 'get',
    params: params,
  })
}

export function downLoadCoursewareFile(params) {
  return request({
    url: '/exam/coursewareLibrary/downLoadFile',
    method: 'get',
    params: params,
  })
}
