import request from '@/utils/request'
import config from "@/config";


// 
export function get(params) {
    return request({
        url: '/front/syzy/xkbm/get',
        method: 'get',
        params: params
    })
}

// 志愿填报  科目和分数要求
export function getVoluntaryData(params) {
    return request({
        url: '/front/syzy/zytb/getVoluntaryData',
        method: 'get',
        params: params
    })
}


// 志愿填报  位次
export function getRankByScore(params) {
    return request({
        url: '/front/syzy/yfyd/getRankByScore',
        method: 'get',
        params: params
    })
}

// 志愿填报  01.填报批次
export function zytbBatches(params) {
    return request({
        url: '/front/syzy/zytb/batches',
        method: 'get',
        params: params
    })
}

// 获取推荐志愿表头
export function getVoluntaryHeaders(params) {
    return request({
        url: '/front/syzy/zytb/getVoluntaryHeaders',
        method: 'get',
        params: params
    })
}

// 志愿填报  志愿组
export function getRecommendVoluntary(data, params) {
    return request({
        url: '/front/syzy/zytb/getRecommendVoluntary',
        method: 'post',
        data: data,
        params: params
    })
}

// 志愿填报  专业
export function getVoluntaryMarjors(data) {
    return request({
        url: '/front/syzy/zytb/getVoluntaryMarjors',
        method: 'post',
        data: data
    })
}


// 志愿填报  04.志愿保存
export function saveZhiyuan(params) {
    return request({
        url: '/front/syzy/zytb/save',
        method: 'post',
        data: params
    })
}

// 获取志愿明细
export function getZhiyuanDetail(wishResId) {
    return request({
        url: '/front/syzy/zytb/recordDetail',
        method: 'get',
        params: {wishResId}
    })
}

// 填报批次  筛选条件
export function universityFilters(params) {
    return request({
        url: '/front/syzy/zytb/university/filters',
        method: 'get',
        data: params
    })
}


// 查询我的志愿表
export function selectZytbRecord(params) {
    return request({
        url: `/front/syzy/zytb/record`,
        method: 'get',
        params
    })
}

/**
 * 删除我的志愿表
 * @param params
 */
export function delZytbRecord(params) {
    return request({
        url: `/front/syzy/zytb/record/del`,
        method: 'get',
        params
    })
}

/* download voluntary simulated excel */
export function downloadRecommendReport(params) {
    return request({
        url: `/front/syzy/zytb/export`,
        method: 'get',
        responseType: 'arrayBuffer',
        params
    })
}

export function getDownloadRecommendReportOptionsForWap2App(params) {
    return {
        url: config.serverBaseUrl + '/front/syzy/zytb/export',
        params
    }
}

export function getVoluntarySpecialProjectFilter(params) {
    // params = { year } // 缺省年份返回当前年份的专项选项
    // returns ['专项A', '专项B', '专项C', '不看专项']
    // getRecommendVoluntary 新增参数specialProjects: Array // 原来的参数specialProjectNation，specialProjectLocal不动
    return request({
        url: `/front/syzy/zytb/specialProjectFilter`,
        method: 'get',
        params
    })
}