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
36fc1774
Commit
36fc1774
authored
Mar 19, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型合并
parent
32f0011d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
2 deletions
+115
-2
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+3
-1
merge-to-master.jsx
src/view/Manage/Model/Component/merge-to-master.jsx
+76
-0
index.jsx
src/view/Manage/Model/index.jsx
+36
-1
No files found.
src/view/Manage/Model/Component/ModelTable.jsx
View file @
36fc1774
...
@@ -135,7 +135,7 @@ const ModelNameColumn = (props) => {
...
@@ -135,7 +135,7 @@ const ModelNameColumn = (props) => {
}
}
const ModelTable = (props) => {
const ModelTable = (props) => {
const { data, onChange, onItemAction, onSelect, onHistory, catalogId, keyword, onAutoCreateTable, offset = null, view, modelState, user, selectModelerIds, visibleColNames, tagSelectOptions, batchAddTagChange } = props;
const { data, onChange, onItemAction, onSelect, onHistory, catalogId, keyword, onAutoCreateTable, offset = null, view, modelState, user, selectModelerIds, visibleColNames, tagSelectOptions, batchAddTagChange
, onMerge
} = props;
const [ selectedRowKeys, setSelectedRowKeys ] = useState([]);
const [ selectedRowKeys, setSelectedRowKeys ] = useState([]);
const [ expandedSelectedRowKeys, setExpandedSelectedRowKeys ] = useState([]);
const [ expandedSelectedRowKeys, setExpandedSelectedRowKeys ] = useState([]);
...
@@ -583,6 +583,8 @@ const ModelTable = (props) => {
...
@@ -583,6 +583,8 @@ const ModelTable = (props) => {
const index = (key.split('-'))[1];
const index = (key.split('-'))[1];
const action = currentItem?.state?.supportedActions[index];
const action = currentItem?.state?.supportedActions[index];
stateAction(currentItem, action);
stateAction(currentItem, action);
} else if (key === 'join') {
onMerge(currentItem);
}
}
}
}
...
...
src/view/Manage/Model/Component/merge-to-master.jsx
0 → 100644
View file @
36fc1774
import
React
from
'react'
import
{
Modal
,
Button
,
Spin
,
}
from
'antd'
import
{
dispatch
}
from
'../../../../model'
const
FC
=
(
props
)
=>
{
const
{
items
,
branchId
,
visible
,
onCancel
}
=
props
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
close
=
(
val
)
=>
{
setWaiting
(
false
)
onCancel
?.(
val
)
}
const
save
=
()
=>
{
}
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
visible=
{
visible
}
footer=
{
footer
}
width=
{
800
}
bodyStyle=
{
{
padding
:
'15px'
,
overflowX
:
'auto'
,
maxHeight
:
'80vh'
}
}
title=
'合并到基线'
centered
destroyOnClose
onCancel=
{
()
=>
{
close
()
}
}
>
<
Spin
spinning=
{
waiting
}
>
<
Diff
items=
{
items
}
branchId=
{
branchId
}
/>
</
Spin
>
</
Modal
>
)
}
export
default
FC
export
const
Diff
=
React
.
forwardRef
(
function
({
items
,
branchId
,
},
ref
)
{
React
.
useEffect
(()
=>
{
if
((
items
??[]).
length
>
0
)
{
getDiffForked
()
}
},
[
items
])
const
getDiffForked
=
()
=>
{
dispatch
({
type
:
'datamodel.getBranchDiffForked'
,
payload
:
{
id
:
items
[
0
].
id
,
branchId
,
},
callback
:
data
=>
{
}
})
}
return
(
<
div
>
basic
</
div
>
)
})
\ No newline at end of file
src/view/Manage/Model/index.jsx
View file @
36fc1774
...
@@ -24,6 +24,7 @@ import SelectSearchProperties from './Component/select-search-properties';
...
@@ -24,6 +24,7 @@ import SelectSearchProperties from './Component/select-search-properties';
import
{
TagSelect
,
TagSelectPopup
}
from
'./Component/tag-help'
;
import
{
TagSelect
,
TagSelectPopup
}
from
'./Component/tag-help'
;
import
BranchAddModel
from
'./Component/branch-add-model'
import
BranchAddModel
from
'./Component/branch-add-model'
import
StartFlow
from
'./Component/start-flow'
import
StartFlow
from
'./Component/start-flow'
import
MergeToMaster
from
'./Component/merge-to-master'
;
import
'./index.less'
;
import
'./index.less'
;
...
@@ -84,7 +85,11 @@ class Model extends React.Component {
...
@@ -84,7 +85,11 @@ class Model extends React.Component {
startFlowParams
:
{
startFlowParams
:
{
visible
:
false
,
visible
:
false
,
items
:
undefined
,
items
:
undefined
,
}
},
mergeToMasterParams
:
{
visible
:
false
,
items
:
undefined
,
},
}
}
}
}
...
@@ -334,6 +339,17 @@ class Model extends React.Component {
...
@@ -334,6 +339,17 @@ class Model extends React.Component {
this.setState({ historyAndVersionDrawerVisible: true, modelerId: id });
this.setState({ historyAndVersionDrawerVisible: true, modelerId: id });
}
}
onMerge = (item) => {
if (item) {
this.setState({
mergeToMasterParams: {
visible: true,
items: [item]
}
})
}
}
onSearchInputChange = (value) => {
onSearchInputChange = (value) => {
const { currentView } = this.state;
const { currentView } = this.state;
if (currentView === 'branch') {
if (currentView === 'branch') {
...
@@ -793,6 +809,7 @@ class Model extends React.Component {
...
@@ -793,6 +809,7 @@ class Model extends React.Component {
onItemAction={this.onTableItemAction}
onItemAction={this.onTableItemAction}
onAutoCreateTable={this.onAutoCreateTable}
onAutoCreateTable={this.onAutoCreateTable}
onHistory={this.onHistory}
onHistory={this.onHistory}
onMerge={this.onMerge}
{...this.props} />
{...this.props} />
</Spin>
</Spin>
</div>
</div>
...
@@ -890,6 +907,24 @@ class Model extends React.Component {
...
@@ -890,6 +907,24 @@ class Model extends React.Component {
}}
}}
/>
/>
<MergeToMaster
{...this.state.mergeToMasterParams}
branchId={this.state.catalogId}
onCancel={(refresh) => {
this.setState({
mergeToMasterParams: {
visible: false,
items: undefined,
}
})
if (refresh) {
this.onTableChange()
this.setState({ selectModelerIds: [] })
}
}}
/>
<TagSelectPopup
<TagSelectPopup
{...this.state.tagSelectPopupParams}
{...this.state.tagSelectPopupParams}
type='model'
type='model'
...
...
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