|
@@ -20,12 +20,16 @@ export const BaseInfo: React.FC = () => {
|
|
|
(s: RootState) => s.workSelection.selectedIds
|
|
|
);
|
|
|
const workEntities = useSelector((s: RootState) => s.workEntities.data);
|
|
|
-
|
|
|
- const selectedStudy: Task =
|
|
|
- selectedIds.length > 0 ? workEntities[selectedIds[0]] : null;
|
|
|
+ console.log(`【诊断报告】:选中的study id :${selectedIds[0]}`);
|
|
|
+ const selectedStudy: Task | null =
|
|
|
+ selectedIds.length > 0
|
|
|
+ ? (workEntities.find((t) => t.StudyID === selectedIds[0]) ?? null)
|
|
|
+ : null;
|
|
|
|
|
|
useEffect(() => {
|
|
|
- console.log(`【诊断报告】:selectedStudy是空吗?${selectedStudy === null}`);
|
|
|
+ console.log(
|
|
|
+ `【诊断报告】:selectedStudy是空吗?${selectedStudy === null} ${selectedStudy}`
|
|
|
+ );
|
|
|
if (selectedStudy) {
|
|
|
dispatch(
|
|
|
updateField({ key: 'patientName', value: selectedStudy.PatientName })
|
|
@@ -52,7 +56,7 @@ export const BaseInfo: React.FC = () => {
|
|
|
// dispatch(updateField({ key: 'examPosition', value: selectedStudy.examPosition }));
|
|
|
// dispatch(updateField({ key: 'clinicalDiag', value: selectedStudy.clinicalDiag }));
|
|
|
}
|
|
|
- }, [dispatch]);
|
|
|
+ }, [selectedIds]);
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
const onChange = (key: keyof BaseInfoState, val: any) => {
|
|
|
dispatch(updateField({ key, value: val }));
|