feat(web): 提取共享基础组件 — dayjs/format/EntityName/FilterBar/PageContainer/DrawerForm

- utils/dayjs.ts: 集中初始化 relativeTime 插件 + zh-cn locale
- utils/format.ts: formatDate/formatDateTime/formatRelative/calcAge
- components/EntityName.tsx: UUID→姓名兜底显示
- components/FilterBar.tsx: 统一筛选栏容器
- components/PageContainer.tsx: 统一页面容器(标题+筛选+表格+暗色模式)
- components/DrawerForm.tsx: 抽屉式表单容器(分组+双列网格)
- AlertList.tsx: 迁移到集中 dayjs 导入
This commit is contained in:
iven
2026-04-28 01:45:48 +08:00
parent 16a776c213
commit 5b47f13ecf
7 changed files with 253 additions and 6 deletions

View File

@@ -10,9 +10,7 @@ import {
} from 'antd';
import { CheckOutlined, StopOutlined } from '@ant-design/icons';
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import 'dayjs/locale/zh-cn';
import { dayjs } from '../../utils/dayjs';
import {
listAlerts,
acknowledgeAlert,
@@ -22,9 +20,6 @@ import {
import { AuthButton } from '../../components/AuthButton';
import { useThemeMode } from '../../hooks/useThemeMode';
dayjs.extend(relativeTime);
dayjs.locale('zh-cn');
// --- 常量映射 ---
const STATUS_OPTIONS = [