Commit a0f09e47 authored by chenshouchao's avatar chenshouchao

feat: 数据管理页文件数据集切换交互组件替换

parent ae30d17f
......@@ -25,6 +25,7 @@ import NoProject from "@/components/BusinessComponents/NoProject";
import usePass from "@/hooks/usePass";
import { storageUnitFromB } from "@/utils/util";
import { useLocation } from "react-router-dom";
import RadioGroupOfButtonStyle from "@/components/CommonComponents/RadioGroupOfButtonStyle";
import { getDataFind, getDataFileSearch } from "@/api/project_api";
const theme = createTheme({
......@@ -65,8 +66,9 @@ const ProjectData = observer(() => {
const [debounce, setDebounce] = useState(false);
// 点击操作列中的按钮 会设置当前点击的文件
const [currentOperateFile, setCurrentOperateFile] = useState<any>(null);
// 1文件 2数据集
const [activeTab, setActiveTab] = useState(1);
// 文件file 数据集dataset
// const [activeTab, setActiveTab] = useState(1);
const [activeTab, setActiveTab] = useState("file");
// 复选框选中的文件名称数组
const [selectIds, setSelectIds] = useState<Array<string>>([]);
const [keyWord, setKeyWord] = useState("");
......@@ -80,15 +82,6 @@ const ProjectData = observer(() => {
// 文件服务器指向
const fileServerEndPoint = localStorage.getItem("fileServerEndPoint");
// 切换文件、数据集
const handleChangeListType = (e: number) => {
if (isPass("PROJECT_DATA_TYPECHANAGE")) {
setActiveTab(e);
setSelectIds([]);
tableRef?.current?.initSelectedFunc([]);
}
};
useEffect(() => {
const locationInfo: any = location?.state;
setPath(locationInfo?.pathName || "/");
......@@ -96,7 +89,7 @@ const ProjectData = observer(() => {
// 列表展示的数据
const showList = useMemo(() => {
if (activeTab === 1) {
if (activeTab === "file") {
// 做排序 文件夹在前
let folderList: any = [];
let fileList: any = [];
......@@ -625,28 +618,14 @@ const ProjectData = observer(() => {
<div className={style.projectDataPathAndTabs}>
<div className={style.projectDataPath}>{showPath}</div>
<div className={style.projectDataTabsAndBtton}>
<div className={style.projectDataTabs}>
<div
className={classnames({
[style.projectDataTab]: true,
[style.projectDataTabActive]: activeTab === 1,
})}
// onClick={() => setActiveTab(1)}
onClick={() => handleChangeListType(1)}
>
文件
</div>
<div
className={classnames({
[style.projectDataTab]: true,
[style.projectDataTabActive]: activeTab !== 1,
})}
// onClick={() => setActiveTab(2)}
onClick={() => handleChangeListType(2)}
>
数据集
</div>
</div>
<RadioGroupOfButtonStyle
value={activeTab}
radioOptions={[
{ value: "file", label: "文件" },
{ value: "dataset", label: "数据集" },
]}
handleRadio={setActiveTab}
></RadioGroupOfButtonStyle>
<IconButton
aria-label="refreshIcon"
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