Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
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
wangpeng
dinky
Commits
7bd1d5be
Unverified
Commit
7bd1d5be
authored
Sep 04, 2022
by
aiwenmo
Committed by
GitHub
Sep 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Optimization-882][web] Collapse all directories by default on datastudio's directory panel (#991)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
d4d49b58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
23 deletions
+12
-23
index.tsx
dlink-web/src/components/Studio/StudioTree/index.tsx
+12
-23
No files found.
dlink-web/src/components/Studio/StudioTree/index.tsx
View file @
7bd1d5be
...
...
@@ -118,21 +118,10 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
const
getTreeData
=
async
()
=>
{
const
result
=
await
getCatalogueTreeData
();
let
data
=
result
.
datas
;
let
list
=
data
;
let
expendList
:
any
[]
=
[];
list
?.
map
((
v
:
any
)
=>
{
expendList
.
push
(
v
.
id
);
if
(
v
.
children
)
{
v
?.
children
?.
map
((
item
:
any
)
=>
{
expendList
.
push
(
item
.
id
);
})
}
});
data
=
convertToTreeData
(
list
,
0
);
setTreeData
(
data
);
setTreeData
(
convertToTreeData
(
data
,
0
));
//默认展开所有
setExpandedKeys
(
expendList
||
[]);
setDefaultExpandedKeys
(
expendList
||
[]);
setExpandedKeys
([]);
setDefaultExpandedKeys
([]);
setExportTaskIds
([]);
};
...
...
@@ -203,7 +192,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
toPaste
(
rightClickNode
);
}
else
if
(
key
==
'Copy'
)
{
toCopy
(
rightClickNode
);
}
else
if
(
key
==
'ExportJson'
)
{
}
else
if
(
key
==
'ExportJson'
)
{
toExportJson
(
rightClickNode
);
}
};
...
...
@@ -355,10 +344,10 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
const
toExportJson
=
async
(
node
:
TreeDataNode
|
undefined
)
=>
{
let
taskId
=
node
?.
taskId
;
const
datas
=
await
handleData
(
'/api/task/exportJsonByTaskId'
,
{
id
:
taskId
});
const
datas
=
await
handleData
(
'/api/task/exportJsonByTaskId'
,
{
id
:
taskId
});
if
(
datas
)
{
let
data
=
JSON
.
parse
(
datas
);
saveJSON
(
data
,
data
.
alias
);
saveJSON
(
data
,
data
.
alias
);
message
.
success
(
'导出json成功'
);
}
};
...
...
@@ -368,7 +357,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
message
.
warn
(
"请先选择要导出的作业"
);
}
else
{
try
{
const
{
code
,
datas
,
msg
}
=
await
postAll
(
'/api/task/exportJsonByTaskIds'
,
{
taskIds
:
exportTaskIds
});
const
{
code
,
datas
,
msg
}
=
await
postAll
(
'/api/task/exportJsonByTaskIds'
,
{
taskIds
:
exportTaskIds
});
if
(
code
==
CODE
.
SUCCESS
)
{
saveJSON
(
datas
);
message
.
success
(
'导出json成功'
);
...
...
@@ -381,7 +370,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
}
}
const
saveJSON
=
(
data
:
any
,
filename
?:
any
)
=>
{
const
saveJSON
=
(
data
:
any
,
filename
?:
any
)
=>
{
if
(
!
data
)
{
message
.
error
(
"保存的json数据为空"
);
return
;
...
...
@@ -596,9 +585,9 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
showUploadList: false,
onChange(info) {
if (info.file.status === 'done') {
if
(info.file.response.code == CODE.SUCCESS)
{
if
(info.file.response.code == CODE.SUCCESS)
{
message.success(info.file.response.msg);
}
else
{
}
else
{
message.warn(info.file.response.msg);
}
getTreeData();
...
...
@@ -629,7 +618,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
<Tooltip title="导出json">
<Button
type="text"
icon={<DownloadOutlined
/>}
icon={<DownloadOutlined/>}
onClick={toExportSelectedTaskJson}
/>
</Tooltip>
...
...
@@ -653,7 +642,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
treeData={loop(treeData)}
onExpand={onExpand}
autoExpandParent={autoExpandParent}
defaultExpandAll
//
defaultExpandAll
expandedKeys={expandedKeys}
/>
{getNodeTreeRightClickMenu()}
...
...
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