Commit 3dc486a5 authored by chenshouchao's avatar chenshouchao

feat: 新增一个从下往上弹的全屏抽屉

parent a0f09e47
// 2d分子结构图 // 2d分子结构图
import { useEffect } from "react"; import { useEffect } from "react";
import { Box } from "@mui/material"; import { Box } from "@mui/material";
import { useMessage } from "@/components/MySnackbar";
var Kekule = require("kekule").Kekule; var Kekule = require("kekule").Kekule;
type IKekuleViewProps = { type IKekuleViewProps = {
...@@ -31,6 +32,7 @@ const KekuleView = (props: IKekuleViewProps) => { ...@@ -31,6 +32,7 @@ const KekuleView = (props: IKekuleViewProps) => {
onClick, onClick,
toolbar = false, toolbar = false,
} = props; } = props;
const Message = useMessage();
useEffect(() => { useEffect(() => {
if (smi) { if (smi) {
...@@ -55,6 +57,7 @@ const KekuleView = (props: IKekuleViewProps) => { ...@@ -55,6 +57,7 @@ const KekuleView = (props: IKekuleViewProps) => {
chemViewer.setEnableDirectInteraction(false); chemViewer.setEnableDirectInteraction(false);
} catch (err) { } catch (err) {
console.log(err); console.log(err);
Message.error("分子结构图渲染失败,请刷新重试。");
} }
} }
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
......
// 分子结构3D图 // 分子结构3D图
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Stage } from "ngl"; import { Stage } from "ngl";
import { useMessage } from "@/components/MySnackbar";
import { Box } from "@mui/material"; import { Box } from "@mui/material";
type INglViewProps = { type INglViewProps = {
...@@ -11,13 +12,14 @@ type INglViewProps = { ...@@ -11,13 +12,14 @@ type INglViewProps = {
}; };
const NglView = (props: INglViewProps) => { const NglView = (props: INglViewProps) => {
const Message = useMessage();
const { id, content, width = "100%", height = "100%" } = props; const { id, content, width = "100%", height = "100%" } = props;
const [stage, setStage] = useState<any>(null); const [stage, setStage] = useState<any>(null);
const [pdb, setPdb] = useState<any>(null); const [pdb, setPdb] = useState<any>(null);
let firefox = navigator.userAgent.indexOf("FireFox") !== -1; let firefox = navigator.userAgent.indexOf("FireFox") !== -1;
// 鼠标滚动放大3d图的时候页面不会跟着滚动
const MouseWheel = (e: any) => { const MouseWheel = (e: any) => {
console.log("e", e);
e = e || window.event; e = e || window.event;
// if (e.stopProagation) { // if (e.stopProagation) {
// e.stopPropagation(); // e.stopPropagation();
...@@ -59,15 +61,14 @@ const NglView = (props: INglViewProps) => { ...@@ -59,15 +61,14 @@ const NglView = (props: INglViewProps) => {
useEffect(() => { useEffect(() => {
try { try {
// document.addEventListener("DOMContentLoaded", () => {
stage && stage &&
stage.loadFile(pdb, { stage.loadFile(pdb, {
ext: "pdb", ext: "pdb",
defaultRepresentation: true, defaultRepresentation: true,
}); });
// });
} catch (err) { } catch (err) {
console.log(err); console.log(err);
Message.error("分子结构图渲染失败,请刷新重试。");
} }
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
......
// 从下往上弹的全屏抽屉
import style from "./index.module.css";
type IFullScreenDrawerProps = {};
const FullScreenDrawer = (props: IFullScreenDrawerProps) => {
return <div>123</div>;
};
export default FullScreenDrawer;
...@@ -36,37 +36,6 @@ ...@@ -36,37 +36,6 @@
line-height: 22px; line-height: 22px;
font-weight: 600; font-weight: 600;
} }
.projectDataTabsAndBtton {
display: flex;
justify-content: flex-end;
align-items: center;
}
.projectDataTabs {
display: flex;
justify-content: space-between;
border: 1px solid #e6e8eb;
border-radius: 4px;
background-color: #e6e8eb;
cursor: pointer;
margin-right: 12px;
}
.projectDataTab {
height: 32px;
box-sizing: border-box;
font-size: 14px;
color: #565c66;
border-radius: 4px;
line-height: 20px;
padding: 3px 18px;
background-color: #e6e8eb;
display: flex;
align-items: center;
}
.projectDataTabActive {
color: #1370ff;
background-color: #fff;
border: 1px solid #e6e8eb;
}
.folderIconBox { .folderIconBox {
display: flex; display: flex;
...@@ -74,7 +43,7 @@ ...@@ -74,7 +43,7 @@
align-items: center; align-items: center;
} }
.folderPointer{ .folderPointer {
cursor: pointer; cursor: pointer;
} }
...@@ -94,31 +63,31 @@ ...@@ -94,31 +63,31 @@
align-items: center; align-items: center;
} }
.showPathSpan{ .showPathSpan {
cursor: pointer; cursor: pointer;
line-height: 22px; line-height: 22px;
font-size: 14px; font-size: 14px;
color: #1E2633; color: #1e2633;
/* display: flex; /* display: flex;
align-items: center; */ align-items: center; */
} }
.showPathI{ .showPathI {
margin: 0 10px; margin: 0 10px;
line-height: 22px; line-height: 22px;
font-size: 20px; font-size: 20px;
color: #C2C6CC; color: #c2c6cc;
cursor: default ; cursor: default;
} }
.showPathSpan:hover{ .showPathSpan:hover {
color: #1370FF; color: #1370ff;
} }
.showPathSpanActive{ .showPathSpanActive {
color: #1370FF; color: #1370ff;
} }
.noDataBox{ .noDataBox {
background-color: #fff; background-color: #fff;
height: calc(100vh - 377px); height: calc(100vh - 377px);
display: flex; display: flex;
...@@ -128,9 +97,9 @@ ...@@ -128,9 +97,9 @@
position: relative; position: relative;
top: -53px; top: -53px;
} }
.noDataText{ .noDataText {
margin-top: 8px; margin-top: 8px;
font-size: 14px; font-size: 14px;
line-height: 22px; line-height: 22px;
color: #8A9099; color: #8a9099;
} }
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