Commit 794970e0 authored by chenshouchao's avatar chenshouchao

Merge branch 'feat-20220908-dataset' into 'release'

cn-style: ui优化

See merge request !105
parents 795dd8e5 2aaae22e
...@@ -66,6 +66,13 @@ const theme = createTheme({ ...@@ -66,6 +66,13 @@ const theme = createTheme({
}, },
}, },
}, },
MuiPaper: {
styleOverrides: {
root: {
boxShadow: "0px 3px 10px 0px rgba(0,24,57,0.14)",
},
},
},
}, },
}); });
......
...@@ -66,8 +66,8 @@ ...@@ -66,8 +66,8 @@
line-height: 22px; line-height: 22px;
} }
.datasetLiDataLi { .datasetLiDataLi {
height: 20px; height: 28px;
line-height: 20px; line-height: 28px;
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
font-size: 12px; font-size: 12px;
padding: 0 16px; padding: 0 16px;
......
...@@ -73,18 +73,14 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => { ...@@ -73,18 +73,14 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => {
)} )}
</div> </div>
<div className={style.datasetLiBottom}> <div className={style.datasetLiBottom}>
<div className={style.datasetLiTitle} title={item.smiles}> {/* <div className={style.datasetLiTitle} title={item.smiles}>
{item.smiles} {item.smiles}
</div> </div> */}
{showData.length !== 0 && ( {showData.length !== 0 && (
<div className={style.datasetLiDataList}> <div className={style.datasetLiDataList}>
{Object.keys(item) {Object.keys(item)
.filter((key) => showData.indexOf(key) !== -1) .filter((key) => showData.indexOf(key) !== -1)
.map((key, index) => { .map((key, index) => {
// 在分子卡片模式下,删除2D/3D图像下面的smiles展示。
if (key === "smiles") {
return null;
}
return ( return (
<div <div
className={style.datasetLiDataLi} className={style.datasetLiDataLi}
...@@ -124,14 +120,18 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => { ...@@ -124,14 +120,18 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => {
<Checkbox <Checkbox
size="small" size="small"
sx={{ sx={{
padding: "0px",
position: "absolute", position: "absolute",
top: "16px", top: "16px",
right: "20px", right: "20px",
zIndex: 1, zIndex: 1,
background: "RGBA(30, 38, 51, 1)",
border: "1px solid #565C66",
borderRadius: "2px", borderRadius: "2px",
width: "16px",
height: "16px",
padding: "0px",
background: "RGBA(30, 38, 51, 1)",
":hover": {
background: "#136EFA",
},
}} }}
checked={selectItems.includes(item.id)} checked={selectItems.includes(item.id)}
/> />
......
import { useMemo } from "react"; import { useEffect, useMemo, useState } from "react";
import MyTable from "@/components/mui/MyTableNew"; import MyTable from "@/components/mui/MyTableNew";
import { sortState } from "@/components/mui/MyTableNew"; import { sortState } from "@/components/mui/MyTableNew";
...@@ -22,12 +22,19 @@ const DatasetTable = (props: IDatasetTableProps) => { ...@@ -22,12 +22,19 @@ const DatasetTable = (props: IDatasetTableProps) => {
setSortState, setSortState,
loading, loading,
} = props; } = props;
const [innerWidth, setInnerWidth] = useState(window.innerWidth);
useEffect(() => {
window.addEventListener("resize", () => {
setInnerWidth(window.innerWidth);
});
}, []);
const headCells = useMemo(() => { const headCells = useMemo(() => {
let width = let width =
showData.length === 0 showData.length === 0
? window.innerWidth - 112 ? innerWidth - 112
: `${(window.innerWidth - 112) / showData.length}`; : `${(innerWidth - 112) / showData.length}`;
return showData.map((item, index) => { return showData.map((item) => {
return { return {
id: item, id: item,
label: item, label: item,
...@@ -36,7 +43,7 @@ const DatasetTable = (props: IDatasetTableProps) => { ...@@ -36,7 +43,7 @@ const DatasetTable = (props: IDatasetTableProps) => {
sort: true, sort: true,
}; };
}); });
}, [showData]); }, [showData, innerWidth]);
return ( return (
<MyTable <MyTable
rows={list} rows={list}
......
...@@ -8,10 +8,16 @@ ...@@ -8,10 +8,16 @@
height: 100%; height: 100%;
} }
.datasetBoxShowFoot { .datasetBoxShowFoot {
padding-bottom: 64px; padding-bottom: 76px;
} }
.top { .top {
margin-bottom: 16px; position: relative;
margin: 0 -32px;
padding: 0 32px 16px;
}
.topBoxShadow {
box-shadow: 0 5px 4px -4px rgb(0, 0, 0, 0.12);
z-index: 10;
} }
.title { .title {
line-height: 22px; line-height: 22px;
...@@ -60,7 +66,7 @@ ...@@ -60,7 +66,7 @@
.searchBox { .searchBox {
width: 662px; width: 662px;
background-color: #fff; background-color: #fff;
padding: 20px 24px 24px; padding: 20px 0 24px 24px;
box-sizing: border-box; box-sizing: border-box;
} }
.deleteIcon { .deleteIcon {
...@@ -90,7 +96,9 @@ ...@@ -90,7 +96,9 @@
width: 180px; width: 180px;
} }
.searchList { .searchList {
margin-bottom: 24px; margin-bottom: 8px;
max-height: 300px;
overflow-y: overlay;
} }
.searchLi { .searchLi {
display: flex; display: flex;
...@@ -102,6 +110,7 @@ ...@@ -102,6 +110,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding-right: 24px;
} }
.searchFooterLeft { .searchFooterLeft {
color: rgba(19, 112, 255, 1); color: rgba(19, 112, 255, 1);
...@@ -122,15 +131,17 @@ ...@@ -122,15 +131,17 @@
overflow-y: overlay; overflow-y: overlay;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 0 -32px;
padding: 0 32px;
} }
.foot { .foot {
position: absolute; position: absolute;
z-index: 1;
bottom: 0; bottom: 0;
background-color: #fff; background-color: #fff;
width: calc(100vw - 64px); width: calc(100vw - 64px);
box-sizing: border-box; box-sizing: border-box;
height: 76px; height: 76px;
padding: 0 32px;
margin: 0 32px; margin: 0 32px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
......
...@@ -69,6 +69,20 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -69,6 +69,20 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
const [downloadOpen, setDownloadOpen] = useState(false); // 下载弹窗显示控制 const [downloadOpen, setDownloadOpen] = useState(false); // 下载弹窗显示控制
const [firstGetList, setFirstGetList] = useState(true); // 第一次请求列表 const [firstGetList, setFirstGetList] = useState(true); // 第一次请求列表
// 滚轮是否到顶,判断是否显示阴影
const [isTop, setIsTop] = useState(true);
// 滚动滚轮时监听是否到顶
const onscroll = (e: any) => {
if (e.target.scrollTop <= 0) {
console.log(1);
setIsTop(true);
} else {
console.log(2);
setIsTop(false);
}
};
// 页码改变 // 页码改变
const pageChange = (value: number) => { const pageChange = (value: number) => {
getList(value - 1); getList(value - 1);
...@@ -331,7 +345,12 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -331,7 +345,12 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
[style.datasetBoxShowFoot]: true, [style.datasetBoxShowFoot]: true,
})} })}
> >
<div className={style.top}> <div
className={classNames({
[style.top]: true,
[style.topBoxShadow]: !isTop,
})}
>
<div className={style.title}>{name}</div> <div className={style.title}>{name}</div>
<div className={style.screens}> <div className={style.screens}>
<div className={style.screensLeft}> <div className={style.screensLeft}>
...@@ -432,7 +451,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -432,7 +451,7 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
</div> </div>
</div> </div>
</div> </div>
<div className={style.table}> <div className={style.table} onScroll={onscroll}>
{tableType === "table" && ( {tableType === "table" && (
<DatasetTable <DatasetTable
list={list} list={list}
......
...@@ -175,7 +175,7 @@ const UpLoaderFile = observer((props: IMoveFileProps) => { ...@@ -175,7 +175,7 @@ const UpLoaderFile = observer((props: IMoveFileProps) => {
return ( return (
<MyButton <MyButton
text="删除" text="删除"
style={{ position: "relative", left: "-18px" }} style={{ position: "relative", left: "-18px", height: "22px" }}
variant="text" variant="text"
size="small" size="small"
color="error" color="error"
......
.projectData { .projectData {
position: relative; position: relative;
height: calc(100vh - 57px);
} }
.projectDataStickyTop { .projectDataStickyTop {
height: 100%;
padding: 28px 24px 64px; padding: 28px 24px 64px;
position: relative; position: relative;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.projectDataStickyTopPadding {
padding: 28px 24px 24px;
} }
.projectDataTitle { .projectDataTitle {
font-size: 18px; font-size: 18px;
...@@ -15,6 +23,11 @@ ...@@ -15,6 +23,11 @@
.projectDataHeader { .projectDataHeader {
position: relative; position: relative;
} }
.tableBox {
/* flex: 1; */
height: calc(100% - 146px);
}
.projectDataButtonAndSearch { .projectDataButtonAndSearch {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -116,6 +129,3 @@ ...@@ -116,6 +129,3 @@
line-height: 22px; line-height: 22px;
color: #8a9099; color: #8a9099;
} }
.tableBox {
height: calc(100vh - 300px);
}
...@@ -359,6 +359,7 @@ const ProjectData = observer(() => { ...@@ -359,6 +359,7 @@ const ProjectData = observer(() => {
position: "relative", position: "relative",
left: "-10px", left: "-10px",
minWidth: "10px", minWidth: "10px",
height: "22px",
padding: "0 10px", padding: "0 10px",
visibility: visibility:
item.type !== "dataSet" && item.type !== "directory" item.type !== "dataSet" && item.type !== "directory"
...@@ -377,6 +378,7 @@ const ProjectData = observer(() => { ...@@ -377,6 +378,7 @@ const ProjectData = observer(() => {
position: "relative", position: "relative",
left: "-10px", left: "-10px",
minWidth: "10px", minWidth: "10px",
height: "22px",
padding: "0 10px", padding: "0 10px",
}} }}
variant="text" variant="text"
...@@ -396,6 +398,7 @@ const ProjectData = observer(() => { ...@@ -396,6 +398,7 @@ const ProjectData = observer(() => {
position: "relative", position: "relative",
left: "-10px", left: "-10px",
minWidth: "10px", minWidth: "10px",
height: "22px",
padding: "0 10px", padding: "0 10px",
}} }}
variant="text" variant="text"
...@@ -515,7 +518,13 @@ const ProjectData = observer(() => { ...@@ -515,7 +518,13 @@ const ProjectData = observer(() => {
if (currentProjectStore.currentProjectInfo.name) { if (currentProjectStore.currentProjectInfo.name) {
return ( return (
<div className={style.projectData}> <div className={style.projectData}>
<div className={style.projectDataStickyTop}> {/* <div className={style.projectDataStickyTop}> */}
<div
className={classnames({
[style.projectDataStickyTop]: true,
[style.projectDataStickyTopPadding]: selectIds.length === 0,
})}
>
<div className={style.projectDataTitle}>项目数据</div> <div className={style.projectDataTitle}>项目数据</div>
<div className={style.projectDataHeader}> <div className={style.projectDataHeader}>
<div className={style.projectDataButtonAndSearch}> <div className={style.projectDataButtonAndSearch}>
......
...@@ -123,6 +123,7 @@ const AddMember = observer((props: IProps) => { ...@@ -123,6 +123,7 @@ const AddMember = observer((props: IProps) => {
useEffect(() => { useEffect(() => {
if (addMemberDialog) { if (addMemberDialog) {
setProjectMember("");
getProjectPower(); getProjectPower();
} }
}, [addMemberDialog, getProjectPower]); }, [addMemberDialog, getProjectPower]);
......
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