Commit 93f48eda authored by wuyongsheng's avatar wuyongsheng

Merge branch 'feat-20221012-environment' into 'master'

hotfix: pdb改为3d效果

See merge request !221
parents f7068b9b b89d6431
...@@ -40,14 +40,17 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => { ...@@ -40,14 +40,17 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => {
}; };
// 空盒子用于布局 // 空盒子用于布局
const nullBox = useMemo(() => { const nullBox = useMemo(
if (list.length > 4) { () => {
let nullBoxLength = Math.abs(8 - list.length); if (list.length > 4) {
return new Array(nullBoxLength).fill(""); let nullBoxLength = Math.abs(8 - list.length);
} else { return new Array(nullBoxLength).fill("");
return []; } else {
} return [];
}, [list]); }
},
[list]
);
return ( return (
<> <>
...@@ -69,7 +72,10 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => { ...@@ -69,7 +72,10 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => {
<KekuleView id={`${index}2d`} smi={item.smiles} /> <KekuleView id={`${index}2d`} smi={item.smiles} />
)} )}
{graphicDimension === "3D" && ( {graphicDimension === "3D" && (
<NglView id={`${index}3d`} content={item.pdb} /> <NglView
id={`${index}3d`}
content={item.pdb3d || item.mol2}
/>
)} )}
</div> </div>
<div className={style.datasetLiBottom}> <div className={style.datasetLiBottom}>
...@@ -134,13 +140,13 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => { ...@@ -134,13 +140,13 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => {
[style.nullBox]: true, [style.nullBox]: true,
})} })}
key={index + "null"} key={index + "null"}
></div> />
); );
})} })}
</div> </div>
</> </>
)} )}
{list.length === 0 && <NoData text="未搜索到相关数据"></NoData>} {list.length === 0 && <NoData text="未搜索到相关数据" />}
</> </>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment