
import {
    WeaTools
} from 'ecCom'

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

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

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

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

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

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

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

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

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

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