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
dbe0e74f
Commit
dbe0e74f
authored
Jan 26, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增任务
parent
98991488
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
7 deletions
+85
-7
update-task.jsx
src/view/Manage/ModelCompare/update-task.jsx
+85
-7
No files found.
src/view/Manage/ModelCompare/update-task.jsx
View file @
dbe0e74f
...
...
@@ -5,9 +5,9 @@ import moment from 'moment'
import
produce
from
'immer'
import
{
dispatch
}
from
'../../../model'
import
Table
from
'../../../util/Component/Table'
import
Table
,
{
generateId
}
from
'../../../util/Component/Table'
import
{
saveColumns
}
from
'../../../service/msd'
import
{
showMessage
}
from
'../../../util'
import
{
generateUUID
,
showMessage
}
from
'../../../util'
const
FC
=
(
props
)
=>
{
const
{
visible
,
type
,
item
,
onCancel
}
=
props
...
...
@@ -61,12 +61,25 @@ const FC = (props) => {
const
save
=
async
()
=>
{
try
{
const
basicRows
=
await
basicFormRef
.
current
?.
validate
()
const
rangeRows
=
await
rangeRef
.
current
?.
validate
()
const
strategyRows
=
await
strategyRef
.
current
?.
validate
()
const
scheduleRows
=
await
scheduleFormRef
.
current
?.
validate
()
console
.
log
(
'basicRows'
,
basicRows
)
console
.
log
(
'rangeRows'
,
rangeRows
)
console
.
log
(
'strategyRows'
,
strategyRows
)
console
.
log
(
'scheduleRows'
,
scheduleRows
)
if
((
rangeRows
??[]).
length
===
0
)
{
showMessage
(
'warn'
,
'请先填写对比范围'
)
return
}
if
((
strategyRows
??[]).
length
===
0
)
{
showMessage
(
'warn'
,
'请先填写对比策略'
)
return
}
setWaiting
(
true
)
if
(
type
===
'add'
)
{
dispatch
({
...
...
@@ -74,6 +87,7 @@ const FC = (props) => {
payload
:
{
data
:
{
...
basicRows
,
jobCatalogItems
:
rangeRows
,
strategyItemPropertyTypes
:
strategyRows
,
jobSchedule
:
scheduleRows
,
}
...
...
@@ -92,6 +106,7 @@ const FC = (props) => {
data
:
{
...
task
,
...
basicRows
,
jobCatalogItems
:
rangeRows
,
strategyItemPropertyTypes
:
strategyRows
,
jobSchedule
:
scheduleRows
,
}
...
...
@@ -135,7 +150,7 @@ const FC = (props) => {
<
Header
title=
'基本信息'
/>
<
BasicForm
ref=
{
basicFormRef
}
type=
{
type
}
task=
{
task
}
/>
<
Header
title=
'对比范围'
/>
<
Range
ref=
{
rangeRef
}
/>
<
Range
ref=
{
rangeRef
}
type=
{
type
}
task=
{
task
}
/>
<
Header
title=
'对比策略'
/>
<
Strategy
ref=
{
strategyRef
}
type=
{
type
}
task=
{
task
}
/>
<
Header
title=
'调度配置'
/>
...
...
@@ -707,11 +722,54 @@ const Range = React.forwardRef(function ({ type, task }, ref) {
const
[
isAdding
,
setAdding
]
=
React
.
useState
(
false
)
const
[
form
]
=
Form
.
useForm
()
const
rangesRef
=
React
.
useRef
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
validate
:
async
()
=>
{
await
onOkClick
()
return
rangesRef
.
current
},
}),
[
ranges
,
isAdding
])
const
onAddClick
=
()
=>
{
if
(
isAdding
)
return
setAdding
(
true
)
}
const
onOkClick
=
async
()
=>
{
rangesRef
.
current
=
ranges
??[]
if
(
!
isAdding
)
return
try
{
const
rows
=
await
form
.
validateFields
()
let
newRanges
=
[...
ranges
??[]]
newRanges
=
[...
newRanges
,
{
...
rows
.
modelRange
,
...
rows
.
metadataRange
,
}]
console
.
log
(
'newRanges'
,
newRanges
)
setRanges
(
newRanges
)
rangesRef
.
current
=
newRanges
setAdding
(
false
)
}
catch
(
e
)
{
throw
new
Error
()
}
}
const
onCancelClick
=
()
=>
{
setAdding
(
false
)
}
const
onRangeDeleteClick
=
(
index
)
=>
{
const
newRanges
=
[...
ranges
??[]]
newRanges
.
splice
(
index
,
1
)
setRanges
(
newRanges
)
}
return
(
<
div
>
{
...
...
@@ -727,27 +785,47 @@ const Range = React.forwardRef(function ({ type, task }, ref) {
autoComplete=
"off"
>
<
Row
gutter=
{
15
}
>
<
Col
span=
{
1
2
}
>
<
Col
span=
{
1
0
}
>
<
Form
.
Item
label=
"数据模型范围"
name=
"model
CatalogId
"
name=
"model
Range
"
rules=
{
[{
required
:
true
,
message
:
'请选择模型范围!'
}]
}
>
<
ModelRangeItem
/>
</
Form
.
Item
>
</
Col
>
<
Col
span=
{
1
2
}
>
<
Col
span=
{
1
0
}
>
<
Form
.
Item
label=
"数据元数据范围"
name=
"m
odelCatalogId
"
name=
"m
etadataRange
"
rules=
{
[{
required
:
true
,
message
:
'请选择元数据范围!'
}]
}
>
<
MetadataRangeItem
/>
</
Form
.
Item
>
</
Col
>
<
Col
span=
{
4
}
>
<
Space
>
<
Button
onClick=
{
onOkClick
}
>
确定
</
Button
>
<
Button
onClick=
{
onCancelClick
}
>
取消
</
Button
>
</
Space
>
</
Col
>
</
Row
>
</
Form
>
}
{
(
ranges
??[]).
map
((
item
,
index
)
=>
{
return
(
<
Row
className=
'mb-1'
key=
{
generateUUID
()
}
align=
'middle'
gutter=
{
15
}
>
<
Col
span=
{
12
}
>
{
`【模型】${(item.modelCatalogNameList??[]).join('/')} -【元数据】${(item.metadataCatalogNameList??[]).join('/')}`
}
</
Col
>
{
type
!==
'detail'
&&
<
Button
type=
'link'
onClick=
{
()
=>
onRangeDeleteClick
(
index
)
}
>
删除
</
Button
>
}
</
Row
>
)
})
}
</
div
>
)
})
...
...
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