import {
    WeaTools
} from 'ecCom'

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

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

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

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

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

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

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

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


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

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