Explorar el Código

fix (1.57.5 -> 1.57.6): 修复 bug 199 - 添加离开图像处理流程时的清理逻辑,再次进入处理时单分格

- 在 businessFlowMiddlewareLogic.ts 中添加离开process流程的判断和处理
- 添加 resetViewerContainer 的导入和调用,重置viewer容器状态
- 新增 isLeavingProcess 函数用于判断离开process的条件

改动文件:
- src/states/businessFlowMiddlewareLogic.ts
dengdx hace 6 días
padre
commit
debb80032b
Se han modificado 3 ficheros con 27 adiciones y 2 borrados
  1. 13 0
      CHANGELOG.md
  2. 1 1
      package.json
  3. 13 1
      src/states/businessFlowMiddlewareLogic.ts

+ 13 - 0
CHANGELOG.md

@@ -3,6 +3,19 @@
 本项目的所有重要变更都将记录在此文件中.
 
 
+## [1.57.6] - 2026-01-07 13:31
+
+### 修复 (Fixed)
+
+- **修复 bug 199 - 添加离开图像处理流程时的清理逻辑** - 在业务流程中间件中添加离开process流程的判断和清理机制,再次进入处理时单分格
+  - 添加 resetViewerContainer 的导入和调用,重置viewer容器状态
+  - 新增 isLeavingProcess 函数用于判断离开process的条件
+  - 确保离开图像处理时正确清理相关状态,避免状态残留问题
+
+**改动文件:**
+
+- src/states/businessFlowMiddlewareLogic.ts
+
 ## [1.57.5] - 2026-01-07 13:03
 
 ### 修复 (Fixed)

+ 1 - 1
package.json

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

+ 13 - 1
src/states/businessFlowMiddlewareLogic.ts

@@ -20,6 +20,7 @@ import {
 import { executeRegisterLogic } from '@/domain/patient/registerLogic';
 import registerToExam from '@/domain/patient/registerToExam';
 import { addWork, clearWorks } from './exam/examWorksCacheSlice';
+import { resetViewerContainer } from './view/viewerContainerSlice';
 
 let continueBusinessFlow = '';
 
@@ -272,7 +273,15 @@ const businessFlowMiddlewareLogic: Middleware =
       store.dispatch(setFeatureNotAvailableOpen(true));
       return;
     }
-
+    if (isLeavingProcess(action.payload, currentKey)) {
+      // 说明从图像处理退出 , 执行清理
+      console.log(
+        `[businessFlowMiddleware] Leaving process flow, last key was: ${state.lastKey}`
+      );
+      // 重置 viewerContainerSlice 到初始状态
+      store.dispatch(resetViewerContainer());
+    }
+    //退出检查的判断
     if (
       isExitingExam(action.payload, currentKey) &&
       action.payload !== 'exitExamCompleted' &&
@@ -372,5 +381,8 @@ function isExitingExam(currentAction: string, currentKey: string): boolean {
   );
   return currentAction !== 'exam' && currentKey === 'exam';
 }
+function isLeavingProcess(currentAction: string, currentKey: string): boolean {
+  return currentAction !== 'process' && currentKey === 'process';
+}
 
 export default businessFlowMiddlewareLogic;