|
|
@@ -9,6 +9,7 @@ import {
|
|
|
Tooltip,
|
|
|
message,
|
|
|
Flex,
|
|
|
+ Modal,
|
|
|
} from 'antd';
|
|
|
import ErrorMessage from '@/components/ErrorMessage';
|
|
|
import { patientSizes, PatientSize } from '../../states/patientSize';
|
|
|
@@ -110,7 +111,7 @@ const ContentAreaLarge = () => {
|
|
|
}
|
|
|
|
|
|
console.log('[handleOpenCamera] 打开摄像头,Study ID:', currentStudyId);
|
|
|
-
|
|
|
+
|
|
|
// dispatch openCamera action,打开摄像头
|
|
|
dispatch(openCamera(currentStudyId));
|
|
|
};
|
|
|
@@ -124,19 +125,35 @@ const ContentAreaLarge = () => {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- try {
|
|
|
- await dispatch(
|
|
|
- judgeImageThunk({
|
|
|
- sopInstanceUid: selectedBodyPosition.sop_instance_uid,
|
|
|
- accept: false,
|
|
|
- })
|
|
|
- ).unwrap();
|
|
|
|
|
|
- message.success('图像已拒绝');
|
|
|
- } catch (err) {
|
|
|
- console.error('拒绝图像失败:', err);
|
|
|
- message.error('拒绝图像失败');
|
|
|
- }
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确认拒绝',
|
|
|
+ content: `确定要拒绝选中的图像吗?`,
|
|
|
+ okText: '确认拒绝',
|
|
|
+ cancelText: '取消',
|
|
|
+ okButtonProps: {
|
|
|
+ danger: true,
|
|
|
+ 'data-testid': 'modal-confirm-delete'
|
|
|
+ },
|
|
|
+ cancelButtonProps: {
|
|
|
+ 'data-testid': 'modal-cancel-delete'
|
|
|
+ },
|
|
|
+ centered: true,
|
|
|
+ onOk: async () => {
|
|
|
+ try {
|
|
|
+ await dispatch(
|
|
|
+ judgeImageThunk({
|
|
|
+ sopInstanceUid: selectedBodyPosition.sop_instance_uid,
|
|
|
+ accept: false,
|
|
|
+ })
|
|
|
+ ).unwrap();
|
|
|
+ message.success('图像已拒绝');
|
|
|
+ } catch (err) {
|
|
|
+ console.error('拒绝图像失败:', err);
|
|
|
+ message.error('拒绝图像失败');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
@@ -490,7 +507,7 @@ const ContentAreaLarge = () => {
|
|
|
</div>
|
|
|
<Flex align="center" justify="start" gap="middle" wrap>
|
|
|
<Button
|
|
|
- data-testid="reset-generator-btn"
|
|
|
+ data-testid="reset-generator-btn"
|
|
|
style={{ width: '1.5rem', height: '1.5rem' }}
|
|
|
icon={
|
|
|
<Icon
|
|
|
@@ -524,39 +541,39 @@ const ContentAreaLarge = () => {
|
|
|
/>
|
|
|
}
|
|
|
onClick={async () => {
|
|
|
- const state = store.getState().bodyPositionList;
|
|
|
- const selectedBodyPosition = state.selectedBodyPosition;
|
|
|
- const bodyPositions = state.bodyPositions;
|
|
|
-
|
|
|
- // 检查体位数量,至少保留一个
|
|
|
- if (bodyPositions.length <= 1) {
|
|
|
- message.warning('至少需要保留一个体位,无法删除');
|
|
|
- return;
|
|
|
- }
|
|
|
+ const state = store.getState().bodyPositionList;
|
|
|
+ const selectedBodyPosition = state.selectedBodyPosition;
|
|
|
+ const bodyPositions = state.bodyPositions;
|
|
|
+
|
|
|
+ // 检查体位数量,至少保留一个
|
|
|
+ if (bodyPositions.length <= 1) {
|
|
|
+ message.warning('至少需要保留一个体位,无法删除');
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- console.log(
|
|
|
- `选中的体位:${JSON.stringify(selectedBodyPosition)}`
|
|
|
- );
|
|
|
- if (
|
|
|
- selectedBodyPosition &&
|
|
|
- selectedBodyPosition.sop_instance_uid
|
|
|
- ) {
|
|
|
- try {
|
|
|
- await deleteBodyPosition(
|
|
|
- selectedBodyPosition.sop_instance_uid
|
|
|
- );
|
|
|
- dispatch(
|
|
|
- removeBodyPositionBySopInstanceUid(
|
|
|
+ console.log(
|
|
|
+ `选中的体位:${JSON.stringify(selectedBodyPosition)}`
|
|
|
+ );
|
|
|
+ if (
|
|
|
+ selectedBodyPosition &&
|
|
|
+ selectedBodyPosition.sop_instance_uid
|
|
|
+ ) {
|
|
|
+ try {
|
|
|
+ await deleteBodyPosition(
|
|
|
selectedBodyPosition.sop_instance_uid
|
|
|
- )
|
|
|
- );
|
|
|
- dispatch(setByIndex(0));
|
|
|
- } catch (error) {
|
|
|
- console.error('Error deleting body position:', error);
|
|
|
- message.error('Failed to delete body position');
|
|
|
+ );
|
|
|
+ dispatch(
|
|
|
+ removeBodyPositionBySopInstanceUid(
|
|
|
+ selectedBodyPosition.sop_instance_uid
|
|
|
+ )
|
|
|
+ );
|
|
|
+ dispatch(setByIndex(0));
|
|
|
+ } catch (error) {
|
|
|
+ console.error('Error deleting body position:', error);
|
|
|
+ message.error('Failed to delete body position');
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }}
|
|
|
+ }}
|
|
|
/>
|
|
|
</Tooltip>
|
|
|
)}
|