Преглед на файлове

feat: 在系统设置中添加'关于系统'模块,显示版本信息 (v1.18.2 -> v1.19.0)

- 创建 AboutSystem 组件展示系统名称、版本号和项目标识
- 在 SystemHome 组件索引中导出 AboutSystem
- 在配置文件中添加 about_system 配置项
- 直接从 package.json 读取版本号,确保版本信息自动同步
- 使用 Ant Design Descriptions 和 Card 组件实现信息展示
- 在系统设置的'系统之家'分类中,'软件许可'之后添加新模块

改动文件:
- src/pages/system/SettingsModal/sections/SystemHome/AboutSystem.tsx (新增)
- src/pages/system/SettingsModal/sections/SystemHome/index.tsx
- src/pages/system/SettingsModal/config.tsx
- CHANGELOG.md
- package.json (版本更新: 1.18.2 -> 1.19.0)
dengdx преди 3 седмици
родител
ревизия
d1c1f2e403

+ 38 - 0
CHANGELOG.md

@@ -2,6 +2,44 @@
 
 本项目的所有重要变更都将记录在此文件中。
 
+## [1.19.0] - 2025-12-22 14:46
+
+### 新增 (Added)
+- **系统设置中添加"关于系统"模块** - 实现系统版本信息展示功能
+  - 创建 AboutSystem 组件,展示系统名称、版本号和项目标识
+  - 使用 Ant Design Descriptions 和 Card 组件实现信息展示
+  - 直接从 package.json 读取版本号,确保版本信息自动同步
+  - 在系统设置的"系统之家"分类中添加"关于系统"二级模块
+  - 模块位于"软件许可"之后,方便用户快速查看系统版本信息
+
+**核心功能实现:**
+- 版本信息展示:显示系统名称(医学成像系统)、当前版本(1.19.0)和项目标识(zsis)
+- 自动同步:版本号直接从 package.json 读取,无需手动维护
+- 界面设计:与现有 SiteInfo 组件保持一致的布局风格
+- 配置管理:在系统设置配置中添加 about_system 配置项
+
+**技术实现:**
+- 创建 AboutSystem.tsx 组件
+  - 使用 `import packageJson from '../../../../../package.json'` 导入版本信息
+  - 添加 @ts-ignore 注释处理 TypeScript 类型检查
+  - 使用 Descriptions 组件展示系统信息
+  - 使用 Card 组件包裹,保持视觉一致性
+- 更新 SystemHome/index.tsx
+  - 导出 AboutSystem 组件
+  - 添加"关于系统 - 已实现"注释
+- 更新 config.tsx
+  - 在 software_license 后添加 about_system 配置项
+  - 配置 id、title 和 component 属性
+
+**改动文件:**
+- src/pages/system/SettingsModal/sections/SystemHome/AboutSystem.tsx (新增)
+- src/pages/system/SettingsModal/sections/SystemHome/index.tsx
+- src/pages/system/SettingsModal/config.tsx
+- CHANGELOG.md
+- package.json (版本更新: 1.18.2 -> 1.19.0)
+
+---
+
 ## [1.18.2] - 2025-12-22 14:07
 
 ### 修复 (Fixed)

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "zsis",
-  "version": "1.18.2",
+  "version": "1.19.0",
   "private": true,
   "description": "医学成像系统",
   "main": "main.js",

+ 5 - 0
src/pages/system/SettingsModal/config.tsx

@@ -81,6 +81,11 @@ export const settingsConfig: SettingsCategory[] = [
         title: '软件许可',
         component: SystemHome.SoftwareLicense,
       },
+      {
+        id: 'about_system',
+        title: '关于系统',
+        component: SystemHome.AboutSystem,
+      },
     ],
   },
   {

+ 49 - 0
src/pages/system/SettingsModal/sections/SystemHome/AboutSystem.tsx

@@ -0,0 +1,49 @@
+/**
+ * 关于系统页面
+ * 显示系统的基本信息和版本号
+ */
+import React from 'react';
+import { Typography, Descriptions, Card } from 'antd';
+import { SPACING } from '../../constants';
+
+const { Title } = Typography;
+
+// 导入 package.json 获取版本信息
+// @ts-ignore - package.json 导入在运行时有效
+import packageJson from '../../../../../../package.json';
+
+/**
+ * 关于系统组件
+ * 
+ * 布局结构:
+ * - Layout Type: Vertical Stack Layout
+ * - 使用 Descriptions 组件展示系统信息
+ */
+const AboutSystem: React.FC = () => {
+  return (
+    <div style={{ padding: SPACING.LG }}>
+      <Title level={3}>关于系统</Title>
+
+      <Card style={{ marginTop: SPACING.LG }}>
+        <Descriptions
+          column={1}
+          labelStyle={{ width: 150, fontWeight: 500 }}
+        >
+          <Descriptions.Item label="系统名称">
+            {packageJson.description || packageJson.name}
+          </Descriptions.Item>
+
+          <Descriptions.Item label="当前版本">
+            {packageJson.version}
+          </Descriptions.Item>
+
+          <Descriptions.Item label="项目标识">
+            {packageJson.name}
+          </Descriptions.Item>
+        </Descriptions>
+      </Card>
+    </div>
+  );
+};
+
+export default AboutSystem;

+ 3 - 0
src/pages/system/SettingsModal/sections/SystemHome/index.tsx

@@ -7,6 +7,9 @@ import PlaceholderSection from '../PlaceholderSection';
 // 站点信息 - 已实现
 export { default as SiteInfo } from './SiteInfo';
 
+// 关于系统 - 已实现
+export { default as AboutSystem } from './AboutSystem';
+
 // 用户账户
 export const UserAccount: React.FC = () => (
   <PlaceholderSection title="用户账户" />