import request from '@/utils/request/index'

/**
 * 课后作业分页
 */
interface ILessonTrainingPage {
  courseType?: string | null
  startTime?: string
  page: string | number
  keyword?: string
  rows: number | string
  [_: string]: unknown
}
export const lessonTrainingPage = (data: ILessonTrainingPage) => {
  return request({
    url: '/cbs-app/lessonTraining/page',
    method: 'post',
    data: data
  } as any)
}

/**
 * 课后作业新增
 */
export const lessonTrainingSave = (data: any) => {
  return request({
    url: '/cbs-app/lessonTraining/save',
    method: 'post',
    data,
    noCleanDeep: true
  } as any)
}
/**
 * 课后作业修改
 */
export const lessonTrainingUpdate = (data: any) => {
  return request({
    url: '/cbs-app/lessonTraining/update',
    method: 'post',
    data,
    noCleanDeep: true
  } as any)
}

/**
 * 课后作业删除
 */
export const lessonTrainingRemove = (data: any) => {
  return request({
    url: `/cbs-app/lessonTraining/remove?id=${data}`,
    method: 'post'
  } as any)
}
/**
 * 课后作业启用停用
 */
export const lessonTrainingUpdateEnableFlag = (data: any) => {
  return request({
    url: `/cbs-app/lessonTraining/updateEnableFlag?id=${data}`,
    method: 'post'
  } as any)
}

/**
 * 课后作业详情
 */
export const lessonTrainingDetail = (data: any) => {
  return request({
    url: `/cbs-app/lessonTraining/detail/${data}`,
    method: 'get'
  } as any)
}

/**
 * 课后作业内容分页
 */
export const lessonTrainingDetailPage = (data: any) => {
  return request({
    url: `/cbs-app/lessonTrainingDetail/page`,
    method: 'post',
    data
  } as any)
}

/**
 * 课后作业 素材分页
 */
export const lessonTrainingDetailMaterialPage = (data: any) => {
  return request({
    url: `/cbs-app/lessonTrainingDetail/materialPage`,
    method: 'post',
    data
  } as any)
}

/**
 * 课后作业素材批量删除
 */
export const lessonTrainingDetailRemove = (data: any) => {
  return request({
    url: `/cbs-app/lessonTrainingDetail/remove?ids=${data.ids}&trainingId=${data.trainingId}`,
    method: 'post'
  } as any)
}
/**
 * 课后作业素材批量新增
 */
export const lessonTrainingDetailBatchInsert = (data: any) => {
  return request({
    url: `/cbs-app/lessonTrainingDetail/batchInsert`,
    method: 'post',
    data
  } as any)
}
/**
 * 课后作业素材训练标准新增,修改
 */
export const lessonTrainingDetailTempBatchUpSet = (data: any) => {
  return request({
    url: `/cbs-app/lessonTrainingDetailTemp/batchUpSet`,
    method: 'post',
    data
  } as any)
}

/**
 * 课后作业素材批量删除
 */
export const lessonTrainingDetailUpdate = (data: any) => {
  return request({
    url: `/cbs-app/lessonTrainingDetail/update`,
    method: 'post',
    data
  } as any)
}

/**
 * 教学课件分页
 */
export const lessonCoursewarePage = (data: any) => {
  return request({
    url: `/cbs-app/lessonCourseware/page`,
    method: 'post',
    data
  } as any)
}
/**
 * 教学课件修改
 */
export const lessonCoursewareUpdate = (data: any) => {
  return request({
    url: `/cbs-app/lessonCourseware/update`,
    method: 'post',
    data
  } as any)
}
/**
 * 教学课件新增
 */
export const lessonCoursewareSave = (data: any) => {
  return request({
    url: `/cbs-app/lessonCourseware/save`,
    method: 'post',
    data
  } as any)
}
/**
 * 教学课件删除
 */
export const lessonCoursewareDelete = (data: any) => {
  return request({
    url: `/cbs-app/lessonCourseware/delete/${data}`,
    method: 'post',
    data
  } as any)
}
/**
 * 教学课件详情
 */
export const lessonCoursewareDetail = (data: any) => {
  return request({
    url: `/cbs-app/lessonCourseware/detail/${data}`,
    method: 'get'
  } as any)
}
/**
 * 教学课件启用停用
 */
export const lessonCoursewareUpdateEnableFlag = (data: any) => {
  return request({
    url: `/cbs-app/lessonCourseware/updateEnableFlag`,
    method: 'post',
    data
  } as any)
}
/**
 * 教学计划分页
 */
