Commit 819d0e07 authored by chenshouchao's avatar chenshouchao

feat: 数据集查看器优化提测

parent 0683510d
...@@ -30,6 +30,27 @@ type IGetDatasetItemsListParams = { ...@@ -30,6 +30,27 @@ type IGetDatasetItemsListParams = {
sort?: string; // 排序 sort?: string; // 排序
} }
export type IQuery = {
index: string;
compare: ">" | "<" | ">=" | "<=" | "=" | "≈";
query: string;
};
type IQuerylist = Array<IQuery>
type IGetDatasetItemsListNewParamstype = {
type?: string;
projectId: string;
token: string;
filetoken: string;
path: string; // 数据集路径
name: string; // 数据集名称
page: number; //
size: number; //
index?: string; // 选择的属性
sort?: string; // 排序
}
type IGetDatasetSizeParams = { type IGetDatasetSizeParams = {
type?: string; // 产品id type?: string; // 产品id
projectId: string; projectId: string;
...@@ -281,6 +302,22 @@ class CloudEController { ...@@ -281,6 +302,22 @@ class CloudEController {
} }
} }
// 获取数据集里的数据列表(新 可支持高级搜索)
static GetDatasetItemsListNew(params: IGetDatasetItemsListNewParamstype, querylist: IQuerylist) {
if (ApiUtils.getAuthorizationHeaders(headers)) {
headers["Cache-Control"] = "no-cache";
let url = getUrlThroughParams(params, ['filetoken','path','token'], '?')
return axios.post(
`${APIOPTION()}:5003/find/dataset/new${url}`,{
querylist
},
{
headers: headers,
}
);
}
}
// 分子另存为 // 分子另存为
static SaveDataset(params: ISaveDatasetParams) { static SaveDataset(params: ISaveDatasetParams) {
if (ApiUtils.getAuthorizationHeaders(headers)) { if (ApiUtils.getAuthorizationHeaders(headers)) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { useRef, useEffect, useState } from "react"; import { useRef, useEffect, useState } from "react";
import Popover, { PopoverProps } from "@mui/material/Popover"; import Popover, { PopoverProps } from "@mui/material/Popover";
import Typography from "@mui/material/Typography"; import { ThemeProvider, createTheme } from "@mui/material/styles";
interface IProps extends Omit<PopoverProps, "open"> { interface IProps extends Omit<PopoverProps, "open"> {
/** 触发行为 */ /** 触发行为 */
...@@ -22,7 +22,18 @@ interface IProps extends Omit<PopoverProps, "open"> { ...@@ -22,7 +22,18 @@ interface IProps extends Omit<PopoverProps, "open"> {
/** open 修改 */ /** open 修改 */
changeOpen: (val: boolean) => void; changeOpen: (val: boolean) => void;
} }
const theme = createTheme({
components: {
MuiPaper: {
styleOverrides: {
root: {
boxShadow: "0px 3px 10px 0px rgba(0,24,57,0.14)",
},
},
},
},
});
// .css-3bmhjh-MuiPaper-root-MuiPopover-paper
const MyPopover = (props: IProps) => { const MyPopover = (props: IProps) => {
const [anchorEl, setAnchorEl] = useState<any | null>(null); const [anchorEl, setAnchorEl] = useState<any | null>(null);
const ref = useRef(null); const ref = useRef(null);
...@@ -61,40 +72,42 @@ const MyPopover = (props: IProps) => { ...@@ -61,40 +72,42 @@ const MyPopover = (props: IProps) => {
const id = open ? "simple-popover" : undefined; const id = open ? "simple-popover" : undefined;
return ( return (
<div> <ThemeProvider theme={theme}>
<Typography <div>
ref={ref} <div
aria-owns={id} ref={ref}
onClick={trigger === "click" ? handelClick : undefined} aria-owns={id}
onMouseEnter={trigger === "hover" ? handlePopoverOpen : undefined} onClick={trigger === "click" ? handelClick : undefined}
onMouseLeave={trigger === "hover" ? handlePopoverClose : undefined} onMouseEnter={trigger === "hover" ? handlePopoverOpen : undefined}
> onMouseLeave={trigger === "hover" ? handlePopoverClose : undefined}
{children} >
</Typography> {children}
<Popover </div>
id={id} <Popover
open={open} id={id}
anchorEl={anchorEl} open={open}
onClose={handlePopoverClose} anchorEl={anchorEl}
sx={{ onClose={handlePopoverClose}
pointerEvents: trigger === "hover" ? "none" : undefined, sx={{
}} pointerEvents: trigger === "hover" ? "none" : undefined,
anchorOrigin={ }}
anchorOrigin || { anchorOrigin={
vertical: "bottom", anchorOrigin || {
horizontal: "center", vertical: "bottom",
horizontal: "center",
}
} }
} transformOrigin={
transformOrigin={ transformOrigin || {
transformOrigin || { vertical: "top",
vertical: "top", horizontal: "center",
horizontal: "center", }
} }
} >
> {content}
<Typography sx={{ p: 1 }}>{content}</Typography> </Popover>
</Popover> </div>
</div> </ThemeProvider>
); );
}; };
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
position: relative;
} }
.datasetLi { .datasetLi {
flex: 1; flex: 1;
......
...@@ -5,6 +5,7 @@ import MyTooltip from "@/components/mui/MyTooltip"; ...@@ -5,6 +5,7 @@ import MyTooltip from "@/components/mui/MyTooltip";
import Checkbox from "@mui/material/Checkbox"; import Checkbox from "@mui/material/Checkbox";
import style from "./index.module.css"; import style from "./index.module.css";
import classNames from "classnames"; import classNames from "classnames";
import MyCircularProgress from "@/components/mui/MyCircularProgress";
import NoData from "@/components/BusinessComponents/NoData"; import NoData from "@/components/BusinessComponents/NoData";
type IDatasetCardTableProps = { type IDatasetCardTableProps = {
...@@ -13,11 +14,18 @@ type IDatasetCardTableProps = { ...@@ -13,11 +14,18 @@ type IDatasetCardTableProps = {
showData: Array<string>; showData: Array<string>;
selectItems: Array<string>; selectItems: Array<string>;
setSelectItems: any; setSelectItems: any;
loading: boolean;
}; };
const DatasetCardTable = (props: IDatasetCardTableProps) => { const DatasetCardTable = (props: IDatasetCardTableProps) => {
const { list, graphicDimension, showData, selectItems, setSelectItems } = const {
props; list,
graphicDimension,
showData,
selectItems,
setSelectItems,
loading,
} = props;
// 选择/取消分子 // 选择/取消分子
const handleSelectItem = (id: string) => { const handleSelectItem = (id: string) => {
...@@ -34,7 +42,7 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => { ...@@ -34,7 +42,7 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => {
// 空盒子用于布局 // 空盒子用于布局
const nullBox = useMemo(() => { const nullBox = useMemo(() => {
if (list.length > 4) { if (list.length > 4) {
let nullBoxLength = 8 - list.length; let nullBoxLength = Math.abs(8 - list.length);
return new Array(nullBoxLength).fill(""); return new Array(nullBoxLength).fill("");
} else { } else {
return []; return [];
...@@ -46,6 +54,7 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => { ...@@ -46,6 +54,7 @@ const DatasetCardTable = (props: IDatasetCardTableProps) => {
{list.length !== 0 && ( {list.length !== 0 && (
<> <>
<div className={style.list}> <div className={style.list}>
<MyCircularProgress loading={loading} />
{list.map((item, index) => { {list.map((item, index) => {
return ( return (
<div <div
......
...@@ -9,6 +9,7 @@ type IDatasetTableProps = { ...@@ -9,6 +9,7 @@ type IDatasetTableProps = {
setSelectItems: any; setSelectItems: any;
sortState: sortState; sortState: sortState;
setSortState: any; setSortState: any;
loading: boolean;
}; };
const DatasetTable = (props: IDatasetTableProps) => { const DatasetTable = (props: IDatasetTableProps) => {
...@@ -19,6 +20,7 @@ const DatasetTable = (props: IDatasetTableProps) => { ...@@ -19,6 +20,7 @@ const DatasetTable = (props: IDatasetTableProps) => {
setSelectItems, setSelectItems,
sortState, sortState,
setSortState, setSortState,
loading,
} = props; } = props;
const headCells = useMemo(() => { const headCells = useMemo(() => {
let width = let width =
...@@ -45,6 +47,7 @@ const DatasetTable = (props: IDatasetTableProps) => { ...@@ -45,6 +47,7 @@ const DatasetTable = (props: IDatasetTableProps) => {
setSelectItems={setSelectItems} setSelectItems={setSelectItems}
sortState={sortState} sortState={sortState}
setSortState={setSortState} setSortState={setSortState}
loading={loading}
></MyTable> ></MyTable>
); );
}; };
......
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
padding-bottom: 64px; padding-bottom: 64px;
} }
.top { .top {
margin-bottom: 20px; margin-bottom: 16px;
} }
.title { .title {
line-height: 22px; line-height: 22px;
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
margin-bottom: 20px; margin-bottom: 16px;
} }
.screens { .screens {
display: flex; display: flex;
...@@ -58,20 +58,17 @@ ...@@ -58,20 +58,17 @@
position: relative; position: relative;
} }
.searchBox { .searchBox {
position: absolute;
top: 36px;
right: 0;
width: 662px; width: 662px;
box-shadow: 0px 3px 10px 0px rgba(0, 24, 57, 0.14);
background-color: #fff; background-color: #fff;
border-radius: 4px;
z-index: 10;
padding: 20px 24px 24px; padding: 20px 24px 24px;
box-sizing: border-box; box-sizing: border-box;
} }
.searchBox img { .deleteIcon {
cursor: pointer; cursor: pointer;
} }
.deleteIconDisabled {
cursor: not-allowed;
}
.searchTop { .searchTop {
margin-bottom: 12px; margin-bottom: 12px;
} }
......
.datasetBox {
padding: 24px 32px 0;
box-sizing: border-box;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-start;
height: 100%;
}
.datasetBoxShowFoot {
padding-bottom: 64px;
}
.top {
margin-bottom: 20px;
}
.title {
line-height: 22px;
color: rgba(30, 38, 51, 1);
font-size: 18px;
font-weight: 600;
margin-bottom: 20px;
}
.screens {
display: flex;
justify-content: space-between;
align-items: center;
}
.screensLeft {
display: flex;
justify-content: flex-start;
align-items: center;
}
.screensRight {
display: flex;
justify-content: flex-end;
align-items: center;
}
.selectShowData {
margin-left: 24px;
font-size: 14px;
color: rgba(19, 112, 255, 1);
}
.table {
flex: 1;
overflow-y: overlay;
display: flex;
flex-direction: column;
}
.list {
flex: 1;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.datasetLi {
flex: 1;
min-width: 20%;
margin: 0 16px 16px 0;
border: 1px solid rgba(235, 237, 240, 1);
border-radius: 4px;
min-height: 275px;
box-sizing: border-box;
position: relative;
cursor: pointer;
}
.datasetLi:nth-child(4n) {
margin-right: 0;
}
.datasetLi:nth-last-child(1) {
margin-bottom: 0;
}
.datasetLi:nth-last-child(2) {
margin-bottom: 0;
}
.datasetLi:nth-last-child(3) {
margin-bottom: 0;
}
.datasetLi:nth-last-child(4) {
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;
width: 100%;
overflow: hidden;
}
.datasetLiDataList {
flex: 1;
overflow: overlay;
}
.noDataList {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
color: rgba(138, 144, 153, 1);
font-size: 14px;
line-height: 22px;
}
.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 {
height: 76px;
min-height: 76px;
display: flex;
justify-content: center;
align-items: center;
}
.foot {
position: absolute;
bottom: 0;
background-color: #fff;
width: 100%;
box-sizing: border-box;
height: 64px;
padding: 0 32px;
display: flex;
justify-content: flex-end;
align-items: center;
box-shadow: 0px -3px 10px 0px rgba(0, 24, 57, 0.04);
}
.nullBox {
visibility: hidden;
}
This diff is collapsed.
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