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
713389c3
Commit
713389c3
authored
Jan 26, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务可见列设置
parent
c6c16cc5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
190 additions
and
2 deletions
+190
-2
datamodel.js
src/model/datamodel.js
+9
-0
datamodeler.js
src/service/datamodeler.js
+9
-0
col-config.jsx
src/view/Manage/ModelCompare/col-config.jsx
+127
-0
task-manage.jsx
src/view/Manage/ModelCompare/task-manage.jsx
+45
-2
No files found.
src/model/datamodel.js
View file @
713389c3
...
@@ -530,4 +530,12 @@ export function* getChildBySystem(payload) {
...
@@ -530,4 +530,12 @@ export function* getChildBySystem(payload) {
export
function
*
getChildByParentId
(
payload
)
{
export
function
*
getChildByParentId
(
payload
)
{
return
yield
call
(
metadataService
.
getChildByParentId
,
payload
)
return
yield
call
(
metadataService
.
getChildByParentId
,
payload
)
}
export
function
*
getSettingCols
(
payload
)
{
return
yield
call
(
datamodelerService
.
getSettingCols
,
payload
)
}
export
function
*
setSettingCols
(
payload
)
{
return
yield
call
(
datamodelerService
.
setSettingCols
,
payload
)
}
}
\ No newline at end of file
src/service/datamodeler.js
View file @
713389c3
...
@@ -475,4 +475,12 @@ export function getStrategyItemPropertyTypes() {
...
@@ -475,4 +475,12 @@ export function getStrategyItemPropertyTypes() {
export
function
getCompareJobCronCycleTypes
()
{
export
function
getCompareJobCronCycleTypes
()
{
return
GetJSON
(
"/datamodeler/easyDataModelModelCompareJob/getCronCycleTypes"
)
return
GetJSON
(
"/datamodeler/easyDataModelModelCompareJob/getCronCycleTypes"
)
}
export
function
getSettingCols
(
payload
)
{
return
GetJSON
(
"/dataquality/setting/get"
,
payload
)
}
export
function
setSettingCols
(
payload
)
{
return
PostJSON
(
"/dataquality/setting/set"
,
payload
)
}
}
\ No newline at end of file
src/view/Manage/ModelCompare/col-config.jsx
0 → 100644
View file @
713389c3
import
React
,
{
useEffect
}
from
'react'
import
{
Modal
,
Button
,
Spin
,
Switch
,
Checkbox
,
Row
,
Col
}
from
'antd'
import
{
dispatch
}
from
'../../../model'
const
FC
=
(
props
)
=>
{
const
{
visible
,
type
,
cols
,
onCancel
}
=
props
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
checkedKeys
,
setCheckedKeys
]
=
React
.
useState
([])
useEffect
(()
=>
{
if
(
visible
&&
type
)
{
getColConfig
()
}
},
[
visible
])
const
getColConfig
=
()
=>
{
setLoading
(
true
)
dispatch
({
type
:
'datamodel.getSettingCols'
,
payload
:
{
type
},
callback
:
data
=>
{
setLoading
(
false
)
setCheckedKeys
(
data
?.
settings
)
},
error
:
()
=>
{
setLoading
(
false
)
}
})
}
const
onCheckAllChange
=
(
checked
)
=>
{
let
newCheckedKeys
=
[]
if
(
checked
)
{
newCheckedKeys
=
(
cols
??[]).
map
(
item
=>
item
.
title
)
}
else
{
newCheckedKeys
=
(
cols
??[]).
filter
(
item
=>
item
.
required
).
map
(
item
=>
item
.
title
)
}
setCheckedKeys
(
newCheckedKeys
);
}
const
onCheckChange
=
(
checkedValues
)
=>
{
setCheckedKeys
(
checkedValues
)
}
const
close
=
(
refresh
=
false
)
=>
{
setWaiting
(
false
)
onCancel
?.(
refresh
)
}
const
save
=
()
=>
{
setWaiting
(
true
)
dispatch
({
type
:
'datamodel.setSettingCols'
,
payload
:
{
params
:
{
type
,
},
data
:
checkedKeys
},
callback
:
data
=>
{
close
(
true
)
},
error
:
()
=>
{
setWaiting
(
false
)
}
})
}
const
footer
=
React
.
useMemo
(()
=>
{
return
[
<
Button
key=
{
'cancel'
}
onClick=
{
()
=>
close
()
}
>
取消
</
Button
>,
<
Button
key=
{
'save'
}
type=
'primary'
disabled=
{
waiting
}
onClick=
{
()
=>
save
()
}
>
保存
</
Button
>
]
},
[
close
,
save
,
waiting
])
return
(
<
Modal
title=
'可见列设置'
width=
{
600
}
bodyStyle=
{
{
overflowX
:
'auto'
,
maxHeight
:
'80vh'
}
}
visible=
{
visible
}
footer=
{
footer
}
onCancel=
{
()
=>
{
close
()
}
}
>
<
Spin
spinning=
{
loading
||
waiting
}
>
<
div
className=
'flex'
style=
{
{
justifyContent
:
'flex-end'
}
}
>
<
Switch
checkedChildren=
'全不选'
unCheckedChildren=
'全选'
onChange=
{
onCheckAllChange
}
/>
</
div
>
<
Checkbox
.
Group
className=
'mt-3'
value=
{
checkedKeys
}
style=
{
{
width
:
'100%'
}
}
onChange=
{
onCheckChange
}
>
<
Row
>
{
(
cols
??[]).
map
((
col
,
index
)
=>
{
return
(
<
Col
key=
{
index
}
md=
{
6
}
>
<
Checkbox
value=
{
col
.
title
}
disabled=
{
col
.
required
}
>
{
col
.
title
}
</
Checkbox
>
</
Col
>
)
})
}
</
Row
>
</
Checkbox
.
Group
>
</
Spin
>
</
Modal
>
)
}
export
default
FC
\ No newline at end of file
src/view/Manage/ModelCompare/task-manage.jsx
View file @
713389c3
...
@@ -6,9 +6,12 @@ import Table from '../../../util/Component/Table'
...
@@ -6,9 +6,12 @@ import Table from '../../../util/Component/Table'
import
{
dispatch
}
from
'../../../model'
import
{
dispatch
}
from
'../../../model'
import
{
generateUUID
,
paginate
,
showMessage
}
from
'../../../util'
import
{
generateUUID
,
paginate
,
showMessage
}
from
'../../../util'
import
UpdateTask
from
'./update-task'
import
UpdateTask
from
'./update-task'
import
ColConfig
from
'./col-config'
import
'../AssetTask/index.less'
import
'../AssetTask/index.less'
const
ColType
=
'data-model-compare'
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
const
[
args
,
setArgs
]
=
React
.
useState
({
const
[
args
,
setArgs
]
=
React
.
useState
({
state
:
undefined
,
state
:
undefined
,
...
@@ -26,10 +29,15 @@ const FC = (props) => {
...
@@ -26,10 +29,15 @@ const FC = (props) => {
item
:
undefined
,
item
:
undefined
,
type
:
undefined
type
:
undefined
})
})
const
[
colConfigParams
,
setColConfigParams
]
=
React
.
useState
({
visible
:
false
,
})
const
[
visibleColNames
,
setVisibleColNames
]
=
React
.
useState
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
getColConfig
()
getStates
()
getStates
()
getTasks
()
getTasks
()
},
[])
},
[])
...
@@ -164,6 +172,27 @@ const FC = (props) => {
...
@@ -164,6 +172,27 @@ const FC = (props) => {
},
},
]
]
const
columns
=
React
.
useMemo
(()
=>
{
return
[...
cols
].
filter
(
item
=>
(
visibleColNames
??[]).
length
===
0
||
(
visibleColNames
??[]).
includes
(
item
.
title
))
},
[
cols
,
visibleColNames
])
const
getColConfig
=
()
=>
{
setLoading
(
true
)
dispatch
({
type
:
'datamodel.getSettingCols'
,
payload
:
{
type
:
ColType
},
callback
:
data
=>
{
setLoading
(
false
)
setVisibleColNames
(
data
?.
settings
)
},
error
:
()
=>
{
setLoading
(
false
)
}
})
}
const
getStates
=
()
=>
{
const
getStates
=
()
=>
{
setLoadingStates
(
true
)
setLoadingStates
(
true
)
dispatch
({
dispatch
({
...
@@ -223,7 +252,9 @@ const FC = (props) => {
...
@@ -223,7 +252,9 @@ const FC = (props) => {
}
}
const
onVisbleColConfigClick
=
()
=>
{
const
onVisbleColConfigClick
=
()
=>
{
setColConfigParams
({
visible
:
true
,
})
}
}
const
onRightMenuItemClick
=
(
key
,
record
)
=>
{
const
onRightMenuItemClick
=
(
key
,
record
)
=>
{
...
@@ -312,7 +343,7 @@ const FC = (props) => {
...
@@ -312,7 +343,7 @@ const FC = (props) => {
extraColWidth=
{
32
}
extraColWidth=
{
32
}
loading=
{
loading
}
loading=
{
loading
}
maxHeight=
'calc(100vh - 285px - 46px)'
maxHeight=
'calc(100vh - 285px - 46px)'
columns=
{
cols
??[]
}
columns=
{
col
umn
s
??[]
}
dataSource=
{
tableData
??[]
}
dataSource=
{
tableData
??[]
}
rowSelection=
{
{
rowSelection=
{
{
selectedRowKeys
:
(
selectedRows
??[]).
map
(
item
=>
item
.
id
),
selectedRowKeys
:
(
selectedRows
??[]).
map
(
item
=>
item
.
id
),
...
@@ -344,6 +375,18 @@ const FC = (props) => {
...
@@ -344,6 +375,18 @@ const FC = (props) => {
refresh
&&
getTasks
()
refresh
&&
getTasks
()
}
}
}
}
/>
/>
<
ColConfig
{
...
colConfigParams
}
type=
{
ColType
}
cols=
{
cols
}
onCancel=
{
(
refresh
)
=>
{
setColConfigParams
({
visible
:
false
,
})
refresh
&&
getColConfig
()
}
}
/>
{
contextHolder
}
{
contextHolder
}
</
div
>
</
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