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
fc499916
Commit
fc499916
authored
Jun 13, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采集
parent
3c230def
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
3 deletions
+58
-3
TaskReport.jsx
src/view/Manage/MetadataHarvester/Component/TaskReport.jsx
+58
-3
No files found.
src/view/Manage/MetadataHarvester/Component/TaskReport.jsx
View file @
fc499916
import
React
,
{
useState
,
useEffect
,
useContext
,
useMemo
}
from
'react'
;
import
{
Space
,
DatePicker
,
Row
,
Col
,
Card
,
Spin
,
Empty
,
Typography
,
Pagination
,
Input
}
from
'antd'
;
import
{
Space
,
DatePicker
,
Row
,
Col
,
Card
,
Spin
,
Empty
,
Typography
,
Pagination
,
Input
,
Select
}
from
'antd'
;
import
'moment/locale/zh-cn'
;
import
locale
from
'antd/es/date-picker/locale/zh_CN'
;
...
...
@@ -18,16 +18,27 @@ function compare(val1, val2) {
return
(
a
-
b
);
}
const
reportStates
=
[
{
title
:
'完成'
,
key
:
''
},
{
title
:
'失败'
,
key
:
''
},
{
title
:
'执行中'
,
key
:
''
},
{
title
:
'已取消'
,
key
:
''
},
]
const
FC
=
(
props
)
=>
{
// const { env } = useContext(AppContext);
const
[
rangeValue
,
setRangeValue
]
=
useState
(
undefined
);
const
[
datasources
,
setDatasources
]
=
useState
(
undefined
);
const
[
summaryData
,
setSummaryData
]
=
useState
(
undefined
);
const
[
reportData
,
setReportData
]
=
useState
(
undefined
);
const
[
tracerData
,
setTracerData
]
=
useState
(
undefined
);
const
[
loadingReport
,
setLoadingReport
]
=
useState
(
false
);
const
[
pagination
,
setPagination
]
=
useState
({
pageNum
:
1
,
pageSize
:
20
});
const
[
keyword
,
setKeyword
]
=
useState
(
undefined
);
const
[
datasourceId
,
setDatasourceId
]
=
useState
(
undefined
);
const
[
reportState
,
setReportState
]
=
useState
(
''
);
const
[
loadingDatasources
,
setLoadingDatasources
]
=
useState
(
false
);
const
[
datasources
,
setDatasources
]
=
useState
([]);
const
{
pageNum
,
pageSize
}
=
pagination
;
...
...
@@ -76,8 +87,26 @@ const FC = (props) => {
useEffect
(()
=>
{
getTaskReportSummary
();
getTaskReportDetail
();
getDatasources
();
},
[
env
])
const
getDatasources
=
()
=>
{
setLoadingDatasources
(
true
);
dispatch
({
type
:
'datasource.getAllDatasources'
,
payload
:
{
namespace
:
env
?.
domainId
,
},
callback
:
data
=>
{
setLoadingDatasources
(
false
);
setDatasources
(
data
);
},
error
:
()
=>
{
setLoadingDatasources
(
false
);
}
})
}
const
getTaskReportSummary
=
()
=>
{
dispatch
({
type
:
'datasource.getTaskReportSummary'
,
...
...
@@ -142,6 +171,10 @@ const FC = (props) => {
setRangeValue
(
value
?.
map
(
item
=>
item
.
valueOf
()));
}
const
onDatasourceChange
=
(
value
)
=>
{
setDatasourceId
(
value
);
}
const
onSearchInputChange
=
(
e
)
=>
{
setKeyword
(
e
.
target
.
value
||
''
);
}
...
...
@@ -152,7 +185,7 @@ const FC = (props) => {
return
(
<
div
>
<
div
>
<
div
className=
'flex'
style=
{
{
justifyContent
:
'end'
}
}
>
<
Space
>
<
RangePicker
locale=
{
locale
}
...
...
@@ -161,6 +194,28 @@ const FC = (props) => {
onChange=
{
onTimeChange
}
onOk=
{
onTimeOk
}
/>
<
Select
allowClear
loading=
{
loadingDatasources
}
value=
{
datasourceId
}
placeholder=
'请选择数据库'
style=
{
{
width
:
170
}
}
onChange=
{
onDatasourceChange
}
>
{
datasources
?.
map
((
item
,
index
)
=>
{
const
nameIndex
=
item
.
targetParameters
?.
findIndex
(
_item
=>
_item
.
name
===
'name'
);
let
name
=
''
;
if
(
nameIndex
!==
-
1
)
{
name
=
item
.
targetParameters
[
nameIndex
].
value
;
}
return
(
<
Select
.
Option
key=
{
index
}
value=
{
item
.
id
}
>
{
name
}
</
Select
.
Option
>
);
})
}
</
Select
>
<
Input
placeholder=
'请输入任务编号/数据库'
allowClear
...
...
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