import http from "@/api";
const MENUS = `/menus`;
const MENU = "/menu";
// 菜单树形
export const getRoleMenusListApi = () => {
    return http.get<any>(`${MENUS}`);
};
//树状列表
export const getMenusListApi = (params: any) => {
    return http.get<any>(`${MENU}/index`, params);
};
//删除
export const getMenusListDelApi = (params: any) => {
    return http.delete<any>(`${MENU}/delete/${params}`);
};
// 详情
export const getMenusListDetailsApi = (params: any) => {
    return http.get<any>(`${MENU}/read/${params}`);
};
//更新
export const getMenusListUpApi = (params: any) => {
    const { id } = params;

    return http.put<any>(`${MENU}/update/${id}`, params);
};
//新增
export const getMenusLisSaveApi = (params: any) => {
    return http.post<any>(`${MENU}/save`, params);
};
//导出
export const getMenusLisExportApi = (params: any) => {
    return http.get<any>(`${MENU}/export`, params, {
        responseType: "arraybuffer"
    });
};
//导入
export const getMenusLisImportApi = (params: any) => {
    return http.post<any>(`${MENU}/import`, params);
};
//排序
export const getMenusLisSortApi = (params: any) => {
    const { id, sort } = params;
    return http.post<any>(`${MENU}/sort/${id}`, { sort });
};
