import request from "@/utils/request";
import {BASE_URL} from '@/config';


export const getReportTemplateList = (params)=> {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/report/getSystemReportList`,
        params:{
            ...params,
            stage:3
        }
    });
};


export const saveReportTemplate = (data)=> {
    return request({
        method: 'post',
        url: `${BASE_URL}/exam-data/report/saveOrUpdateReportSystem`,
        data:{
            ...data,
            stage:3
        }
    });
};



export const deleteReportTemplate = (params)=> {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/report/delSysReport`,
        params:{
            ...params,
            stage:3
        }
    });
};


export const setupStandardTemplate = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/report/setDefaultReport`,
        params:{
            ...params,
            stage:3
        }
    });
}



export const getTemplateComponentList = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/report/getReportItemList`,
        params:{
            ...params,
            stage:3
        }
    });

};


export const saveTemplateComponent = (data) => {
    return request({
        method: 'post',
        url: `${BASE_URL}/exam-data/report/saveOrUpdateReportItem`,
        data:{
            ...data,
            stage:3
        }
    });
}

export const deleteComponent = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/report/delReportItem`,
        params:{
            ...params,
            stage:3
        }
    });
}


export const getSystemComponentList = () => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/report/getReportItemModelList`,
        params:{
            stage:3
        }
    });
}

/**
 * @function 获取个人报告
 */

export const getPersonalReport = () => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/report/getAllReportList`,
        params:{
            stage:3
        }
    });
}



/**
 * @function 复制模板
 */

export const copyTemplate = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/report/copyReport`,
        params:{
            ...params,
            stage:3
        }
    });
}



/**
 * @function 获取模板详情
 */
export const getTemplateDetail = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/report/getReport`,
        params:{
            ...params,
            stage:3
        }
    });
}


