Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
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
zhaochengxiang
szse
Commits
a9576742
Commit
a9576742
authored
May 18, 2021
by
Your Name
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://132.232.112.242:7022/zcx/szse
parents
e8049f15
63b30b92
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
26 deletions
+43
-26
DatasourceItem.jsx
...view/Manage/DatasourceManage/Component/DatasourceItem.jsx
+35
-21
DatasourceList.jsx
...view/Manage/DatasourceManage/Component/DatasourceList.jsx
+3
-3
UpdateTaskModal.jsx
...iew/Manage/DatasourceManage/Component/UpdateTaskModal.jsx
+5
-2
No files found.
src/view/Manage/DatasourceManage/Component/DatasourceItem.jsx
View file @
a9576742
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Row
,
Col
,
Typography
,
Divider
}
from
'antd'
;
import
{
Row
,
Col
,
Typography
,
Divider
,
Spin
,
Empty
}
from
'antd'
;
import
TaskItem
from
'./TaskItem'
;
import
{
dispatch
}
from
'../../../../model'
;
...
...
@@ -9,6 +9,7 @@ import './DatasourceItem.less';
const
DatasourceItem
=
(
props
)
=>
{
const
{
data
,
onStartTask
,
onEditTask
,
onDeleteTask
,
expanded
,
refresh
,
refreshSuccess
}
=
props
;
const
[
tasks
,
setTasks
]
=
useState
(
null
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
if
(
expanded
&&
!
tasks
)
{
...
...
@@ -27,14 +28,19 @@ const DatasourceItem = (props) => {
},
[
refresh
])
const
getTasks
=
()
=>
{
setLoading
(
true
);
dispatch
({
type
:
'datasource.getTasksByDatasourceId'
,
payload
:
{
datasourceId
:
data
.
id
},
callback
:
data
=>
{
setLoading
(
false
);
setTasks
(
data
);
refresh
&&
refreshSuccess
&&
refreshSuccess
();
},
error
:
()
=>
{
setLoading
(
false
);
}
})
}
...
...
@@ -67,26 +73,34 @@ const DatasourceItem = (props) => {
}
</
Row
>
{
expanded
&&
<>
<
Divider
/>
<
Row
gutter=
{
10
}
>
{
(
tasks
||
[]).
map
((
task
,
index
)
=>
{
return
(
<
Col
key=
{
index
}
md=
{
8
}
>
<
TaskItem
key=
{
index
}
data=
{
task
}
onStart=
{
onStartTask
}
onEdit=
{
onEditTask
}
onDelete=
{
onDeleteTask
}
/>
</
Col
>
);
})
}
</
Row
>
</>
expanded
&&
<
Divider
/>
}
{
expanded
&&
<
Spin
spinning=
{
loading
}
>
{
(
tasks
||
[]).
length
===
0
?
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
"暂无任务"
/>
:
<>
<
Divider
>
任务列表
</
Divider
>
<
Row
gutter=
{
10
}
>
{
(
tasks
||
[]).
map
((
task
,
index
)
=>
{
return
(
<
Col
className=
'mt-3'
key=
{
index
}
md=
{
8
}
>
<
TaskItem
key=
{
index
}
data=
{
task
}
onStart=
{
onStartTask
}
onEdit=
{
onEditTask
}
onDelete=
{
onDeleteTask
}
/>
</
Col
>
);
})
}
</
Row
>
</>
}
</
Spin
>
}
</
div
>
);
...
...
src/view/Manage/DatasourceManage/Component/DatasourceList.jsx
View file @
a9576742
import
React
,
{
useState
}
from
'react'
;
import
{
List
,
Space
,
Button
,
Tooltip
}
from
"antd"
;
import
{
EditOutlined
,
DiffOutlined
,
DeleteOutlined
,
DatabaseOutlined
}
from
'@ant-design/icons'
;
import
{
EditOutlined
,
DiffOutlined
,
DeleteOutlined
,
DatabaseOutlined
,
ArrowDownOutlined
,
ArrowUpOutlined
}
from
'@ant-design/icons'
;
import
DatasourceItem
from
'./DatasourceItem'
;
...
...
@@ -57,8 +57,8 @@ const DatasourceList = (props) => {
<
Tooltip
placement=
'bottom'
title=
{
'删除'
}
>
<
Button
icon=
{
<
DeleteOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
onDelete
&&
onDelete
(
item
);
}
}
/>
</
Tooltip
>
<
Tooltip
placement=
'bottom'
title=
{
'
任务列表'
}
>
<
Button
icon=
{
<
Database
Outlined
/>
}
size=
'small'
onClick=
{
()
=>
{
onExpanded
(
item
);
}
}
/>
<
Tooltip
placement=
'bottom'
title=
{
expanded
?
'隐藏任务列表'
:
'显示
任务列表'
}
>
<
Button
icon=
{
expanded
?
<
ArrowUpOutlined
/>
:
<
ArrowDown
Outlined
/>
}
size=
'small'
onClick=
{
()
=>
{
onExpanded
(
item
);
}
}
/>
</
Tooltip
>
</
Space
>
</
div
>
...
...
src/view/Manage/DatasourceManage/Component/UpdateTaskModal.jsx
View file @
a9576742
...
...
@@ -68,7 +68,7 @@ const UpdateTaskModal = (props) => {
task
&&
(
task
.
targetConfParameters
||
[]).
forEach
(
item
=>
{
if
(
item
.
name
===
'schema'
)
{
setSelectedSchemas
((
item
.
value
||
''
).
split
(
','
));
setSelectedSchemas
((
item
.
value
||
''
).
split
(
','
)
.
filter
(
value
=>
value
!==
''
)
);
}
else
{
_fieldsValue
[
item
.
name
||
''
]
=
item
.
value
||
''
;
}
...
...
@@ -194,8 +194,11 @@ const UpdateTaskModal = (props) => {
label=
{
param
.
cnName
||
''
}
name=
{
param
.
name
||
''
}
key=
{
index
}
rules=
{
[{
required
:
param
.
required
,
message
:
'必填项'
}]
}
>
<
Input
/>
{
(
param
.
show
?
<
Input
/>
:
<
Input
.
Password
/>
)
}
</
Form
.
Item
>
)
})
...
...
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