fix(admin): 通知分页、登录过期提示、附件打开反馈与导出统一 loading

- 通知中心改为游标分页 + 加载更多,历史通知不再被 50 条上限截断;
  加载失败显示错误态与重试
- AI 流式请求 401 被登出时,登录页提示"登录已过期",不再无声踢出
- AI 附件/引用来源打开失败时给出明确错误提示,不再"点了没反应"
- 新增 useDownload hook:统一导出/下载的防重复、loading 与成功/失败反馈;
  接入学生/账单/房间/入住/费用五个页面的模板下载与导出按钮
- 学生页移除不检查响应状态的私有下载实现,统一走 downloadBlob
This commit is contained in:
2026-08-07 17:33:58 +08:00
parent 67435e46ca
commit 00e2bc5acf
14 changed files with 320 additions and 153 deletions

View File

@@ -58,6 +58,8 @@ export interface StudentsToolbarProps {
onUpdateImport: UploadProps['customRequest'];
onDownloadTemplate: () => void;
onExport: () => void;
templateLoading?: boolean;
exportLoading?: boolean;
}
export const StudentsToolbar: React.FC<StudentsToolbarProps> = ({
@@ -94,6 +96,8 @@ export const StudentsToolbar: React.FC<StudentsToolbarProps> = ({
onUpdateImport,
onDownloadTemplate,
onExport,
templateLoading,
exportLoading,
}) => {
const { modal } = App.useApp();
return (
@@ -273,6 +277,7 @@ export const StudentsToolbar: React.FC<StudentsToolbarProps> = ({
<PermissionButton
permission="student:view"
icon={<DownloadOutlined />}
loading={templateLoading}
onClick={onDownloadTemplate}
>
@@ -280,6 +285,7 @@ export const StudentsToolbar: React.FC<StudentsToolbarProps> = ({
<PermissionButton
permission="student:export"
icon={<ExportOutlined />}
loading={exportLoading}
onClick={onExport}
>