import request from '@/utils/request'

const api = {
    list: '/sys/dictionary/item/list',
    findMaxValue: '/sys/dictionary/item/findMaxValue',
    get: '/sys/dictionary/item/get',
    add: '/sys/dictionary/item/add',
    del: '/sys/dictionary/item/del',
    edit: '/sys/dictionary/item/edit',

    certificateList: '/archives/certificate/listPage',
    addCertificate: '/person/certificate/add',
    certificateDetail: '/person/certificate/detail',
    delCertificate: '/person/certificate/del',
    certificateExport: 'person/certificate/export'
}

// 证书类型 列表
export function getCertificateTypeList(params) {
    return request({
        url: api.list,
        method: 'get',
        params: params
    })
}

// 查询最大词典项值 列表
export function getCertificateTypeMaxValue(params) {
    return request({
        url: api.findMaxValue,
        method: 'get',
        params: params
    })
}

// 根据ID查询证书类型 列表
export function getCertificateType(params) {
    return request({
        url: api.get,
        method: 'post',
        params: params
    })
}

// 证书类型 新增
export function addCertificateType(params) {
    return request({
        url: api.add,
        method: 'post',
        data: params
    })
}

// 证书类型 删除
export function delCertificateType(params) {
    return request({
        url: api.del,
        method: 'post',
        params: params
    })
}

// 证书类型 修改
export function editCertificateType(params) {
    return request({
        url: api.edit,
        method: 'post',
        data: params
    })
}

// 证书列表
export function getArchivesCertificatelist(params) {
    return request({
        url: api.certificateList,
        method: 'get',
        params: params
    })
}

// 新增人员证书
export function addPersonCertificate(params) {
    return request({
        url: api.addCertificate,
        method: 'post',
        data: params
    })
}

// 获取证书详情
export function findPersonCertificateDetail(params) {
    return request({
        url: api.certificateDetail,
        method: 'get',
        params: params
    })
}

// 删除人员证书
export function delCertificate(params) {
    return request({
        url: api.delCertificate,
        method: 'post',
        params: params
    })
}

// 导出证书详情
export function exportCertificate(params) {
    return request({
        url: api.certificateExport,
        method: 'get',
        params: params
    })
}