feat: DingTalk attendance import + integration config + expense types + UI polish

Server:
- Add DingTalk attendance import service with SSE progress streaming
- Add IntegrationConfig entity & module for multi-tenant DingTalk setup
- Add ExpenseType entity & ExpenseTypesModule
- Add SeedModule for DB initialization
- Add UserDingMapping entity for DingTalk user linkage
- Attendance service: import flow with dedup & student auto-mapping
- Rooms service: time-range overlap queries
- Sync controller/service: DingTalk integration wiring
- Permission guard: refactor to pure re-export
- Campus scope middleware: tenant-aware filtering

Admin UI:
- Attendance page: import UI with progress & result summary
- All pages: tableStyle/tablePagination standardization
- Login page: responsive styling
- Sensitive data: useViewSensitive hook for masked viewing
- Vite config: path aliases, build optimization
- Test infra: vitest config, test utilities

Docs: PRD DingTalk batch 1 & 2 design docs
This commit is contained in:
2026-07-09 09:11:56 +08:00
parent f1959f0d2a
commit 42d3f0e27f
71 changed files with 5331 additions and 609 deletions

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { List, Typography, Menu, Layout, Button, Empty, Spin, Space } from 'antd';
import { List, Typography, Menu, Layout, Button, Empty, Spin, Space, message } from 'antd';
import {
BellOutlined,
DollarOutlined,
@@ -57,7 +57,10 @@ const NotificationsPage: React.FC = () => {
try {
const data = await api.get('/notifications?limit=50') as unknown as NotificationItem[];
setNotifications(data);
} catch { /* ignore */ }
} catch (e: any) {
console.error('加载通知失败', e);
message.error(e?.message || '加载通知失败');
}
setLoading(false);
};
@@ -72,7 +75,10 @@ const NotificationsPage: React.FC = () => {
setNotifications((prev) =>
prev.map((n) => (n.id === item.id ? { ...n, isRead: true } : n)),
);
} catch { /* ignore */ }
} catch (e: any) {
console.error('标记已读失败', e);
message.error(e?.message || '标记已读失败');
}
}
if (item.link) navigate(item.link);
};
@@ -83,7 +89,10 @@ const NotificationsPage: React.FC = () => {
setNotifications((prev) =>
prev.map((n) => ({ ...n, isRead: true })),
);
} catch { /* ignore */ }
} catch (e: any) {
console.error('全部已读失败', e);
message.error(e?.message || '操作失败');
}
};
const filtered = filter === 'all'
@@ -121,7 +130,16 @@ const NotificationsPage: React.FC = () => {
const meta = typeMap[item.type] || { label: item.type, icon: <BellOutlined /> };
return (
<List.Item
role="button"
tabIndex={0}
aria-label={`通知: ${item.title}`}
onClick={() => handleClick(item)}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
handleClick(item);
}
}}
style={{
cursor: 'pointer',
padding: '16px 0',