Commit 90d3c40d authored by chenshouchao's avatar chenshouchao

feat: 操作列优化

parent c8949adb
...@@ -102,6 +102,13 @@ const ProjectData = observer(() => { ...@@ -102,6 +102,13 @@ const ProjectData = observer(() => {
} }
}, [list, dataSetList, activeTab]); }, [list, dataSetList, activeTab]);
// 是否全是文件夹
const isAllDirectory = useMemo(() => {
return showList.every((li: any) => {
return li.type === "directory";
});
}, [showList]);
// 全(文件、文件夹、数据集)列表 // 全(文件、文件夹、数据集)列表
const allList = useMemo(() => { const allList = useMemo(() => {
return [...list, ...dataSetList]; return [...list, ...dataSetList];
...@@ -341,13 +348,17 @@ const ProjectData = observer(() => { ...@@ -341,13 +348,17 @@ const ProjectData = observer(() => {
const renderButtons = (item: any) => { const renderButtons = (item: any) => {
return ( return (
<span> <span>
{item.type !== "dataSet" && item.type !== "directory" && ( {!isAllDirectory && (
<Button <Button
sx={{ sx={{
position: "relative", position: "relative",
left: "-4px", left: "-4px",
minWidth: "10px", minWidth: "10px",
marginRight: "10px", marginRight: "10px",
visibility:
item.type !== "dataSet" && item.type !== "directory"
? "visible"
: "hidden",
}} }}
variant="text" variant="text"
size="small" size="small"
......
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