feat(user): 添加用户列表导出功能
- 新增 exportUsers API 接口用于导出用户数据 - 在用户管理页面添加导出按钮,仅超级管理员可见- 实现 handleExport 方法处理导出逻辑 - 使用 xlsx 库生成 Excel 文件并自动下载 - 添加搜索处理方法 handleSearch 优化查询体验 - 引入 computed 属性获取当前登录用户信息 - 更新搜索框事件处理为 handleSearch 方法- 调整导入/导出按钮显示权限控制逻辑
This commit is contained in:
@@ -282,3 +282,17 @@ export async function listAdminsByPhoneAll(params?: UserParam){
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户列表
|
||||
*/
|
||||
export async function exportUsers(params?: UserParam) {
|
||||
const res = await request.get<Blob>(
|
||||
SERVER_API_URL + '/system/user/export',
|
||||
{
|
||||
params,
|
||||
responseType: 'blob'
|
||||
}
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user