import {
	WeaTools
} from 'ecCom'
//获取导入表单
export const getImportForm = (params) => {
	const {
		importType
	} = params;

	const str = importType === 'holidaySet' ? 'holidayset' : 'balanceofleave';

	let type = 'GET';
	if (str == 'balanceofleave') {
		type = 'POST';
	}

	return WeaTools.callApi(`/api/kq/${str}/getImportForm`, type, params);
}
//导入文件提交
export const saveImport = (params) => {
	const {
		importType
	} = params;

	const str = importType === 'holidaySet' ? 'holidayset' : 'balanceofleave';

	return WeaTools.callApi(`/api/kq/${str}/saveImport`, 'POST', params);
}
//获取导入结果回调数据
export const getImportProcessLog = (params) => {
	return WeaTools.callApi(`/api/kq/importlog/getImportProcessLog`, 'GET', params);
}
//获取导入结果
export const getImportResult = (params) => {
	return WeaTools.callApi(`/api/kq/importlog/getImportResult`, 'GET', params);
}
//历史导入信息查询
export const getImportHistory = (params) => {
	return WeaTools.callApi(`/api/kq/importlog/getImportHistory`, 'GET', params);
}
//导入日志
export const getImportLogDetail = (params) => {
	return WeaTools.callApi(`/api/kq/importlog/getImportColResultLog`, 'GET', params);
}
//导入日志 - 高级搜索
export const getImportLogSearchCondition = (params) => {
	return WeaTools.callApi(`/api/kq/importlog/getHistorySearchCondition`, 'GET', params);
}