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
63b30b92
Commit
63b30b92
authored
May 18, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整数据源管理
parent
9452d8af
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
9 deletions
+26
-9
DatasourceItem.jsx
...view/Manage/DatasourceManage/Component/DatasourceItem.jsx
+18
-4
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 @
63b30b92
import
React
,
{
useEffect
,
useState
}
from
'react'
;
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
TaskItem
from
'./TaskItem'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
...
@@ -9,6 +9,7 @@ import './DatasourceItem.less';
...
@@ -9,6 +9,7 @@ import './DatasourceItem.less';
const
DatasourceItem
=
(
props
)
=>
{
const
DatasourceItem
=
(
props
)
=>
{
const
{
data
,
onStartTask
,
onEditTask
,
onDeleteTask
,
expanded
,
refresh
,
refreshSuccess
}
=
props
;
const
{
data
,
onStartTask
,
onEditTask
,
onDeleteTask
,
expanded
,
refresh
,
refreshSuccess
}
=
props
;
const
[
tasks
,
setTasks
]
=
useState
(
null
);
const
[
tasks
,
setTasks
]
=
useState
(
null
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
expanded
&&
!
tasks
)
{
if
(
expanded
&&
!
tasks
)
{
...
@@ -27,14 +28,19 @@ const DatasourceItem = (props) => {
...
@@ -27,14 +28,19 @@ const DatasourceItem = (props) => {
},
[
refresh
])
},
[
refresh
])
const
getTasks
=
()
=>
{
const
getTasks
=
()
=>
{
setLoading
(
true
);
dispatch
({
dispatch
({
type
:
'datasource.getTasksByDatasourceId'
,
type
:
'datasource.getTasksByDatasourceId'
,
payload
:
{
payload
:
{
datasourceId
:
data
.
id
datasourceId
:
data
.
id
},
},
callback
:
data
=>
{
callback
:
data
=>
{
setLoading
(
false
);
setTasks
(
data
);
setTasks
(
data
);
refresh
&&
refreshSuccess
&&
refreshSuccess
();
refresh
&&
refreshSuccess
&&
refreshSuccess
();
},
error
:
()
=>
{
setLoading
(
false
);
}
}
})
})
}
}
...
@@ -67,13 +73,18 @@ const DatasourceItem = (props) => {
...
@@ -67,13 +73,18 @@ const DatasourceItem = (props) => {
}
}
</
Row
>
</
Row
>
{
{
expanded
&&
<>
expanded
&&
<
Divider
/>
<
Divider
/>
}
{
expanded
&&
<
Spin
spinning=
{
loading
}
>
{
(
tasks
||
[]).
length
===
0
?
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
"暂无任务"
/>
:
<>
<
Divider
>
任务列表
</
Divider
>
<
Row
gutter=
{
10
}
>
<
Row
gutter=
{
10
}
>
{
{
(
tasks
||
[]).
map
((
task
,
index
)
=>
{
(
tasks
||
[]).
map
((
task
,
index
)
=>
{
return
(
return
(
<
Col
key=
{
index
}
md=
{
8
}
>
<
Col
className=
'mt-3'
key=
{
index
}
md=
{
8
}
>
<
TaskItem
<
TaskItem
key=
{
index
}
key=
{
index
}
data=
{
task
}
data=
{
task
}
...
@@ -88,6 +99,9 @@ const DatasourceItem = (props) => {
...
@@ -88,6 +99,9 @@ const DatasourceItem = (props) => {
</
Row
>
</
Row
>
</>
</>
}
}
</
Spin
>
}
</
div
>
</
div
>
);
);
}
}
...
...
src/view/Manage/DatasourceManage/Component/DatasourceList.jsx
View file @
63b30b92
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
List
,
Space
,
Button
,
Tooltip
}
from
"antd"
;
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'
;
import
DatasourceItem
from
'./DatasourceItem'
;
...
@@ -57,8 +57,8 @@ const DatasourceList = (props) => {
...
@@ -57,8 +57,8 @@ const DatasourceList = (props) => {
<
Tooltip
placement=
'bottom'
title=
{
'删除'
}
>
<
Tooltip
placement=
'bottom'
title=
{
'删除'
}
>
<
Button
icon=
{
<
DeleteOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
onDelete
&&
onDelete
(
item
);
}
}
/>
<
Button
icon=
{
<
DeleteOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
onDelete
&&
onDelete
(
item
);
}
}
/>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
placement=
'bottom'
title=
{
'
任务列表'
}
>
<
Tooltip
placement=
'bottom'
title=
{
expanded
?
'隐藏任务列表'
:
'显示
任务列表'
}
>
<
Button
icon=
{
<
Database
Outlined
/>
}
size=
'small'
onClick=
{
()
=>
{
onExpanded
(
item
);
}
}
/>
<
Button
icon=
{
expanded
?
<
ArrowUpOutlined
/>
:
<
ArrowDown
Outlined
/>
}
size=
'small'
onClick=
{
()
=>
{
onExpanded
(
item
);
}
}
/>
</
Tooltip
>
</
Tooltip
>
</
Space
>
</
Space
>
</
div
>
</
div
>
...
...
src/view/Manage/DatasourceManage/Component/UpdateTaskModal.jsx
View file @
63b30b92
...
@@ -68,7 +68,7 @@ const UpdateTaskModal = (props) => {
...
@@ -68,7 +68,7 @@ const UpdateTaskModal = (props) => {
task
&&
(
task
.
targetConfParameters
||
[]).
forEach
(
item
=>
{
task
&&
(
task
.
targetConfParameters
||
[]).
forEach
(
item
=>
{
if
(
item
.
name
===
'schema'
)
{
if
(
item
.
name
===
'schema'
)
{
setSelectedSchemas
((
item
.
value
||
''
).
split
(
','
));
setSelectedSchemas
((
item
.
value
||
''
).
split
(
','
)
.
filter
(
value
=>
value
!==
''
)
);
}
else
{
}
else
{
_fieldsValue
[
item
.
name
||
''
]
=
item
.
value
||
''
;
_fieldsValue
[
item
.
name
||
''
]
=
item
.
value
||
''
;
}
}
...
@@ -194,8 +194,11 @@ const UpdateTaskModal = (props) => {
...
@@ -194,8 +194,11 @@ const UpdateTaskModal = (props) => {
label=
{
param
.
cnName
||
''
}
label=
{
param
.
cnName
||
''
}
name=
{
param
.
name
||
''
}
name=
{
param
.
name
||
''
}
key=
{
index
}
key=
{
index
}
rules=
{
[{
required
:
param
.
required
,
message
:
'必填项'
}]
}
>
>
<
Input
/>
{
(
param
.
show
?
<
Input
/>
:
<
Input
.
Password
/>
)
}
</
Form
.
Item
>
</
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