import request from '@/router/axios';

export const getPage = (current, size, params) => {
    return request({
        url: '/api/galaxy-business/baseinfo/org/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}


export const remove = (ids) => {
    return request({
        url: '/api/galaxy-business/baseinfo/org/remove',
        method: 'post',
        params: {
            ids,
        }
    })
}

export const add = (row) => {
    return request({
        url: '/api/galaxy-business/baseinfo/org/save',
        method: 'post',
        data: row
    })
}

export const update = (row) => {
    return request({
        url: '/api/galaxy-business/baseinfo/org/update',
        method: 'post',
        data: row
    })
}

export const getDetail = (id) => {
    return request({
        url: '/api/galaxy-business/baseinfo/org/detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const getLazyTree = (parentId, params) => {
    return request({
        url: '/api/galaxy-business/base/org/lazy-tree',
        method: 'get',
        params: {
            ...params,
            parentId
        }
    })
}

export const getTree = () => {
    return request({
        url: '/api/galaxy-business/base/org/tree',
        method: 'get',
    })
}

export const getOrgTree = (orgId) => {
    return request({
        url: '/api/galaxy-business/base/org/tree/' + orgId,
        method: 'get',
    })
}

