import request from '@/utils/request'

export function findTeacherByName(teacherName) {
    return request({
        url: '/knowledge/system/trainTeacher/findOneByName?teacherName='+teacherName,
        method: 'get'
    })
}
export function getTranUserTree() {
    return request({
        url: '/knowledge/system/train/getTree',
        method: 'get'
    })
}
export function getTranUserList(queryParams) {
    return request({
        url: '/knowledge/system/train/getTrainUser',
        method: 'get',
        params:queryParams
    })
}
export function coursewarePage(queryParams) {
    return request({
        url: '/knowledge/system/courseware/page',
        method: 'get',
        params:queryParams
    })
}
export function questionTree() {
    return request({
        url: '/knowledge/system/questionBank/tree',
        method: 'get'
    })
}

export function testpaperGeneration(data) {
    return request({
        url: '/knowledge/system/paperQuestionStem/testpaperGeneration',
        method: 'post',
        data
    })
}
export function trainInsert(data) {
    return request({
        url: '/knowledge/system/train/insert',
        method: 'post',
        data
    })
}
export function trainUpdate(data) {
    return request({
        url: '/knowledge/system/train/update',
        method: 'post',
        data
    })
}
export function trainFindInfo(id) {
    return request({
        url: '/knowledge/system/train/findInfo?id='+id,
        method: 'get'
    })
}
export function getTrainList(data) {
    return request({
        url: '/knowledge/system/train/findList',
        method: 'get',
        params: data
    })
}
export function delByIds(ids) {
    return request({
        url: '/knowledge/system/train/delete',
        method: 'post',
        params: {
            idList: ids
        }
    })
}
export function selectQuestionByIds(ids) {
    return request({
        url: '/knowledge/system/paperQuestionStem/changeType',
        method: 'post',
        params: {
            idList: ids
        }
    })
}
export function dealQuestion(data) {
    return request({
        url: '/knowledge/system/paperQuestionStem/changeTypeContent',
        method: 'post',
        data
    })
}
export function getTrainRecord(data) {
    return request({
        url: '/knowledge/system/trainRecord/findList',
        method: 'get',
        params:data
    })
}
export function getReportRecord(data) {
    return request({
        url: '/knowledge/system/trainReport/findList',
        method: 'get',
        params:data
    })
}
export function getReportDetail(id) {
    return request({
        url: '/knowledge/system/trainReport/findOne?id='+id,
        method: 'get'
    })
}
export function submitReport(data) {
    return request({
        url: '/knowledge/system/trainReport/getPdf',
        method: 'post',
        data
    })
}
export function createPdfByHtml(data) {
    return request({
        url: '/knowledge/system/trainReport/htmlToPdf',
        method: 'post',
        data
    })
}
export function findReportById(id) {
    return request({
        url: '/knowledge/system/trainReport/findByTrainId?trainId='+id,
        method: 'get'
    })
}

export function findListOwn(param) {
    return request({
        url: '/knowledge/system/trainRecord/findListOwn',
        method: 'get',
        params:param
    })
}
