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
7f69bb8b
Commit
7f69bb8b
authored
Jan 25, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对比范围
parent
5b2c87ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
110 additions
and
4 deletions
+110
-4
update-task.jsx
src/view/Manage/ModelCompare/update-task.jsx
+110
-4
No files found.
src/view/Manage/ModelCompare/update-task.jsx
View file @
7f69bb8b
import
React
from
'react'
import
{
Button
,
Modal
,
Spin
,
Space
,
Divider
,
Form
,
Row
,
Col
,
Input
,
Select
,
Checkbox
,
Radio
,
Switch
,
TimePicker
,
Tooltip
}
from
'antd'
import
{
Button
,
Modal
,
Spin
,
Space
,
Divider
,
Form
,
Row
,
Col
,
Input
,
Select
,
Checkbox
,
Radio
,
Switch
,
TimePicker
,
Tooltip
,
TreeSelect
}
from
'antd'
import
{
useClickAway
}
from
'ahooks'
import
moment
from
'moment'
import
produce
from
'immer'
import
{
dispatch
}
from
'../../../model'
import
Table
from
'../../../util/Component/Table'
...
...
@@ -14,9 +15,10 @@ const FC = (props) => {
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
task
,
setTask
]
=
React
.
useState
()
const
basicFormRef
=
React
.
useRef
(
null
)
const
strategyRef
=
React
.
useRef
(
null
)
const
scheduleFormRef
=
React
.
useRef
(
null
)
const
basicFormRef
=
React
.
useRef
()
const
rangeRef
=
React
.
useRef
()
const
strategyRef
=
React
.
useRef
()
const
scheduleFormRef
=
React
.
useRef
()
const
title
=
React
.
useMemo
(()
=>
{
if
(
type
===
'add'
)
return
'新增任务'
...
...
@@ -132,6 +134,8 @@ const FC = (props) => {
<
Spin
spinning=
{
loading
||
waiting
}
>
<
Header
title=
'基本信息'
/>
<
BasicForm
ref=
{
basicFormRef
}
type=
{
type
}
task=
{
task
}
/>
<
Header
title=
'对比范围'
/>
<
Range
ref=
{
rangeRef
}
/>
<
Header
title=
'对比策略'
/>
<
Strategy
ref=
{
strategyRef
}
type=
{
type
}
task=
{
task
}
/>
<
Header
title=
'调度配置'
/>
...
...
@@ -354,6 +358,108 @@ const BasicForm = React.forwardRef(function ({ type, task }, ref) {
)
})
const
Range
=
React
.
forwardRef
(
function
({
type
,
task
},
ref
)
{
const
[
ranges
,
setRanges
]
=
React
.
useState
()
const
[
isAdding
,
setAdding
]
=
React
.
useState
(
false
)
const
[
loadingModelTree
,
setLoadingModelTree
]
=
React
.
useState
(
false
)
const
[
modelTreeData
,
setModelTreeData
]
=
React
.
useState
()
const
[
form
]
=
Form
.
useForm
()
React
.
useEffect
(()
=>
{
getModelTree
()
},
[])
const
[
modelTreeData1
,
modelTreeList
]
=
React
.
useMemo
(()
=>
{
if
(
modelTreeData
)
{
const
newTreeList
=
[]
const
newTreeData
=
produce
(
modelTreeData
,
draft
=>
{
const
setNode
=
(
g
)
=>
{
g
.
key
=
g
.
id
g
.
title
=
g
.
name
g
.
value
=
g
.
id
g
.
children
?.
forEach
((
child
)
=>
{
setNode
(
child
)
})
}
for
(
let
item
of
draft
??[])
{
setNode
(
item
)
}
})
newTreeList
.
push
(
treeData
)
generateList
(
treeData
?.
children
,
newTreeList
)
return
[
[
newTreeData
],
newTreeList
]
}
return
[[],
[]]
},
[
modelTreeData
])
const
getModelTree
=
()
=>
{
setLoadingModelTree
(
true
)
dispatch
({
type
:
'datamodel.refreshDataModelCatalog'
,
callback
:
(
data
)
=>
{
setLoadingModelTree
(
false
)
setModelTreeData
(
data
?.
subCatalogs
)
},
erorr
:
()
=>
{
setLoadingModelTree
(
false
)
}
})
}
const
onAddClick
=
()
=>
{
setAdding
(
true
)
}
return
(
<
div
>
{
type
!==
'detail'
&&
<
div
className=
'mb-3'
>
<
Button
onClick=
{
onAddClick
}
>
新建
</
Button
>
</
div
>
}
{
isAdding
&&
<
Form
form=
{
form
}
labelCol=
{
{
span
:
6
}
}
wrapperCol=
{
{
span
:
18
}
}
autoComplete=
"off"
// onValuesChange=
{
onValuesChange
}
>
<
Row
gutter=
{
15
}
>
<
Col
span=
{
12
}
>
<
Form
.
Item
label=
"数据模型范围"
name=
"modelCatalogId"
style=
{
{
marginBottom
}
}
rules=
{
[{
required
:
true
,
message
:
'请选择任务分组!'
}]
}
>
<
TreeSelect
loading=
{
loadingModelTree
}
dropdownStyle=
{
{
maxHeight
:
400
,
overflow
:
'auto'
}
}
treeData=
{
treeData1
}
placeholder=
"请选择分组"
treeDefaultExpandAll
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Form
>
}
</
div
>
)
})
const
Strategy
=
React
.
forwardRef
(
function
({
type
,
task
},
ref
)
{
const
[
loadingPropertyTypes
,
setLoadingPropertyTypes
]
=
React
.
useState
(
false
)
const
[
propertyTypes
,
setPropertyTypes
]
=
React
.
useState
()
...
...
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