import {
	WeaTools
} from 'ecCom'

export const getRight = (params) => {
	return WeaTools.callApi('/api/hrm/ChangeRp/getHasRight', 'GET', params);
}

export const fetchAuthority = (params) => {
	return WeaTools.callApi('/api/hrm/ChangeRp/getHasRight', 'GET', params);
}

export const getSearchCondition = (params) => {
	return WeaTools.callApi('/api/hrm/resourceState/getSearchCondition', 'GET', params);
}

export const getSearchResult = (params) => {
	return WeaTools.callApi('/api/hrm/resourceState/getSearchResult', 'POST', params);
}

export const getSfChangeSearchCondition = (params, idy) => {
	if (idy == 'staff') {
		return WeaTools.callApi('/api/hrm/ChangeRp/getSearchCondition', 'GET', params);
	}
	if (idy == 'contract') {
		return WeaTools.callApi('/api/hrm/Contract/getSearchCondition', 'GET', params);
	}
}

export const getSfChangeSearchResult = (params, idy) => {
	if (idy == 'staff') {
		return WeaTools.callApi('/api/hrm/ChangeRp/getRpResult', 'POST', params);
	}
	if (idy == 'contract') {
		return WeaTools.callApi('/api/hrm/Contract/getRpResult', 'POST', params);
	}
}

export const exportExcel = (dataKey) => {
	return WeaTools.callApi('/api/ec/dev/table/export', 'POST', {
		dataKey: dataKey
	})
}