|
@@ -1,10 +1,37 @@
|
|
|
import StackViewer from './viewers/stack.image.viewer';
|
|
|
+import { useSelector } from 'react-redux';
|
|
|
+import { RootState } from '@/states/store';
|
|
|
+import { getViewIconUrl, getExposedImageUrl } from '@/API/bodyPosition';
|
|
|
+import { Image } from 'antd';
|
|
|
|
|
|
const ImageControl = () => {
|
|
|
+ const selectedBodyPosition = useSelector(
|
|
|
+ (state: RootState) => state.bodyPositionList.selectedBodyPosition
|
|
|
+ );
|
|
|
+
|
|
|
+ const isExposed =
|
|
|
+ selectedBodyPosition &&
|
|
|
+ selectedBodyPosition.dview &&
|
|
|
+ selectedBodyPosition.dview.expose_status === 'Exposed';
|
|
|
+ console.log('isExposed:', isExposed);
|
|
|
+ const imageUrl = selectedBodyPosition
|
|
|
+ ? isExposed
|
|
|
+ ? getExposedImageUrl(selectedBodyPosition.sop_instance_uid)
|
|
|
+ : getViewIconUrl(selectedBodyPosition.body_position_image)
|
|
|
+ : '';
|
|
|
+
|
|
|
return (
|
|
|
<div className="image-control">
|
|
|
<div style={{ width: '800px', height: '600px' }}>
|
|
|
- <StackViewer imageIndex={30} />
|
|
|
+ {isExposed ? (
|
|
|
+ <StackViewer imageIndex={30} />
|
|
|
+ ) : (
|
|
|
+ <Image
|
|
|
+ src={imageUrl}
|
|
|
+ alt="Body Position"
|
|
|
+ style={{ width: '100%', height: '100%' }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
{/* 第10张图和第30张图明显不同,可以用于测试,看效果*/}
|
|
|
</div>
|
|
|
</div>
|