export const lessonPlanPage = (data: any) => {
  return request({
    url: `/cbs-app/lessonPlan/page`,
    method: 'post',
    data
  } as any)
}
/**
 * 教学计划启用停用
 */
export const lessonPlanUpdateEnableFlag = (data: any) => {
  return request({
    url: `/cbs-app/lessonPlan/updateEnableFlag`,
    method: 'post',
    data
  } as any)
}
/**
 * 教学计划删除
 */
export const lessonPlanRemove = (data: any) => {
  return request({
    url: `/cbs-app/lessonPlan/remove?id=${data}`,
    method: 'post'
  } as any)
}
/**
 * 教学计划新增
 */
export const lessonPlanSave = (data: any) => {
  return request({
    url: `/cbs-app/lessonPlan/save`,
    method: 'post',
    data
  } as any)
}
/**
 * 教学计划修改
 */
export const lessonPlanUpdate = (data: any) => {
  return request({
    url: `/cbs-app/lessonPlan/update`,
    method: 'post',
    data
  } as any)
}
/**
 * 教学计划详情
 */
export const lessonPlanDetail = (data: any) => {
  return request({
    url: `/cbs-app/lessonPlan/detail/${data}`,
    method: 'get'
  } as any)
}

/**
 * 获取教学计划关联课件
 */

export const getPlanDetail = (data: any) => {
  return request({
    url: `/cbs-app/lessonPlanDetail/pageByLessonPlanId`,
    method: 'post',
    data: data
  } as any)
}

/**
 *  获取可添加的教学计划
 */
export const getNotMinePlanDetail = (data: any) => {
  return request({
    url: `/cbs-app/lessonPlanDetail/pageNotMineByLessonPlanId`,
    method: 'post',
    data: data
  } as any)
}

/**
 * 关联课件
 */
export const addLessonPlanDetail = (data: any) => {
  return request({
    url: `/cbs-app/lessonPlanDetail/save`,
    method: 'post',
    data: data
  } as any)
}

/**
 * 删除课件
 */
export const removeLessonPlanDetail = (data: any) => {
  return request({
    url: `/cbs-app/lessonPlanDetail/remove`,
    method: 'post',
    data: data
  } as any)
}
/**
 * 课件内容详情
 */
export const lessonCoursewareDetailDetail = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/detail/${data}`,
    method: 'get'
  } as any)
}
/**
 * 课件内容分页
 */
export const lessonCoursewareDetailPage = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/page`,
    method: 'post',
    data
  } as any)
}
/**
 * 课件内容课程删除
 */
export const lessonCoursewareDetailRemove = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/remove?id=${data}`,
    method: 'post'
  } as any)
}
/**
 * 课件内容课程新增
 */
export const lessonCoursewareDetailSave = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/save`,
    method: 'post',
    data
  } as any)
}
/**
 * 课件内容课程修改
 */
export const lessonCoursewareDetailUpdate = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/update`,
    method: 'post',
    data
  } as any)
}
/**
 * 课件内容课程添加知识点
 */
export const lessonCoursewareDetailAddKnowledgePoint = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/addKnowledgePoint`,
    method: 'post',
    data
  } as any)
}
/**
 * 课件内容课程删除知识点
 */
export const lessonCoursewareDetailRemoveKnowledgePoint = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/removeKnowledgePoint`,
    method: 'post',
    data
  } as any)
}
/**
 * 课件内容课程知识点上移,下移
 */
export const lessonCoursewareDetailUpOrDownKnowledgePoint = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/upOrDownKnowledgePoint`,
    method: 'post',
    data
  } as any)
}
/**
 * 查询当前课时下知识点
 */
export const lessonCoursewareDetailPageKnowledgePoint = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/pageKnowledgePoint`,
    method: 'post',
    data
  } as any)
}
/**
 * 查询当前课时无关的知识点
 */
export const lessonCoursewareDetailPageKnowledgePointNotMine = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/pageKnowledgePointNotMine`,
    method: 'post',
    data
  } as any)
}

/**
 * 考点分页查询
 */
export const examinationKnowledgePointCategoryPage = (data: any) => {
  return request({
    url: `/cbs-app/examinationKnowledgePointCategory/page`,
    method: 'post',
    data
  } as any)
}
/**
 * 考点修改
 */
export const examinationKnowledgePointCategoryUpdate = (data: any) => {
  return request({
    url: `/cbs-app/examinationKnowledgePointCategory/update`,
    method: 'post',
    data
  } as any)
}
/**
 * 考点新增
 */
