import request from '../utils/request.js'
let teacherPrefix = import.meta.env.VITE_API_TEACHER_PRE 

// 查询授课关系表格数据
export const getTeachingRelationshipTableDataApi = (evaluationGradeId:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/teacherRelation/queryTeachingRelationData/${evaluationGradeId}`,
        method: 'get',
    })
}

// 查询教师列表 数据
export const getTeacherListDataApi = (data:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/teacherRelation/queryTableTeacher`,
        method: 'post',
        data
    })
}

// 保存授课关系
export const saveTeachingRelationshipApi = (data:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/teacherRelation/saveTeachingRelation`,
        method: 'post',
        data
    })
}

// 删除授课关系
export const deleteTeachingRelationshipApi = (id:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/teacherRelation/deleteTeachingRelation/${id}`,
        method: 'get',
    })
}


// 授课关系完成操作
export const finishTeachingRelationshipApi = (data:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/teacherRelation/finishTeachingRelationMuti`,
        method: 'post',
        data
    })
}

// 清空授课关系
export const clearTeachingRelationshipApi = (gradeId:any,classType:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/teacherRelation/removeTeachingRelation/${gradeId}/${classType}`,
        method: 'get',
    })
}

// 导入授课关系
export const importTeachingRelationshipApi = (data:any,urlData:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/teacherRelation/importTeachingRelation/${urlData.evaluationId}/${urlData.evaluationGradeId}/${urlData.classType}`,
        method: 'post',
        data,
    },)
}