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
56c32def
Commit
56c32def
authored
Jun 13, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分支模型
parent
733aa1b3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
121 additions
and
0 deletions
+121
-0
datamodel.js
src/model/datamodel.js
+4
-0
datamodeler.js
src/service/datamodeler.js
+4
-0
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+26
-0
model-fork-detail.jsx
src/view/Manage/Model/Component/model-fork-detail.jsx
+87
-0
No files found.
src/model/datamodel.js
View file @
56c32def
...
...
@@ -716,6 +716,10 @@ export function* getForkedModel(payload) {
return
yield
call
(
datamodelerService
.
getForkedModel
,
payload
)
}
export
function
*
getForkEasyDataModelerDataModelDistributions
(
payload
)
{
return
yield
call
(
datamodelerService
.
getForkEasyDataModelerDataModelDistributions
,
payload
)
}
export
function
*
getCooperationUsers
()
{
return
yield
call
(
datamodelerService
.
getCooperationUsers
)
}
...
...
src/service/datamodeler.js
View file @
56c32def
...
...
@@ -668,6 +668,10 @@ export function getForkedModel(payload) {
return
GetJSON
(
"/datamodeler/easyDataModelerBranching/getForkedEasyDataModelerDataModel"
,
payload
)
}
export
function
getForkEasyDataModelerDataModelDistributions
(
payload
)
{
return
GetJSON
(
"/datamodeler/easyDataModelerBranching/getForkEasyDataModelerDataModelDistributions"
,
payload
)
}
/*approval*/
export
function
getApprovalUsers
(
payload
)
{
return
GetJSON
(
"/baseservice/sync/getUserByUserName"
,
payload
)
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
56c32def
...
...
@@ -14,6 +14,7 @@ import TagCell from './tag-help';
import
BranchModelSync
from
'./branch-model-sync'
;
import
ModelCompareSelectModel
from
'./model-compare-select-model'
;
import
MetadataCompare
from
'./metadata-compare'
;
import
ModelForkDetail
from
'./model-fork-detail'
;
import
'./ModelTable.less'
;
import
'react-contexify/dist/ReactContexify.css'
;
...
...
@@ -167,6 +168,10 @@ const ModelTable = (props) => {
visible: false,
item: undefined,
})
const [modelForkDetailParams, setModelForkDetailParams] = useState({
visible: false,
item: undefined,
})
const expandedDataMapRef = useRef(new Map());
const shouldScrollRef = useRef(false);
...
...
@@ -687,6 +692,11 @@ const ModelTable = (props) => {
visible: true,
item: currentItem,
})
} else if (key === 'fork-model') {
setModelForkDetailParams({
visible: true,
item: currentItem,
})
}
}
...
...
@@ -794,6 +804,13 @@ const ModelTable = (props) => {
>
元数据对比
</PermissionRcItem>
<PermissionRcItem
id='fork-model'
defaultPermission={true}
onClick={handleItemClick}
>
分支模型
</PermissionRcItem>
{
view !== 'branch' && <PermissionRcItem
id='auth-transfer'
...
...
@@ -890,6 +907,15 @@ const ModelTable = (props) => {
})
}}
/>
<ModelForkDetail
{...modelForkDetailParams}
onCancel={() => {
setModelForkDetailParams({
visible: false,
item: undefined,
})
}}
/>
{ contextHolder }
</div>
);
...
...
src/view/Manage/Model/Component/model-fork-detail.jsx
0 → 100644
View file @
56c32def
import
React
from
'react'
import
{
Modal
}
from
'antd'
import
{
dispatch
}
from
'../../../../model'
import
Table
from
'../../../../util/Component/Table'
const
FC
=
({
visible
,
item
,
onCancel
})
=>
{
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
data
,
setData
]
=
React
.
useState
()
const
[
animating
,
setAnimating
]
=
React
.
useState
(
true
)
React
.
useEffect
(()
=>
{
if
(
visible
)
{
setTimeout
(()
=>
{
setAnimating
(
false
)
},
300
)
getList
()
}
},
[
visible
,
item
])
const
cols
=
[
{
title
:
'序号'
,
dataIndex
:
'index'
,
width
:
60
,
render
:
(
_
,
__
,
index
)
=>
(
index
+
1
)
},
{
title
:
'项目名称'
,
dataIndex
:
'branchName'
,
render
:
(
_
,
record
,
index
)
=>
record
.
branch
?.
name
},
{
title
:
'模型名称'
,
dataIndex
:
'name'
,
},
]
const
getList
=
()
=>
{
setLoading
(
true
)
dispatch
({
type
:
'datamodel.getForkEasyDataModelerDataModelDistributions'
,
payload
:
{
id
:
item
?.
id
},
callback
:
data
=>
{
setLoading
(
false
)
setData
(
data
)
},
error
:
()
=>
{
setLoading
(
false
)
}
})
}
const
close
=
()
=>
{
setAnimating
(
true
)
setLoading
(
false
)
onCancel
?.()
}
return
(
<
Modal
visible=
{
visible
}
footer=
{
null
}
width=
'50%'
bodyStyle=
{
{
padding
:
'15px 15px 0'
,
overflowX
:
'auto'
,
height
:
'50vh'
}
}
title=
{
`${item?.name}的分支模型详情`
}
centered
destroyOnClose
onCancel=
{
()
=>
{
close
()
}
}
>
{
!
animating
&&
<
Table
loading=
{
loading
}
columns=
{
cols
??[]
}
dataSource=
{
data
??[]
}
pagination=
{
false
}
/>
}
</
Modal
>
)
}
export
default
FC
\ 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