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

// 查询学年列表
export const getSchoolYearListApi = () => {
    return request({
        url: `${teacherPrefix}/api/v1/evaluation/querySchoolYearData`,
        method: 'get',
    })
}

// 查询年级列表
export const getGradeListApi = () => {
    return request({
        url: `${teacherPrefix}/api/v1/evaluation/querySchoolGrade?schoolYearId=`,
        method: 'get',
    })
}


// 查询 问卷评价任务列表
export const getQuestionnaireTaskListApi = (data:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/evaluation/queryEvaluationList`,
        method: 'post',
        data
    })
}

// 新增评价任务
export const addQuestionnaireTaskListApi = (data:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/evaluation/addEvaluation`,
        method: 'post',
        data
    })
}

// 修改评价任务
export const editQuestionnaireTaskListApi = (data:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/evaluation/updateEvaluation`,
        method: 'post',
        data
    })
}


// 开启/关闭任务
export const oppenOrCloseQuestionnaireTaskApi = (id:any,openStatus:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/evaluation/openCloseEvaluation/${id}/${openStatus}`,
        method: 'get',
    })
}

// 删除评价任务数据
export const deleteQuestionnaireTaskApi = (id:any) => {
    return request({
        url: `${teacherPrefix}/api/v1/evaluation/deleteEvaluation/${id}`,
        method: 'get',
    })
}