Commit b8148369 authored by chenshouchao's avatar chenshouchao

cn- feat:项目数据搜索时不显示复选框

parent 7c5e4831
......@@ -75,6 +75,8 @@ const ProjectData = observer(() => {
// 数据集列表 不带文件
const [dataSetList, setDataSetList] = useState<any>([]);
let tableRef: any = React.createRef();
// 是否显示复选框 用户搜索文件后不显示 其他情况显示
const [showCheckBox, setShowCheckBox] = useState<boolean>(true);
// 切换文件、数据集
const handleChangeListType = (e: number) => {
......@@ -137,6 +139,7 @@ const ProjectData = observer(() => {
setSelectIds([]);
setDebounce(false);
tableRef?.current?.initSelectedFunc([]);
setShowCheckBox(false);
},
});
......@@ -153,6 +156,7 @@ const ProjectData = observer(() => {
setSelectIds([]);
setDebounce(false);
tableRef?.current?.initSelectedFunc([]);
setShowCheckBox(true);
},
});
......@@ -203,6 +207,7 @@ const ProjectData = observer(() => {
}
setSelectIds([]);
setDebounce(false);
setShowCheckBox(true);
});
}
}, [fileToken, path, projectId, keyWord]);
......@@ -234,6 +239,7 @@ const ProjectData = observer(() => {
}
setSelectIds([]);
setDebounce(false);
setShowCheckBox(false);
});
}
}
......@@ -272,19 +278,36 @@ const ProjectData = observer(() => {
// todo name sort
// table配置
const versionsHeadCells = [
{ id: "checkbox" },
{ id: "name", numeric: false, label: "名称", width: "25%" },
{ id: "size", numeric: false, label: "大小", width: "25%", sort: true },
{
id: "mtime",
numeric: false,
label: "创建时间",
width: "25%",
sort: true,
},
{ id: "caozuo", numeric: false, label: "操作", width: "25%" },
];
const versionsHeadCells = useMemo(() => {
if (showCheckBox) {
return [
{ id: "checkbox" },
{ id: "name", numeric: false, label: "名称", width: "25%" },
{ id: "size", numeric: false, label: "大小", width: "25%", sort: true },
{
id: "mtime",
numeric: false,
label: "创建时间",
width: "25%",
sort: true,
},
{ id: "caozuo", numeric: false, label: "操作", width: "25%" },
];
} else {
return [
{ id: "name", numeric: false, label: "名称", width: "25%" },
{ id: "size", numeric: false, label: "大小", width: "25%", sort: true },
{
id: "mtime",
numeric: false,
label: "创建时间",
width: "25%",
sort: true,
},
{ id: "caozuo", numeric: false, label: "操作", width: "25%" },
];
}
}, [showCheckBox]);
// 点击复选框
const hanldeCheckbox = (e: any) => {
......
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