import { request } from '@umijs/max'; import { downLoadXlsx } from '@/utils/downloadfile'; // 查询菜单权限列表 export async function getMenuList(params?: API.System.MenuListParams, options?: { [key: string]: any }) { return request('/api/system/menu/list', { method: 'GET', headers: { 'Content-Type': 'application/json;charset=UTF-8', }, params, ...(options || {}), }); } // 查询菜单权限详细 export function getMenu(menuId: number, options?: { [key: string]: any }) { return request(`/api/system/menu/${menuId}`, { method: 'GET', ...(options || {}) }); } // 新增菜单权限 export async function addMenu(params: API.System.Menu, options?: { [key: string]: any }) { return request('/api/system/menu', { method: 'POST', headers: { 'Content-Type': 'application/json;charset=UTF-8', }, data: params, ...(options || {}) }); } // 修改菜单权限 export async function updateMenu(params: API.System.Menu, options?: { [key: string]: any }) { return request('/api/system/menu', { method: 'PUT', headers: { 'Content-Type': 'application/json;charset=UTF-8', }, data: params, ...(options || {}) }); } // 删除菜单权限 export async function removeMenu(ids: string, options?: { [key: string]: any }) { return request(`/api/system/menu/${ids}`, { method: 'DELETE', ...(options || {}) }); } // 查询菜单权限详细 export function getMenuTree() { return request('/api/system/menu/treeselect', { method: 'GET', }); }