import { HcApi } from '../../request/index'

export default {
    //分页
    async page(form) {
        return HcApi({
            url: '/api/blade-system/dept/list',
            method: 'get',
            params: form,
        }, false)
    },
    //懒加载列表
    async getLazyList(form) {
        return HcApi({
            url: '/api/blade-system/dept/lazy-list',
            method: 'get',
            params: form,
        }, false)
    },
    //详情
    async detail(id) {
        return HcApi({
            url: '/api/blade-system/dept/detail',
            method: 'get',
            params: {
                id,
            },
        }, false)
    },
    //新增和编辑
    async submit(form) {
        return HcApi({
            url: '/api/blade-system/dept/submit',
            method: 'post',
            data: form,
        }, false)
    },
    //删除
    async del(ids) {
        return HcApi({
            url: '/api/blade-system/dept/remove',
            method: 'post',
            params: {
                ids,
            },
        }, false)
    },
    async getDeptTree(tenantId) {
        return HcApi({
            url: '/api/blade-system/dept/tree',
            method: 'get',
            params: {
                tenantId,
            },
        }, false)
    },
    async getDeptLazyTree(parentId) {
        return HcApi({
            url: '/api/blade-system/dept/lazy-tree',
            method: 'get',
            params: {
                parentId,
            },
        }, false)
    },
}
