
import {
    WeaTools
} from 'ecCom'

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

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

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

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

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

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

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

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


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

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

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

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

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