/*
 *    Copyright (c) 2018-2025, cyweb All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 */

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

/**
 * 获取列表
 * @param query 查询参数
 */
export function fetchList(query?: any) {
	return request({
		url: '/professional/professionalqualificationrelation/page',
		method: 'get',
		params: query,
	});
}

/**
 * 添加对象
 * @param obj 对象数据
 */
export function addObj(obj?: any) {
	return request({
		url: '/professional/professionalqualificationrelation/add',
		method: 'post',
		data: obj,
	});
}

/**
 * 添加职业资格关系
 * @param obj 对象数据
 */
export function addQuaRelation(obj?: any) {
	return request({
		url: '/professional/professionalqualificationrelation/add',
		method: 'post',
		data: obj,
	});
}

/**
 * 获取对象
 * @param id 对象ID
 */
export function getObj(id: string | number) {
	return request({
		url: '/professional/professionalqualificationrelation/getById',
		method: 'get',
		params: {
			id: id
		}
	});
}

/**
 * 删除对象
 * @param id 对象ID
 */
export function delObj(id: string | number) {
	return request({
		url: '/professional/professionalqualificationrelation/deleteById',
		method: 'post',
		data: {
			id: id
		}
	});
}

/**
 * 删除职业资格对象
 * @param id 对象ID
 */
export function delQuaObj(id: string | number) {
	return request({
		url: '/professional/professionalqualificationrelation/deleteById',
		method: 'post',
		data: {
			id: id
		}
	});
}

/**
 * 更新对象
 * @param obj 对象数据
 */
export function putObj(obj?: any) {
	return request({
		url: '/professional/professionalqualificationrelation/edit',
		method: 'post',
		data: obj,
	});
}

/**
 * 审核对象
 * @param obj 对象数据
 */
export function examObj(obj?: any) {
	return request({
		url: '/professional/professionalqualificationrelation/exam',
		method: 'post',
		data: obj,
	});
}

/**
 * 获取图表选项
 */
export function getChartOption() {
	return request({
		url: '/professional/professionalqualificationrelation/getChartOption',
		method: 'get',
	});
}

/**
 * 获取职业资格统计信息
 */
export function quaCountInfo() {
	return request({
		url: '/professional/professionalqualificationrelation/countInfo',
		method: 'get',
	});
}

/**
 * 导出Excel
 * @param data 查询参数
 */
export function exportExcel(data: any) {
	return request({
		url: '/professional/professionalqualificationrelation/exportExcel',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}

