Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
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
zhaowei
dlink
Commits
73bb3184
Commit
73bb3184
authored
May 26, 2022
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature-254][web] Add StreamGraph JSON Export function
parent
3c8fc914
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
13 deletions
+50
-13
index.tsx
...eb/src/components/Studio/StudioConsole/StudioCA/index.tsx
+50
-13
No files found.
dlink-web/src/components/Studio/StudioConsole/StudioCA/index.tsx
View file @
73bb3184
import
{
Tabs
,
Tooltip
,
Button
}
from
"antd"
;
import
{
SearchOutlined
}
from
"@ant-design/icons"
;
import
{
Tabs
,
Tooltip
,
Button
,
Modal
,
message
}
from
"antd"
;
import
{
SearchOutlined
,
SnippetsOutlined
}
from
"@ant-design/icons"
;
import
{
StateType
}
from
"@/pages/DataStudio/model"
;
import
{
connect
}
from
"umi"
;
import
styles
from
"./index.less"
;
import
{
getLineage
}
from
"@/pages/DataStudio/service"
;
import
{
getLineage
,
getStreamGraph
}
from
"@/pages/DataStudio/service"
;
import
{
useState
}
from
"react"
;
import
Lineage
,
{
getInit
}
from
"@/components/Lineage"
;
import
CodeShow
from
"@/components/Common/CodeShow"
;
const
{
TabPane
}
=
Tabs
;
...
...
@@ -20,21 +21,57 @@ const StudioCA = (props: any) => {
type
:
1
,
});
res
.
then
((
result
)
=>
{
setData
(
result
.
datas
);
if
(
result
.
datas
){
setData
(
result
.
datas
);
}
else
{
message
.
error
(
`获取作业血缘失败,原因:\n
${
result
.
msg
}
`
);
}
})
};
const
handleExportStreamGraphPlan
=
()
=>
{
const
res
=
getStreamGraph
({
...
current
.
task
,
configJson
:
JSON
.
stringify
(
current
.
task
.
config
),
statement
:
current
.
value
,
});
res
.
then
((
result
)
=>
{
Modal
.
info
({
title
:
current
.
task
.
alias
+
'的 StreamGraphPlan'
,
width
:
1000
,
content
:
(
<
CodeShow
code=
{
JSON
.
stringify
((
result
.
datas
?
result
.
datas
:
result
.
msg
),
null
,
"
\
t"
)
}
language=
'json'
height=
'500px'
theme=
"vs-dark"
/>
),
onOk
()
{
},
});
})
};
return
(<>
<
Tabs
defaultActiveKey=
"Lineage"
size=
"small"
tabPosition=
"top"
style=
{
{
border
:
"1px solid #f0f0f0"
}
}
tabBarExtraContent=
{
<
Tooltip
title=
"重新计算血缘"
>
<
Button
type=
"text"
icon=
{
<
SearchOutlined
/>
}
onClick=
{
handleLineage
}
>
计算血缘
</
Button
>
</
Tooltip
>
}
tabBarExtraContent=
{
<>
<
Tooltip
title=
"重新计算血缘"
>
<
Button
type=
"text"
icon=
{
<
SearchOutlined
/>
}
onClick=
{
handleLineage
}
>
计算血缘
</
Button
>
</
Tooltip
>
<
Tooltip
title=
"导出 StreamGraphPlan"
>
<
Button
type=
"text"
icon=
{
<
SnippetsOutlined
/>
}
onClick=
{
handleExportStreamGraphPlan
}
>
StreamGraphPlan
</
Button
>
</
Tooltip
>
</>
}
>
<
TabPane
tab=
{
<
span
>
血缘分析
</
span
>
}
key=
"Lineage"
>
<
Lineage
datas=
{
data
}
/>
...
...
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