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
25c0900a
Commit
25c0900a
authored
Jun 13, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采集
parent
d482e183
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
12 deletions
+30
-12
Task.jsx
src/view/Manage/MetadataHarvester/Component/Task.jsx
+25
-8
TaskReport.jsx
src/view/Manage/MetadataHarvester/Component/TaskReport.jsx
+3
-3
index.less
src/view/Manage/MetadataHarvester/index.less
+2
-1
No files found.
src/view/Manage/MetadataHarvester/Component/Task.jsx
View file @
25c0900a
import
React
,
{
useState
,
useEffect
,
useContext
,
useMemo
,
useReducer
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useContext
,
useMemo
,
useReducer
}
from
'react'
;
import
{
Space
,
Button
,
TreeSelect
,
Select
,
Pagination
,
Typography
,
Modal
,
Tooltip
}
from
'antd'
;
import
{
Space
,
Button
,
TreeSelect
,
Select
,
Pagination
,
Typography
,
Modal
,
Tooltip
,
Input
}
from
'antd'
;
import
{
AppContext
}
from
'../../../../App'
;
import
{
AppContext
}
from
'../../../../App'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
...
@@ -20,6 +20,7 @@ const FC = (props) => {
...
@@ -20,6 +20,7 @@ const FC = (props) => {
const
[
tasksProgress
,
setTasksProgress
]
=
useState
(
undefined
);
const
[
tasksProgress
,
setTasksProgress
]
=
useState
(
undefined
);
const
[
visibleCols
,
setVisibleCols
]
=
useState
(
undefined
);
const
[
visibleCols
,
setVisibleCols
]
=
useState
(
undefined
);
const
[
checkedKeys
,
setCheckedKeys
]
=
useState
(
undefined
);
const
[
checkedKeys
,
setCheckedKeys
]
=
useState
(
undefined
);
const
[
keyword
,
setKeyword
]
=
useState
(
undefined
);
const
[
updateTaskParam
,
setUpdateTaskParam
]
=
useState
({
const
[
updateTaskParam
,
setUpdateTaskParam
]
=
useState
({
visible
:
false
,
visible
:
false
,
...
@@ -189,6 +190,7 @@ const FC = (props) => {
...
@@ -189,6 +190,7 @@ const FC = (props) => {
return
(
configState
.
scope
===
undefined
||
item
.
target
?.
scope
===
configState
.
scope
?.
toString
())
return
(
configState
.
scope
===
undefined
||
item
.
target
?.
scope
===
configState
.
scope
?.
toString
())
&&
(
configState
.
datasourceId
===
undefined
||
item
.
target
?.
id
===
configState
.
datasourceId
)
&&
(
configState
.
datasourceId
===
undefined
||
item
.
target
?.
id
===
configState
.
datasourceId
)
&&
(
configState
.
targetType
===
undefined
||
item
.
target
?.
type
===
configState
.
targetType
)
&&
(
configState
.
targetType
===
undefined
||
item
.
target
?.
type
===
configState
.
targetType
)
&&
(
!
keyword
||
(
item
.
taskCode
||
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
schema
||
''
).
indexOf
(
keyword
)
!==-
1
)
});
});
newTasks
?.
forEach
(
item
=>
{
newTasks
?.
forEach
(
item
=>
{
const
index
=
(
supportedTargetTypes
||
[]).
findIndex
(
_item
=>
_item
.
targetType
===
item
.
type
);
const
index
=
(
supportedTargetTypes
||
[]).
findIndex
(
_item
=>
_item
.
targetType
===
item
.
type
);
...
@@ -207,13 +209,14 @@ const FC = (props) => {
...
@@ -207,13 +209,14 @@ const FC = (props) => {
})
})
}
}
console
.
log
(
'newTasks'
,
newTasks
);
newTasks
=
paginate
(
newTasks
,
pagination
.
pageNum
,
pagination
.
pageSize
);
newTasks
=
paginate
(
newTasks
,
pagination
.
pageNum
,
pagination
.
pageSize
);
return
newTasks
;
return
newTasks
;
}
}
return
[]
return
[]
},
[
tasks
,
pagination
,
configState
,
supportedTargetTypes
,
sortedInfo
])
},
[
tasks
,
pagination
,
configState
,
supportedTargetTypes
,
sortedInfo
,
keyword
])
const
total
=
useMemo
(()
=>
{
const
total
=
useMemo
(()
=>
{
if
(
tasks
)
{
if
(
tasks
)
{
...
@@ -221,13 +224,14 @@ const FC = (props) => {
...
@@ -221,13 +224,14 @@ const FC = (props) => {
return
(
configState
.
scope
===
undefined
||
item
.
target
?.
scope
===
configState
.
scope
?.
toString
())
return
(
configState
.
scope
===
undefined
||
item
.
target
?.
scope
===
configState
.
scope
?.
toString
())
&&
(
configState
.
datasourceId
===
undefined
||
item
.
target
?.
id
===
configState
.
datasourceId
)
&&
(
configState
.
datasourceId
===
undefined
||
item
.
target
?.
id
===
configState
.
datasourceId
)
&&
(
configState
.
targetType
===
undefined
||
item
.
target
?.
type
===
configState
.
targetType
)
&&
(
configState
.
targetType
===
undefined
||
item
.
target
?.
type
===
configState
.
targetType
)
&&
(
!
keyword
||
item
.
taskCode
?.
indexOf
(
keyword
)
!==-
1
||
item
.
schema
?.
indexOf
(
keyword
)
!==-
1
)
});
});
return
(
newTasks
||
[]).
length
;
return
(
newTasks
||
[]).
length
;
}
}
return
0
;
return
0
;
},
[
tasks
,
pagination
,
configState
])
},
[
tasks
,
pagination
,
configState
,
keyword
])
const
getAllTasks
=
()
=>
{
const
getAllTasks
=
()
=>
{
setLoadingTasks
(
true
);
setLoadingTasks
(
true
);
...
@@ -308,6 +312,10 @@ const FC = (props) => {
...
@@ -308,6 +312,10 @@ const FC = (props) => {
refresh
&&
getTaskCols
();
refresh
&&
getTaskCols
();
}
}
const
onSearchInputChange
=
(
e
)
=>
{
setKeyword
(
e
.
target
.
value
||
''
);
}
const
onCancelTask
=
(
task
)
=>
{
const
onCancelTask
=
(
task
)
=>
{
modal
.
confirm
({
modal
.
confirm
({
title
:
'是否取消该任务?'
,
title
:
'是否取消该任务?'
,
...
@@ -411,11 +419,20 @@ const FC = (props) => {
...
@@ -411,11 +419,20 @@ const FC = (props) => {
<
Button
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
onClick=
{
onDeleteTasks
}
>
删除
</
Button
>
<
Button
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
onClick=
{
onDeleteTasks
}
>
删除
</
Button
>
</
Tooltip
>
</
Tooltip
>
</
Space
>
</
Space
>
<
Config
setTargetTypes=
{
setSupportedTargetTypes
}
onState=
{
(
state
)
=>
{
<
Space
>
console
.
log
(
'state'
,
state
);
<
Config
setTargetTypes=
{
setSupportedTargetTypes
}
onState=
{
(
state
)
=>
{
setConfigState
(
state
);
console
.
log
(
'state'
,
state
);
setPagination
({...
pagination
,
pageNum
:
1
});
setConfigState
(
state
);
}
}
/>
setPagination
({...
pagination
,
pageNum
:
1
});
}
}
/>
<
Input
placeholder=
'请输入任务编号/抽取Schema名称'
allowClear
value=
{
keyword
}
onChange=
{
onSearchInputChange
}
style=
{
{
width
:
260
}
}
/>
</
Space
>
</
div
>
</
div
>
<
Table
<
Table
className=
'mt-3'
className=
'mt-3'
...
...
src/view/Manage/MetadataHarvester/Component/TaskReport.jsx
View file @
25c0900a
...
@@ -7,7 +7,7 @@ import { AppContext } from '../../../../App';
...
@@ -7,7 +7,7 @@ import { AppContext } from '../../../../App';
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
paginate
}
from
'../../../../util'
;
import
{
paginate
}
from
'../../../../util'
;
import
Table
from
'../../ResizeableTable'
;
import
Table
from
'../../ResizeableTable'
;
import
env
from
'../../../../service/samples/env.json'
;
//
import env from '../../../../service/samples/env.json';
const
{
RangePicker
}
=
DatePicker
;
const
{
RangePicker
}
=
DatePicker
;
const
{
Meta
}
=
Card
;
const
{
Meta
}
=
Card
;
...
@@ -25,7 +25,7 @@ const reportStates = [
...
@@ -25,7 +25,7 @@ const reportStates = [
]
]
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
//
const { env } = useContext(AppContext);
const
{
env
}
=
useContext
(
AppContext
);
const
[
rangeValue
,
setRangeValue
]
=
useState
(
undefined
);
const
[
rangeValue
,
setRangeValue
]
=
useState
(
undefined
);
const
[
summaryData
,
setSummaryData
]
=
useState
(
undefined
);
const
[
summaryData
,
setSummaryData
]
=
useState
(
undefined
);
const
[
reportData
,
setReportData
]
=
useState
(
undefined
);
const
[
reportData
,
setReportData
]
=
useState
(
undefined
);
...
@@ -96,7 +96,7 @@ const FC = (props) => {
...
@@ -96,7 +96,7 @@ const FC = (props) => {
return
(
taskCode
===
undefined
||
item
.
taskCode
===
taskCode
)
return
(
taskCode
===
undefined
||
item
.
taskCode
===
taskCode
)
&&
(
datasourceName
===
undefined
||
item
.
databaseName
===
datasourceName
)
&&
(
datasourceName
===
undefined
||
item
.
databaseName
===
datasourceName
)
&&
(
reportState
===
undefined
||
item
.
state
===
reportState
)
&&
(
reportState
===
undefined
||
item
.
state
===
reportState
)
&&
(
!
keyword
||
item
.
taskCode
?.
indexOf
(
keyword
)
!==-
1
||
item
.
databaseName
?
.
indexOf
(
keyword
)
!==-
1
)
&&
(
!
keyword
||
(
item
.
taskCode
||
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
databaseName
||
''
)
.
indexOf
(
keyword
)
!==-
1
)
});
});
setSummaryData
([
setSummaryData
([
...
...
src/view/Manage/MetadataHarvester/index.less
View file @
25c0900a
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
height: calc(100vh - 124px);
height: calc(100vh - 124px);
padding: 20px;
padding: 20px;
background: #fff;
background: #fff;
overflow:
auto
;
overflow:
hidden
;
}
}
\ No newline at end of file
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