/*
 * @Author: wt 1241351815@qq.com
 * @Date: 2022-04-25 10:21:18
 * @LastEditors: wt 1241351815@qq.com
 * @LastEditTime: 2022-05-09 13:24:12
 * @FilePath: \securityHtml\src\api\system\orgnization.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'


export function deptAdd(params) { //新增部门
    return request({
        url: '/system/dept/add',
        method: 'post',
        params
    })
}

export function deptEdit(query) { //修改部门
    return request({
        url: '/system/dept/edit',
        method: 'post',
        data: query
    })
}

// 查询部门列表（排除节点）
export function listDeptExcludeChild(deptId) {
    return request({
        url: '/system/dept/list/exclude/' + deptId,
        method: 'get'
    })
}


// export function deptList(data) { //部门数据加载
//     return request({
//         url: '/system/dept/list',
//         method: 'get'
//     })
// }

// export function listDept(data) { //部门查询
//     return request({
//         url: '/system/dept/listDept',
//         method: 'post',
//         data
//     })
// }

export function listDept(params) { //部门查询=>全部
    return request({
        url: '/system/dept/treeselect',
        method: 'get',
        params: params
    })
}

export function treeselect(params) { //部门查询=>全部
    return request({
        url: '/system/dept/treeselect',
        method: 'get',
        params: params
    })
}


export function getDept(deptId) { //部门查询id
    return request({
        url: '/system/dept/roleDeptTreeselect/' + deptId,
        method: 'get'
    })
}


export function deptRemove(params) { //删除部门
    return request({
        url: '/system/dept/remove',
        method: 'get',
        params
    })
}