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

export default {
    //加载菜单列表
    async page(form) {
        return HcApi({
            url: '/api/blade-system/topmenu/list',
            method: 'get',
            params: form,
        })
    },
    //菜单详情
    async detail(id) {
        return HcApi({
            url: '/api/blade-system/topmenu/detail',
            method: 'get',
            params: { id },
        })
    },
    //新增和编辑菜单
    async submit(form) {
        return HcApi({
            url: '/api/blade-system/topmenu/submit',
            method: 'post',
            data: form,
        })
    },
    //删除菜单
    async del(ids) {
        return HcApi({
            url: '/api/blade-system/topmenu/remove',
            method: 'post',
            params: { ids },
        })
    },
    //获取菜单数据
    async getData() {
        return HcApi({
            url: '/api/blade-system/menu/top-menu',
            method: 'get',
            params: {},
        })
    },
}
