import request from '@/utils/request'
// 列表
export function getTrainingPlanClassificationList(params) {
  return request({
    url: `/train/getTrainingPlanClassificationList?categoriesName=${params.categoriesName}`,
    method: "get"
  });
}

// 新增或者编辑
export function saveTrainingPlanClassification(data) {
  return request({
    url: `/train/saveTrainingPlanClassification`,
    method: "post",
    data
  });
}

// 删除
export function delTrainingPlanClassificationById(params) {
  return request({
    url: `/train/delTrainingPlanClassificationById?id=${params}`,
    method: "get"
  });
}


// 题库列表
export function getQuestionBankList(params) {
  return request({
    url: `/train/getQuestionBankList`,
    method: "get",
    params
  });
}
// 题库新增
export function saveQuestionBank(data) {
  return request({
    url: `/train/saveQuestionBank`,
    method: "post",
    data
  });
}
// 培训计划分类下拉菜单
export function queryLastLevelClassification() {
  return request({
    url: `/train/queryLastLevelClassification`,
    method: "get"
  });
}
// 删除
export function delQuestionBankById(params) {
  return request({
    url: `/train/delQuestionBankById?id=${params}`,
    method: "get"
  });
}
// 题库详情
export function getQuestionBankById(params) {
  return request({
    url: `/train/getQuestionBankById?id=${params}`,
    method: "get"
  });
}
// 试卷管理详情
export function getPaperById(params) {
  return request({
    url: `/train/getPaperById?id=${params}`,
    method: "get"
  });
}
// 上传
export function upload(data) {
  return request({
    url: `/common/upload`,
    method: "post",
    data
  });
}
// 课程的列表
export function getCourseList(params) {
  return request({
    url: `/train/getCourseList`,
    method: "get",
    params
  });
}
// 课程的添加
export function saveCourse(data) {
  return request({
    url: `/train/saveCourse`,
    method: "post",
    data
  });
}
// 课程的详情
export function getCourseById(params) {
  return request({
    url: `/train/getCourseById?id=${params}`,
    method: "get",
  });
}
// 课程的删除
export function delCourseById(params) {
  return request({
    url: `/train/delCourseById?id=${params}`,
    method: "get"
  });
}

// 岗位的列表
export function optionselect() {
  return request({
    url: `/system/post/optionselect`,
    method: "get",
  });
}
// 岗位的接口
export function postList(params) {
  return request({
    url: `/system/post/list?pageNum=1&pageSize=1000`,
    method: "get",
    params
  });
}


// 证书下拉
export function getCertificateSelect(params) {
  return request({
    url: `/train/getCertificateSelect`,
    method: "get",
    params
  });
}
// 审核
export function auditTrainingPlan(data) {
  return request({
    url: `/train/auditTrainingPlan`,
    method: "post",
    data
  });
}
// 添加试卷
export function getQuestionBankSelect(params) {
  return request({
    url: `/train/getQuestionBankSelect`,
    method: "get",
    params
  });
}

// 提交试卷
export function savePaper(data) {
  return request({
    url: `/train/savePaper`,
    method: "post",
    data
  });
}

// 培训计划的列表
export function getTrainingPlanList(params) {
  return request({
    url: `/train/getTrainingPlanList`,
    method: "get",
    params
  });
}

// 培训计划的详情
export function getTrainingPlanById(params) {
  return request({
    url: `/train/getTrainingPlanById`,
    method: "get",
    params
  });
}

// 培训计划的删除
export function delTrainingPlanById(params) {
  return request({
    url: `/train/delTrainingPlanById`,
    method: "get",
    params
  });
}

// 培训计划的新增
export function saveTrainingPlan(data) {
  return request({
    url: `/train/saveTrainingPlan`,
    method: "post",
    data
  });
}

// 课程的下拉菜单
export function getCourseSelect(params) {
  return request({
    url: `/train/getCourseSelect`,
    method: "get",
    params
  });
}

// 审核人的下拉菜单
export function allList() {
  return request({
    url: `/system/user/allList`,
    method: "get"
  });
}

// 证书列表
export function getCertificateList(params) {
  return request({
    url: `/train/getCertificateList`,
    method: "get",
    params
  });
}
// 证书列表删除
export function delCertificateById(params) {
  return request({
    url: `/train/delCertificateById`,
    method: "get",
    params
  });
}
// 证书列表详情
export function getCertificateById(params) {
  return request({
    url: `/train/getCertificateById`,
    method: "get",
    params
  });
}
// 证书列表(新增/修改)
export function saveCertificate(data) {
  return request({
    url: `/train/saveCertificate`,
    method: "post",
    data
  });
}
// 查询试卷列表
export function getPaperList(params) {
  return request({
    url: `/train/getPaperList`,
    method: "get",
    params
  });
}
// 启用禁用/删除
export function deactivatePaperById(params) {
  return request({
    url: `/train/deactivatePaperById`,
    method: "get",
    params
  });
}
// 文件->流 接口
export function getBaseApi(path) {
  return request({
    url: '/common/getBase64?path='+path,
    method: 'get',
    timeout: 50000
  })
}
// 下载接口
export function resourceDownload(params) {
  return request({
    url: '/common/download/resource?resource='+params,
    method: 'get',
    responseType: 'blob',
    timeout: 50000
  })
}