import request from '../../utils/request'

export function getDeptTree() {
    return request({
        url: '/settings/getDeptTree',
        method: 'get',
    })
}

export function getAllUsers(data) {
    return request({
        url: '/settings/getAllUsers',
        method: 'post',
        data
    })
}

export function getAllRoles() {
    return request({
        url: '/settings/getAllRoles',
        method: 'get',
    })
}

export function getUserRoles(code) {
    return request({
        url: '/settings/getUserRoles',
        method: 'get',
        params: {code},
    })
}

export function saveUserRoles(data) {
    return request({
        url: '/settings/saveUserRoles',
        method: 'post',
        data,
    })
}

export function addNewRole(name) {
    return request({
        url: '/settings/addNewRole',
        method: 'get',
        params: {name},
    })
}

export function getAllMenus() {
    return request({
        url: '/settings/getAllVueMenus',
        method: 'get',
    })
}

export function getRoleMenus(id) {
    return request({
        url: '/settings/getRoleVueMenus',
        method: 'get',
        params: {id},
    })
}

export function saveRoleMenus(data) {
    return request({
        url: '/settings/saveRoleVueMenus',
        method: 'post',
        data,
    })
}

export function modifyEmployeeInfo(data) {
    return request({
        url: '/settings/modifyEmployeeInfo',
        method: 'post',
        data,
    })
}
export function saveEmployeeInfo(data) {
    return request({
        url: '/settings/saveEmployeeInfo',
        method: 'post',
        data,
    })
}


