import { WeaTools } from 'ecCom' export const getSearchList = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/listPage', 'GET', params); } export const getAdvanceSearchCondition = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSearchCondition', 'GET', params); } export const add = (params) => { return fetch('/api/bs/hrmorganization/hrmresource/saveBaseForm', { method: 'POST', mode: 'cors', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(params) }) } export const getSchemeForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getSaveForm', 'GET', params); } export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getHasRight', 'GET', params); } export const editResource = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/updateForm', 'POST', params); } export const getResourceExtendForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getBaseForm', 'GET', params); } export const version = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/version/resourcefielddefined/save', 'POST', params); } export const exportResource = (ids) => { fetch('/api/bs/hrmorganization/common/resource/export?ids='+ids).then(res => res.blob().then(blob => { var filename=`人员档案.xlsx` var a = document.createElement('a'); var url = window.URL.createObjectURL(blob); a.href = url; a.download = filename; a.click(); window.URL.revokeObjectURL(url); })) } export const saveSearchTemplate = (params) => { return fetch('/api/bs/hrmorganization/hrmresource/saveSearchTemplate', { method: 'POST', mode: 'cors', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(params) }) } export const deleteSearchTemplate = (params) => { return fetch('/api/bs/hrmorganization/hrmresource/deleteSearchTemplate', { method: 'POST', mode: 'cors', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(params) }) } export const getSearchTemplate = (id) => { return WeaTools.callApi(`/api/bs/hrmorganization/hrmresource/getSearchTemplate?templateId=${id}`, 'GET'); } export const getTemplateSelectKeys = (id) => { return WeaTools.callApi(`/api/bs/hrmorganization/hrmresource/getTemplateSelectKeys?templateId=${id}`, 'GET'); }