Commit a0f09e47 authored by chenshouchao's avatar chenshouchao

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

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