import axios from 'axios';
import {
    openFile, downloadFile,
    req,
    reqNull
} from './axiosFun';
let url = process.env.VUE_APP_API;
let title = process.env.VUE_APP_TITLE;
let yunxueUrl =  process.env.VUE_APP_YUNXUE_URL;
export const baseUrl = url;
export const titleName = title;
export const yunUrl =  yunxueUrl;
// -----------------------------------------
// 登录
export const login = (params) => {
    return reqNull("post", url + "/qualifications-service/users/login", params)
}

//获取单位列表
export const getDeptList = () => {
    return reqNull("get", url + "/qualifications-service/users/getDeptList")
}

// 任职资格序列列表
export const getQualificationSequenceList = (params) => {
    return req("get", url + "/qualifications-service/job-applications/getQualificationSequenceList?orgCode="+params.orgCode)
}
//获取绩点规则
export const getPerformanceRuleList = (params) => {
    return req("post", url + "/qualifications-service/job-applications/getPerformanceRuleList",  params)
}

//获取任职申请校验规则
export const getAppCheck = (params) => {
    return req("post", url + "/qualifications-service/job-applications/getAppCheck",  params)
}

//获取课程清单
export const getCourseList = (params) => {
    return req("post", url + "/qualifications-service/job-applications/courseList",  params)
}


// 提交任职申请
export const submitQualificationApplication = (params) => {
    return req("post", url + "/qualifications-service/job-applications/submitQualificationApplication", params)
}

// 获取信息内置列表
export const getInternalInformationList = (params) => {
    return req("post", url + "/qualifications-service/internal-informations/getInternalInformationList",params)
}

// 新增信息内置列表
export const addPositionSequenceLevel = (params) => {
    return req("post", url + "/qualifications-service/internal-informations/addPositionSequenceLevel",params)
}

// 修改信息内置列表
export const editInternalInformation = (params) => {
    return req("post", url + "/qualifications-service/internal-informations/modifyPositionSequenceLevel",params)
}

// 删除信息内置列表
export const deletePositionSequenceLevel = (params) => {
    return req("post", url + "/qualifications-service/internal-informations/deletePositionSequenceLevel",params)
}

// 获取已申报任职资格列表
export const getDeclaredQualificationList = (params) => {
    return req("post", url + "/qualifications-service/job-applications/getDeclaredQualificationList",params)
}

// 获取资格审核列表
export const getQualificationAuditList = (params) => {
    return req("post", url + "/qualifications-service/job-applications/getQualificationAuditList",params)
}

//发送修改密码验证码
export const sendCode = (params) => {
    return req("post", url + "/qualifications-service/users/captcha",params)
}

//修改密码
export const updatePwd = (params) => {
    return req("post", url + "/qualifications-service/users/updatePwd",params)
}

// 获取是否有学习考试进行中
export const isLearningExamInProgress = (params) => {
    return req("post", url + "/qualifications-service/job-applications/isLearningExamInProgress",params)
}

// 获取员工基本信息
export const queryBasicInformation = (params) => {
    return req("post", url + "/qualifications-service/job-applications/queryBasicInformation",params)
}

// 获取专业回馈类型列表
export const getProfessionalFeedbackCategoryList = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/getProfessionalFeedbackCategoryList",params)
}
//获取专业回馈定义列表
export const getProfessionalFeedbackDefineList = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/getProfessionalFeedbackDefineList",params)
}
// 获取专业回馈类型结构
export const getProfessionalFeedbackCategoryStruct = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/getProfessionalFeedbackCategoryStruct",params)
}


// 获取专业回馈单位列表
export const getProfessionalFeedbackUnitList = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/getProfessionalFeedbackUnitList",params)
}

// 获取专业回馈角色列表
export const getProfessionalFeedbackRoleList = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/getProfessionalFeedbackRoleList",params)
}

//获取专业回馈层级列表
export const getProfessionalFeedbackHierarchyList = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/getProfessionalFeedbackHierarchyList",params)
}

// 获取专业回馈列表
export const getProfessionalFeedbackList = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/getProfessionalFeedbackList",params)
}
// 根据角色获取专业回馈列表
export const getProfessionalFeedbackByRoleList = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/getProfessionalFeedbackByRoleList",params)
}


//提交专业回馈
export const submitProfessionalFeedback = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/addProfessionalFeedbackInfo",params)
}
//专业回馈审核通过
export const professionalFeedbackAuditApproval = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/professionalFeedbackAuditApproval",params)
}
//专业回馈审核驳回
export const professionalFeedbackAuditRejection = (params) => {
    return req("post", url + "/qualifications-service/professional-feedbacks/professionalFeedbackAuditRejection",params)
}

// 获取任职资格管理办法
export const getQualificationManagementMeasures = (params) => {
    return req("post", url + "/qualifications-service/internal-informations/getQualificationManagementMeasures",params)
}
// 下载任职资格管理办法最新
export const downloadQualificationManagementMeasures = (params, filename) => {
    return downloadFile("post", url + "/qualifications-service/internal-informations/downloadQualificationManagementMeasures",params,filename)
}

//下载任职资格标准
export const downloadQualificationStandard = (params, filename) => {
    return downloadFile("post", url + "/qualifications-service/internal-informations/downloadQualificationStandard",params, filename)
}

//取消预览
export const cancelPreview = (params) => {
    return req("post", url + "/qualifications-service/users/cancelPreview",params)
}

//获取字典信息
export const getDictionary = (params) => {
    return req("post", url + "/qualifications-service/dictionary/getDictionary",params)
}

//下载专业回馈附件
export const downloadProfessionalFeedbackAttachment = (params, filename) => {
    return downloadFile("post", url + "/qualifications-service/professional-feedbacks/downloadProfessionalFeedbackAttachment",params, filename)
}

//浏览器打开专业回馈附件
export const openProfessionalFeedbackAttachment = (params, filename, fileType) => {
    return openFile("post", url + "/qualifications-service/professional-feedbacks/downloadProfessionalFeedbackAttachment",params, filename,fileType)
}


//下载个人行为举证附件
export const downloadPersonalBehaviorEvidenceAttachment = (params, filename) => {
    return downloadFile("post", url + "/qualifications-service/behavior-evidences/downloadPersonalBehaviorEvidenceAttachment",params, filename)
}

export const openPersonalBehaviorEvidenceAttachment = (params, filename, fileType) => {
    return openFile("post", url + "/qualifications-service/behavior-evidences/downloadPersonalBehaviorEvidenceAttachment",params, filename,fileType)
}

//提交个人行为举证
export const addPersonalBehaviorEvidence = (params) => {
    return req("post", url + "/qualifications-service/behavior-evidences/addPersonalBehaviorEvidence",params)
}

//获取个人行为举证
export const getPersonalBehaviorEvidenceList = (params) => {
    return req("post", url + "/qualifications-service/behavior-evidences/getPersonalBehaviorEvidenceList",params)
}

//资格审核
export const qualificationAuditStatus = (params) => {
    return req("post", url + "/qualifications-service/job-applications/qualificationAuditStatus",params)
}


