|
|
@@ -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;
|