Commit 55e5598b authored by chenshouchao's avatar chenshouchao

feat: 新增暂无数据组件

parent dd3b18d9
.noDataBox {
background-color: #fff;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
}
.noDataText {
margin-top: 8px;
font-size: 14px;
line-height: 22px;
color: #8a9099;
}
import noFile from "@/assets/project/noFile.svg";
import style from "./index.module.css";
type INoDataProps = {
text?: string;
noDataBoxStyle?: any;
};
const NoData = (props: INoDataProps) => {
return (
<div className={style.noDataBox} style={{ ...props.noDataBoxStyle }}>
<img className={style.noDataImg} src={noFile} alt="" />
<span className={style.noDataText}>
{props.text ? props.text : "暂无数据"}
</span>
</div>
);
};
export default NoData;
...@@ -17,6 +17,7 @@ import { useStores } from "@/store"; ...@@ -17,6 +17,7 @@ import { useStores } from "@/store";
import { toJS } from "mobx"; import { toJS } from "mobx";
import classNames from "classnames"; import classNames from "classnames";
import Save from "./save"; import Save from "./save";
import NoData from "@/components/BusinessComponents/NoData";
import Download from "./download"; import Download from "./download";
import style from "./index.module.css"; import style from "./index.module.css";
...@@ -62,7 +63,9 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -62,7 +63,9 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
setSort(e); setSort(e);
}; };
const handleKeywordChange = (e: any) => { const handleKeywordChange = (e: any) => {
if (e.target.value.length <= 30) {
setKeyword(e.target.value); setKeyword(e.target.value);
}
}; };
const pageChange = (value: number) => { const pageChange = (value: number) => {
...@@ -248,6 +251,8 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -248,6 +251,8 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
</div> </div>
</div> </div>
<div className={style.table}> <div className={style.table}>
{list.length !== 0 && (
<>
<div className={style.list}> <div className={style.list}>
{list.map((item, index) => { {list.map((item, index) => {
return ( return (
...@@ -269,7 +274,10 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -269,7 +274,10 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
</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 && (
...@@ -285,7 +293,9 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -285,7 +293,9 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
<span className={style.datasetLiDataLiKey}> <span className={style.datasetLiDataLiKey}>
{key} {key}
</span> </span>
<span className={style.datasetLiDataLiValue}> <span
className={style.datasetLiDataLiValue}
>
{item.meta[key]} {item.meta[key]}
</span> </span>
</div> </div>
...@@ -341,9 +351,17 @@ const SeeDataset = observer((props: ISeeDatasetProps) => { ...@@ -341,9 +351,17 @@ const SeeDataset = observer((props: ISeeDatasetProps) => {
); );
})} })}
</div> </div>
<div className={style.pagination}> <div className={style.pagination}>
<MyPagination page={page} pageChange={pageChange} count={count} /> <MyPagination
page={page}
pageChange={pageChange}
count={count}
/>
</div> </div>
</>
)}
{list.length === 0 && <NoData></NoData>}
</div> </div>
</div> </div>
<div className={style.foot}> <div className={style.foot}>
......
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