Browse Source

feat (1.75.0 -> 1.75.1): 重构系统配置API响应结构,优化工作流配置处理并更新文档

- 在 options.ts 中重构 configResponse 数据结构,添加嵌套的 configs 数组
- 在 Workflow.tsx 中更新配置处理逻辑,适配新的API响应格式
- 更新 README.md 文档格式和部署命令

改动文件:
- CHANGELOG.md
- README.md
- package.json
- src/API/system/options.ts
- src/pages/system/SettingsModal/sections/Preferences/Workflow.tsx
szy 11 hours ago
parent
commit
01438c6df6
5 changed files with 45 additions and 37 deletions
  1. 14 0
      CHANGELOG.md
  2. 15 20
      README.md
  3. 1 1
      package.json
  4. 4 1
      src/API/system/options.ts
  5. 11 15
      src/pages/system/SettingsModal/sections/Preferences/Workflow.tsx

+ 14 - 0
CHANGELOG.md

@@ -2,6 +2,20 @@
 
 本项目的所有重要变更都将记录在此文件中.
 
+## [1.75.1] - 2026-01-20 10:20
+
+feat (1.75.0 -> 1.75.1): 重构系统配置API响应结构,优化工作流配置处理并更新文档
+
+- 在 options.ts 中重构 configResponse 数据结构,添加嵌套的 configs 数组
+- 在 Workflow.tsx 中更新配置处理逻辑,适配新的API响应格式
+- 更新 README.md 文档格式和部署命令
+
+改动文件:
+
+- README.md
+- src/API/system/options.ts
+- src/pages/system/SettingsModal/sections/Preferences/Workflow.tsx
+
 ## [1.75.0] - 2026-01-19 19:50
 
 feat (1.74.0 -> 1.75.0): 实现工作流设置表格拖拽排序功能,支持任务清单和历史清单的拖拽重新排序

+ 15 - 20
README.md

@@ -28,18 +28,6 @@
 
 根据部署环境选择对应的构建命令:
 
-### 浏览器环境(Web 服务器部署)
-
-适用于 Nginx 反向代理部署场景:
-
-```bash
-npm i
-npm run h5:browser
-```
-
-- API URL: 空字符串(由 Nginx 代理处理)
-- MQTT URL: `/mqtt`(相对路径)
-
 ### Electron 环境(桌面应用)
 
 适用于 Electron 桌面应用场景:
@@ -111,11 +99,13 @@ npm run pkg
 **目的**:将 `src/assets/i18n/messages/*.js` 文件转换为纯 JSON 格式,移除 JavaScript 语法(`export default` 和结尾的 `;`),方便用于其他用途(如后端API、文档生成等)。
 
 **使用方法**:
+
 ```bash
 node scripts/extract-i18n-json.js
 ```
 
 **输出文件**:
+
 - `scripts/output/i18n/zh.js` - 中文翻译(纯JSON格式,.js扩展名)
 - `scripts/output/i18n/en.js` - 英文翻译(纯JSON格式,.js扩展名)
 
@@ -155,6 +145,7 @@ dros.exe --enable-dev-menu
 ```
 
 **参数说明**:
+
 - `--enable-dev-menu` : 启用开发者菜单,包含Monkey Testing启动选项 , 如果期望点击 Toggle developer tools菜单项唤出开发者工具面板,需要同时传递启动选项 --enable-dev-tools
 - `--enable-dev-tools` : 启动时自动打开开发者工具(可选)
 
@@ -173,26 +164,30 @@ dros.exe --enable-dev-menu
 ## 测试期间功能
 
 ### 菜单自动隐藏
+
 - 测试启动后,应用菜单栏会自动隐藏,避免干扰测试
 - 使用快捷键 **Ctrl+Alt+M** 可以临时显示菜单
 - 菜单会在5秒后自动隐藏
 
 ### 停止测试
+
 测试会根据设置的持续时间或操作次数自动停止,也可以:
+
 - 再次按 **Ctrl+Alt+M** 显示菜单
 - 手动停止测试(需要添加停止功能)
 
 ## 参数说明
 
-| 参数 | 说明 | 默认值 | 单位 |
-|------|------|--------|------|
-| Interval | 每次操作的时间间隔 | 100 | 毫秒 |
-| Duration | 测试总持续时间 | 2147483646 | 毫秒 |
-| Max Operations | 最大操作次数限制 | 600000 | 次 |
+| 参数           | 说明               | 默认值     | 单位 |
+| -------------- | ------------------ | ---------- | ---- |
+| Interval       | 每次操作的时间间隔 | 100        | 毫秒 |
+| Duration       | 测试总持续时间     | 2147483646 | 毫秒 |
+| Max Operations | 最大操作次数限制   | 600000     | 次   |
 
 ## 操作类型
 
 Monkey Test 会随机执行以下操作:
+
 - 鼠标移动到随机位置
 - 鼠标左键点击
 - 鼠标双击
@@ -210,9 +205,9 @@ Monkey Test 会随机执行以下操作:
 
 - **Ctrl+Alt+M**: 测试期间临时显示/隐藏菜单
 - **F12**: 切换开发者工具(如果启用)
+
 # h5构建并部署到发布服务器
 
-在项目根目录下运行命令:
 ```
-node ./.build/deploy-h5.js
-```
+ nom run deploy:h5
+```

+ 1 - 1
package.json

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

+ 4 - 1
src/API/system/options.ts

@@ -26,7 +26,10 @@ export interface configResponse {
   code: string;
   description: string;
   solution: string;
-  data: configItem[];
+  data: {
+    '@type': string;
+    configs: configItem[];
+  };
 }
 
 // 获取配置的可选项

+ 11 - 15
src/pages/system/SettingsModal/sections/Preferences/Workflow.tsx

@@ -215,11 +215,9 @@ const Workflow: React.FC = () => {
 
     // 创建配置映射
     const configMap: Record<string, string> = {};
-    if (res?.data) {
-      res.data.forEach((config) => {
-        configMap[config.uri] = config.config_value;
-      });
-    }
+    (res.data?.configs || []).forEach((config) => {
+      configMap[config.uri] = config.config_value;
+    });
 
     // 获取特殊配置项并解析
     const workListFieldsStr = configMap['Patient/WorkListFields'] || '[]';
@@ -230,16 +228,14 @@ const Workflow: React.FC = () => {
 
     // 过滤掉特殊配置项,只保留普通配置项用于表单
     const formFieldsConfigs = {};
-    if (res?.data) {
-      res.data.forEach((config) => {
-        if (
-          config.uri !== 'Patient/WorkListFields' &&
-          config.uri !== 'Patient/HistoryListFields'
-        ) {
-          formFieldsConfigs[config.uri] = config.config_value;
-        }
-      });
-    }
+    (res.data.configs || []).forEach((config) => {
+      if (
+        config.uri !== 'Patient/WorkListFields' &&
+        config.uri !== 'Patient/HistoryListFields'
+      ) {
+        formFieldsConfigs[config.uri] = config.config_value;
+      }
+    });
 
     form.setFieldsValue(formFieldsConfigs);
   };