Commit e4a2d9c8 authored by chenshouchao's avatar chenshouchao

Merge branch 'feat-20220608-projectdata' into 'release'

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

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