import request from '@/apps/mobile/utils/request'

//  app菜单查询
export function queryAppMenuList(data) {
    return request({
        method: 'post',
        url: '/api/appmenus/query-page',
        data,
    });
}

// app菜单新增
export function addAppMenu(data) {
    return request({
        method: 'post',
        url: '/api/appmenus/insert',
        data,
    });
}

// 查询app所有菜单权限
export function queryAppMenuPermission() {
    return request({
        method: 'get',
        url: '/api/appmenus/queryAll',
    });
}

// 修改app用户角色权限
export function updateAppMenuPermission(data) {
    return request({
        method: 'post',
        url: '/api/appuserMenus/updateUserMenu',
        data,
    });
}


// 根据app用户角色查权限
export function queryAppRolePermissionDetail(id) {
    return request({
        method: 'get',
        url: `/api/appuserMenus/getAllMenu?levelId=${id}`,
    });
}


// 查询app所有菜单-树形结构
export function queryAllTree() {
    return request({
        method: 'get',
        url: '/api/appmenus/queryAllTree',
    });
}

// 查询app所有父级菜单
export function queryAllParent() {
    return request({
        method: 'get',
        url: '/api/appmenus/queryAllParent',
    });
}

// 编辑app菜单
export function editAppmenus(data) {
    return request({
        method: 'put',
        url: '/api/appmenus/update',
        data,
    });
}
