Commit 398a522b authored by chenshouchao's avatar chenshouchao

feat: 调整查看数据集页面细节

parent 682a7015
// 2d分子结构图 // 2d分子结构图
import { useEffect } from "react"; import { useCallback, useEffect } from "react";
import { Box } from "@mui/material"; import { Box } from "@mui/material";
import { useMessage } from "@/components/MySnackbar"; import { useMessage } from "@/components/MySnackbar";
var Kekule = require("kekule").Kekule; var Kekule = require("kekule").Kekule;
...@@ -34,7 +34,7 @@ const KekuleView = (props: IKekuleViewProps) => { ...@@ -34,7 +34,7 @@ const KekuleView = (props: IKekuleViewProps) => {
} = props; } = props;
const Message = useMessage(); const Message = useMessage();
useEffect(() => { const rander = useCallback(() => {
if (smi) { if (smi) {
try { try {
let molecule = Kekule.IO.loadFormatData( let molecule = Kekule.IO.loadFormatData(
...@@ -60,16 +60,23 @@ const KekuleView = (props: IKekuleViewProps) => { ...@@ -60,16 +60,23 @@ const KekuleView = (props: IKekuleViewProps) => {
Message.error("分子结构图渲染失败,请刷新重试。"); Message.error("分子结构图渲染失败,请刷新重试。");
} }
} }
// eslint-disable-next-line react-hooks/exhaustive-deps }, [smi, Message, id, height, width, backgroundColor, toolbar]);
}, [smi]);
useEffect(() => {
rander();
}, [rander]);
window.onresize = () => {
rander();
};
return ( return (
<Box <Box
id={id} id={id}
sx={{ sx={{
cursor: onClick ? "pointer" : "unset", cursor: onClick ? "pointer" : "unset",
width: "100%", width: "99%",
height: "100%", height: "99%",
...style, ...style,
}} }}
onClick={onClick} onClick={onClick}
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
} }
.table { .table {
flex: 1; flex: 1;
overflow: auto; overflow-y: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
...@@ -73,6 +73,55 @@ ...@@ -73,6 +73,55 @@
.datasetLi:nth-last-child(4) { .datasetLi:nth-last-child(4) {
margin-bottom: 0; margin-bottom: 0;
} }
.datasetLiTop {
height: 55%;
box-sizing: border-box;
}
.datasetLiBottom {
height: 45%;
box-sizing: border-box;
background-color: RGBA(247, 248, 250, 1);
display: flex;
flex-direction: column;
}
.datasetLiTitle {
height: 38px;
line-height: 38px;
color: rgba(19, 112, 255, 1);
font-size: 14px;
text-align: center;
font-weight: 600;
}
.datasetLiDataList {
flex: 1;
overflow: auto;
}
.datasetLiDataLi {
height: 20px;
line-height: 20px;
color: rgba(30, 38, 51, 1);
font-size: 12px;
padding: 0 16px;
display: flex;
justify-content: space-between;
}
.datasetLiDataLi:nth-child(2n) {
background-color: rgba(235, 237, 240, 1);
}
.datasetLiDataLiKey {
max-width: 50%;
white-space: nowrap;
display: block;
overflow: hidden;
text-overflow: ellipsis;
}
.datasetLiDataLiValue {
max-width: 50%;
white-space: nowrap;
display: block;
overflow: hidden;
text-overflow: ellipsis;
}
.pagination { .pagination {
height: 76px; height: 76px;
min-height: 76px; min-height: 76px;
...@@ -93,3 +142,6 @@ ...@@ -93,3 +142,6 @@
align-items: center; align-items: center;
box-shadow: 0px -3px 10px 0px rgba(0, 24, 57, 0.04); box-shadow: 0px -3px 10px 0px rgba(0, 24, 57, 0.04);
} }
.nullBox {
visibility: hidden;
}
...@@ -87,6 +87,8 @@ const ProjectData = observer(() => { ...@@ -87,6 +87,8 @@ const ProjectData = observer(() => {
const [uploaderDialogOpen, setUploaderDialogOpen] = useState(false); const [uploaderDialogOpen, setUploaderDialogOpen] = useState(false);
// 查看数据集(数据集详情)显示控制 // 查看数据集(数据集详情)显示控制
const [showSeeDataset, setShowSeeDataset] = useState(false); const [showSeeDataset, setShowSeeDataset] = useState(false);
// 查看的数据集的数据集名称
const [seeDatasetName, setSeeDatasetName] = useState("");
useEffect(() => { useEffect(() => {
const locationInfo: any = location?.state; const locationInfo: any = location?.state;
...@@ -333,6 +335,7 @@ const ProjectData = observer(() => { ...@@ -333,6 +335,7 @@ const ProjectData = observer(() => {
// 查看数据集 // 查看数据集
const handleSeeDataset = (item: any) => { const handleSeeDataset = (item: any) => {
console.log(item); console.log(item);
setSeeDatasetName(item.name);
setShowSeeDataset(true); setShowSeeDataset(true);
}; };
...@@ -700,6 +703,10 @@ const ProjectData = observer(() => { ...@@ -700,6 +703,10 @@ const ProjectData = observer(() => {
{showSeeDataset && ( {showSeeDataset && (
<SeeDataset <SeeDataset
handleClose={() => setShowSeeDataset(false)} handleClose={() => setShowSeeDataset(false)}
name={seeDatasetName}
path={path}
fileToken={fileToken as string}
projectId={projectId as string}
></SeeDataset> ></SeeDataset>
)} )}
</div> </div>
......
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