export const examinationKnowledgePointCategorySave = (data: any) => {
  return request({
    url: `/cbs-app/examinationKnowledgePointCategory/save`,
    method: 'post',
    data
  } as any)
}
/**
 * 考点删除
 */
export const examinationKnowledgePointCategoryDel = (data: any) => {
  return request({
    url: `/cbs-app/examinationKnowledgePointCategory/del?id=${data}`,
    method: 'post'
  } as any)
}

/**
 * 测试题库查询分页
 */
export const examinationQuestionPage = (data: any) => {
  return request({
    url: `/cbs-app/examinationQuestion/page`,
    method: 'post',
    data
  } as any)
}
/**
 * 测试题库查询分页,包含答案
 */
export const examinationQuestionPageAndAnswer = (data: any) => {
  return request({
    url: `/cbs-app/examinationQuestion/pageAndAnswer`,
    method: 'post',
    data
  } as any)
}
/**
 * 测试题库修改
 */
export const examinationQuestionUpdate = (data: any) => {
  return request({
    url: `/cbs-app/examinationQuestion/update`,
    method: 'post',
    data
  } as any)
}
/**
 * 测试题库详情
 */
export const examinationQuestionDetail = (data: any) => {
  return request({
    url: `/cbs-app/examinationQuestion/detail?examinationQuestionId=${data}`,
    method: 'get'
  } as any)
}
/**
 * 测试题库删除
 */
export const examinationQuestionRemove = (data: any) => {
  return request({
    url: `/cbs-app/examinationQuestion/remove?examinationQuestionId=${data}`,
    method: 'post'
  } as any)
}
/**
 * 测试题库新增
 */
export const examinationQuestionSave = (data: any) => {
  return request({
    url: `/cbs-app/examinationQuestion/save`,
    method: 'post',
    data
  } as any)
}
/**
 * 阶段自测查询分页
 */
export const unitExaminationPage = (data: any) => {
  return request({
    url: `/cbs-app/unitExamination/page`,
    method: 'post',
    data
  } as any)
}
/**
 * 阶段自测新增,修改(选题组卷)
 */
export const unitExaminationSave = (data: any) => {
  return request({
    url: `/cbs-app/unitExamination/save`,
    method: 'post',
    data
  } as any)
}
/**
 * 阶段自测新增(随机组卷)
 */
export const unitExaminationRandomSave = (data: any) => {
  return request({
    url: `/cbs-app/unitExamination/randomSave`,
    method: 'post',
    data
  } as any)
}
/**
 * 阶段自测删除
 */
export const unitExaminationRemove = (data: any) => {
  return request({
    url: `/cbs-app/unitExamination/remove?unitExaminationId=${data}`,
    method: 'post'
  } as any)
}
/**
 * 阶段自测启用停用
 */
export const unitExaminationEnable = (data: any) => {
  return request({
    url: `/cbs-app/unitExamination/enable?unitExaminationId=${data}`,
    method: 'post'
  } as any)
}
/**
 * 阶段自测详情
 */
export const unitExaminationDetail = (data: any) => {
  return request({
    url: `/cbs-app/unitExaminationDetail/detail/${data}`,
    method: 'get'
  } as any)
}
/**
 * 课件关联阶段自测
 */
export const lessonCoursewareExaminationMapperUpSet = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareExaminationMapper/upSet`,
    method: 'post',
    data
  } as any)
}
/**
 * 查询课件下的所有阶段自测
 */
export const lessonCoursewareExaminationMapperQueryAll = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareExaminationMapper/queryAll?lessonCoursewareId=${data}`,
    method: 'post'
  } as any)
}
/**
 * 获取课件阶段自测详情
 */
export const lessonCoursewareExaminationMapperDetail = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareExaminationMapper/detail?lessonCoursewareExaminationMapperId=${data}`,
    method: 'post'
  } as any)
}
/**
 * 课件里面的课程锁定
 */
export const lessonCoursewareDetailLock = (data: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/lock?id=${data.id}&lockFlag=${data.lockFlag}`,
    method: 'post'
  } as any)
}

/**
 * 课件导入,单元测验导入,课后训练导入
 */
export const api_openFileImportInfoSave = (data: any) => {
  return request({
    url: `/cbs-app/open/fileImportInfo/save`,
    method: 'post',
    data
  } as any)
}

/**
 * 课件导入,单元测验导入,课后训练导入
 */
export const api_removeTraining = (id: any) => {
  return request({
    url: `/cbs-app/lessonCoursewareDetail/removeTraining/` + id,
    method: 'post'
  } as any)
}