|
@@ -64,22 +64,25 @@ const businessFlowMiddlewareLogic: Middleware =
|
|
|
prepare();
|
|
|
return next(action);
|
|
|
}
|
|
|
- if (isFromExamToView(action.payload, currentKey)) {
|
|
|
- //从检查进入图像处理,有可能是曝光导致的,怎么知道呢?看发生器状态
|
|
|
- if (store.getState().generatorMonitor.acquisitionState === 1) {
|
|
|
- //发生器正在采集
|
|
|
- console.log(
|
|
|
- `[businessFlowMiddleware] Exiting exam flow, but generator is still acquiring.`
|
|
|
- );
|
|
|
- return next(action); // 发生器正在采集,不能退出
|
|
|
- } else {
|
|
|
- //非曝光导致的从检查进入处理 // 说明从检查退出 , 执行清理
|
|
|
- console.log(
|
|
|
- `[businessFlowMiddleware] Exiting exam flow, last key was: ${state.lastKey}`
|
|
|
- );
|
|
|
- unprepare();
|
|
|
+ if (action.payload === 'process') {
|
|
|
+ if (isFromExamToView(action.payload, currentKey)) {
|
|
|
+ //从检查进入图像处理,有可能是曝光导致的,怎么知道呢?看发生器状态
|
|
|
+ if (store.getState().generatorMonitor.acquisitionState === 1) {
|
|
|
+ //发生器正在采集
|
|
|
+ console.log(
|
|
|
+ `[businessFlowMiddleware] Exiting exam flow, but generator is still acquiring.`
|
|
|
+ );
|
|
|
+ return next(action); // 发生器正在采集,不能退出
|
|
|
+ } else {
|
|
|
+ //非曝光导致的从检查进入处理 // 说明从检查退出 , 执行清理
|
|
|
+ console.log(
|
|
|
+ `[businessFlowMiddleware] Exiting exam flow, last key was: ${state.lastKey}`
|
|
|
+ );
|
|
|
+ unprepare();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (
|
|
|
isExitingExam(action.payload, currentKey) &&
|
|
|
action.payload !== 'exitExamCompleted' &&
|
|
@@ -150,7 +153,7 @@ const businessFlowMiddlewareLogic: Middleware =
|
|
|
* 从检查到图像处理
|
|
|
*/
|
|
|
function isFromExamToView(currentAction: string, currentKey: string): boolean {
|
|
|
- return currentAction === 'view' && currentKey === 'exam';
|
|
|
+ return currentAction === 'process' && currentKey === 'exam';
|
|
|
}
|
|
|
function isExitingExam(currentAction: string, currentKey: string): boolean {
|
|
|
console.log(
|