|
@@ -1,21 +1,11 @@
|
|
|
import React from 'react';
|
|
import React from 'react';
|
|
|
import { useAppSelector } from '@/states/store';
|
|
import { useAppSelector } from '@/states/store';
|
|
|
-import { useDispatch } from 'react-redux';
|
|
|
|
|
-import { setSelectedImageIndex } from '@/states/print/printSlice';
|
|
|
|
|
-import { StackViewerWithErrorBoundary } from '@/pages/view/components/viewers/stack.image.viewer';
|
|
|
|
|
-import { getDcmImageUrl } from '@/API/bodyPosition';
|
|
|
|
|
import ViewportContainer from './DcmCell';
|
|
import ViewportContainer from './DcmCell';
|
|
|
-import { v4 as uuidv4 } from 'uuid';
|
|
|
|
|
|
|
|
|
|
-const renderingEngineId = 'renderingEngineForPrint';
|
|
|
|
|
|
|
|
|
|
const Film: React.FC = () => {
|
|
const Film: React.FC = () => {
|
|
|
- const dispatch = useDispatch();
|
|
|
|
|
const films = useAppSelector((state) => state.print.films);
|
|
const films = useAppSelector((state) => state.print.films);
|
|
|
const activeFilmId = useAppSelector((state) => state.print.activeFilmId);
|
|
const activeFilmId = useAppSelector((state) => state.print.activeFilmId);
|
|
|
- const selectedImageIndex = useAppSelector(
|
|
|
|
|
- (state) => state.print.selectedImageIndex
|
|
|
|
|
- );
|
|
|
|
|
|
|
|
|
|
const currentFilm = films.find((film) => film.id === activeFilmId);
|
|
const currentFilm = films.find((film) => film.id === activeFilmId);
|
|
|
|
|
|
|
@@ -42,41 +32,9 @@ const Film: React.FC = () => {
|
|
|
}
|
|
}
|
|
|
return 'grid-cols-1 grid-rows-1';
|
|
return 'grid-cols-1 grid-rows-1';
|
|
|
};
|
|
};
|
|
|
- const getViewportIdByUrl = (url: string): string | null => {
|
|
|
|
|
- return `viewport-${url}`;
|
|
|
|
|
- };
|
|
|
|
|
|
|
+
|
|
|
const generateCell = (imageId,indexOfCell) => {
|
|
const generateCell = (imageId,indexOfCell) => {
|
|
|
- const actualUrl = getDcmImageUrl(imageId)
|
|
|
|
|
return (<ViewportContainer imageId={imageId} currentFilm={currentFilm} indexOfCell={indexOfCell} />);
|
|
return (<ViewportContainer imageId={imageId} currentFilm={currentFilm} indexOfCell={indexOfCell} />);
|
|
|
- return (
|
|
|
|
|
- <div
|
|
|
|
|
- key={imageId}
|
|
|
|
|
- className={`border-2 rounded flex items-center justify-center cursor-pointer hover:border-blue-400 transition-colors ${selectedImageIndex === imageId
|
|
|
|
|
- ? 'border-blue-500 bg-blue-50'
|
|
|
|
|
- : 'border-gray-300 bg-gray-50'
|
|
|
|
|
- }`}
|
|
|
|
|
- onClick={() => handleCellClick(imageId)}
|
|
|
|
|
- style={{
|
|
|
|
|
- minHeight: '100px',
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- {imageId ? (
|
|
|
|
|
- <div className="text-center">
|
|
|
|
|
- {/* <div className="text-sm text-gray-600">图像 {imageId}</div> */}
|
|
|
|
|
- <StackViewerWithErrorBoundary
|
|
|
|
|
- key={actualUrl}
|
|
|
|
|
- imageIndex={0}
|
|
|
|
|
- imageUrls={[actualUrl]}
|
|
|
|
|
- viewportId={getViewportIdByUrl(actualUrl) as string}
|
|
|
|
|
- renderingEngineId={renderingEngineId}
|
|
|
|
|
- //selected={selectedViewerUrls.includes(originalUrl)}
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
- ) : (
|
|
|
|
|
- <div className="text-gray-400 text-sm">空格子</div>
|
|
|
|
|
- )}
|
|
|
|
|
- </div>
|
|
|
|
|
- );
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const getCells = () => {
|
|
const getCells = () => {
|
|
@@ -103,10 +61,6 @@ const Film: React.FC = () => {
|
|
|
return generateCell(null,0);//不知道什么布局,认为只有一个格子
|
|
return generateCell(null,0);//不知道什么布局,认为只有一个格子
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const handleCellClick = (sop_instance_uid: string) => {
|
|
|
|
|
- dispatch(setSelectedImageIndex(sop_instance_uid));
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
return (
|
|
return (
|
|
|
<div
|
|
<div
|
|
|
id="film-print-area"
|
|
id="film-print-area"
|