
import {
    WeaTools
} from 'ecCom'

export const getSearchList = (params) => {
    return fetch('/api/bs/hrmorganization/job/listPage', {
        method: 'POST',
        mode: 'cors',
        headers: {
            'Content-Type': 'application/json'
        },
        body: JSON.stringify(params)
    })
}

export const deleteTableData = (params) => {
    return fetch('/api/bs/hrmorganization/job/deleteByIds', {
        method: 'POST',
        mode: 'cors',
        headers: {
            'Content-Type': 'application/json'
        }, 
        body: JSON.stringify(params)
    })
}

export const getAdvanceSearchCondition = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/job/getSearchCondition', 'GET', params);
}

export const getHrmListByJobId = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/job/getHrmListByJobId', 'GET', params);
}

export const getCopyForm = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/job/getCopyForm', 'GET', params);
}

export const refresh = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/job/refresh', 'GET', params);
}

export const add = (params) => {
    return fetch('/api/bs/hrmorganization/job/saveBaseForm', {
        method: 'POST',
        mode: 'cors',
        headers: {
            'Content-Type': 'application/json'
        }, 
        body: JSON.stringify(params)
    })
}

export const copy = (params) => {
    return fetch('/api/bs/hrmorganization/job/copyJobItem', {
        method: 'POST',
        mode: 'cors',
        headers: {
            'Content-Type': 'application/json'
        }, 
        body: JSON.stringify(params)
    })
}

export const editResource = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/job/updateForm', 'POST', params);
}

export const updateForbiddenTag = (params) => {
    return fetch('/api/bs/hrmorganization/job/updateForbiddenTagById', {
        method: 'POST',
        mode: 'cors',
        headers: {
            'Content-Type': 'application/json'
        }, 
        body: JSON.stringify(params)
    })
}

export const getJobForm = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/job/getSaveForm', 'GET', params);
}

export const getSchemeInfo = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/sequence/getSchemeInfo', 'GET', params);
}

export const getJobExtendForm = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/job/getJobBaseForm', 'GET', params);
}

export const getHasRight = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/job/getHasRight', 'GET', params);
}

export const getLevelId = (params) => {
    return WeaTools.callApi('/api/bs/hrmorganization/grade/getLevelId', 'GET', params);
}

export const getMergeForm = (params = {}) => {
    return WeaTools.callApi('/api/bs/hrmorganization/job/getMergeForm', 'GET', params);
}

export const merge = (params) => {
    return fetch('/api/bs/hrmorganization/job/mergeJob', {
        method: 'POST',
        mode: 'cors',
        headers: {
            'Content-Type': 'application/json'
        }, 
        body: JSON.stringify(params)
    })
}