Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bkunyun
Commits
a0f09e47
Commit
a0f09e47
authored
Jul 20, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 数据管理页文件数据集切换交互组件替换
parent
ae30d17f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
34 deletions
+13
-34
index.tsx
src/views/Project/ProjectData/index.tsx
+13
-34
No files found.
src/views/Project/ProjectData/index.tsx
View file @
a0f09e47
...
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment