|
|
@@ -420,10 +420,16 @@ const WorklistTable: React.FC<WorklistTableProps> = ({
|
|
|
// 新模式:检查双ID
|
|
|
if (record.StudyID) {
|
|
|
const indexByStudyId = selectedIds.indexOf(record.StudyID);
|
|
|
- return selectedSecondaryIds[indexByStudyId] === record.entry_id;
|
|
|
+ // 关键修复:检查索引是否有效,避免 undefined === undefined 的误判
|
|
|
+ if (indexByStudyId === -1) return false;
|
|
|
+ // 修复:保持与 useMultiSelection 一致,使用 ?? '' 处理 undefined
|
|
|
+ return (selectedSecondaryIds[indexByStudyId] ?? '') === (record.entry_id ?? '');
|
|
|
} else if (record.entry_id) {
|
|
|
const indexByEntryId = selectedSecondaryIds.indexOf(record.entry_id);
|
|
|
- return selectedIds[indexByEntryId] === record.StudyID;
|
|
|
+ // 关键修复:检查索引是否有效,避免 undefined === undefined 的误判
|
|
|
+ if (indexByEntryId === -1) return false;
|
|
|
+ // 修复:保持与 useMultiSelection 一致,使用 ?? '' 处理 undefined
|
|
|
+ return (selectedIds[indexByEntryId] ?? '') === (record.StudyID ?? '');
|
|
|
}
|
|
|
throw new Error('Record must have at least StudyID or entry_id defined in dual ID mode.');
|
|
|
} else {
|