import request from '@/router/axios';

export const getList = (current, size, params) => {
    return request({
        url: '/api/galaxy-system/region/list',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const getChildrenList = () => {
    return request({
        url: '/api/galaxy-business/baseinfo/region/children/list',
        method: 'get',
    })
}

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


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

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

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

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

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

