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
958b9fae
Commit
958b9fae
authored
Sep 12, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型同步
parent
25aea624
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
94 additions
and
10 deletions
+94
-10
datamodel.js
src/model/datamodel.js
+4
-0
datamodeler.js
src/service/datamodeler.js
+4
-0
constant.js
src/util/constant.js
+1
-0
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+8
-4
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+10
-1
ImportActionIndex.jsx
src/view/Manage/Model/Component/ImportActionIndex.jsx
+1
-1
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+48
-4
merge-to-master.jsx
src/view/Manage/Model/Component/merge-to-master.jsx
+18
-0
No files found.
src/model/datamodel.js
View file @
958b9fae
...
...
@@ -728,6 +728,10 @@ export function* getForkEasyDataModelerDataModelDistributions(payload) {
return
yield
call
(
datamodelerService
.
getForkEasyDataModelerDataModelDistributions
,
payload
)
}
export
function
*
mergeBranch
(
payload
)
{
return
yield
call
(
datamodelerService
.
mergeBranch
,
payload
)
}
export
function
*
getCooperationUsers
(
payload
)
{
return
yield
call
(
datamodelerService
.
getCooperationUsers
,
payload
)
}
...
...
src/service/datamodeler.js
View file @
958b9fae
...
...
@@ -680,6 +680,10 @@ export function getForkEasyDataModelerDataModelDistributions(payload) {
return
GetJSON
(
"/datamodeler/easyDataModelerBranching/getForkEasyDataModelerDataModelDistributions"
,
payload
)
}
export
function
mergeBranch
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerBranching/merge"
,
payload
)
}
/*approval*/
export
function
getApprovalUsers
(
payload
)
{
return
GetJSON
(
"/baseservice/sync/getUserByUserName"
,
payload
)
...
...
src/util/constant.js
View file @
958b9fae
...
...
@@ -8,6 +8,7 @@ export const Action = 'action';
export
const
CatalogId
=
'cid'
;
export
const
BranchId
=
'branchId'
;
export
const
ModelerId
=
'mid'
;
export
const
ModelerMergeId
=
'mergeId'
;
export
const
LogicId
=
'logicId'
;
export
const
Hints
=
'hints'
;
export
const
ModelerData
=
'mdata'
;
...
...
src/view/Manage/Model/Component/EditModel.jsx
View file @
958b9fae
...
...
@@ -10,7 +10,7 @@ import ImportAction from './ImportAction';
import
CatalogModal
from
'./CatalogModal'
;
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
import
{
getQueryParam
,
isSzseEnv
,
showMessage
,
showNotifaction
}
from
'../../../../util'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
VersionId
,
DDL
,
ReadOnly
,
BranchId
,
ApprovalId
,
ApprovalType
,
TaskId
,
LogicId
}
from
'../../../../util/constant'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
VersionId
,
DDL
,
ReadOnly
,
BranchId
,
ApprovalId
,
ApprovalType
,
TaskId
,
LogicId
,
ModelerMergeId
}
from
'../../../../util/constant'
;
import
HistoryAndVersionDrawer
from
'./HistoryAndVersionDrawer'
;
import
{
EditModelContext
}
from
'./ContextManage'
;
import
EditInherited
from
'./EditInherited'
;
...
...
@@ -56,7 +56,7 @@ const EditModel = (props) => {
const
attrIsEditingRef
=
useRef
(
false
);
const
indexIsEditingRef
=
useRef
(
false
);
const
{
action
,
catalogId
,
modelerId
,
hints
,
roughModelerData
,
permitCheckOut
,
editable
,
stateId
,
versionId
,
ddl
,
readOnly
,
branchId
,
approvalId
,
approvalType
,
taskId
,
logicId
}
=
actionData
;
const
{
action
,
catalogId
,
modelerId
,
hints
,
roughModelerData
,
permitCheckOut
,
editable
,
stateId
,
versionId
,
ddl
,
readOnly
,
branchId
,
approvalId
,
approvalType
,
taskId
,
logicId
,
mergeId
}
=
actionData
;
const
[
form
]
=
Form
.
useForm
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
...
...
@@ -79,6 +79,7 @@ const EditModel = (props) => {
const
_approvalType
=
getQueryParam
(
ApprovalType
,
props
.
location
.
search
)
const
_taskId
=
getQueryParam
(
TaskId
,
props
.
location
.
search
)
const
_logicId
=
getQueryParam
(
LogicId
,
props
.
location
.
search
)
const
_mergeId
=
getQueryParam
(
ModelerMergeId
,
props
.
location
.
search
)
if
(
_logicId
)
{
_action
=
'add'
...
...
@@ -96,7 +97,7 @@ const EditModel = (props) => {
judgeAttributeRepeat
(
_roughModelerData
.
easyDataModelerDataModelAttributes
);
}
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
,
roughModelerData
:
_roughModelerData
,
permitCheckOut
:
(
_permitCheckOut
===
'true'
),
editable
:
(
_editable
===
'true'
),
stateId
:
_stateId
,
versionId
:
_versionId
,
ddl
:
_ddl
,
readOnly
:
_readOnly
,
branchId
:
_branchId
,
approvalId
:
_approvalId
,
approvalType
:
_approvalType
,
taskId
:
_taskId
,
logicId
:
_logicId
});
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
,
roughModelerData
:
_roughModelerData
,
permitCheckOut
:
(
_permitCheckOut
===
'true'
),
editable
:
(
_editable
===
'true'
),
stateId
:
_stateId
,
versionId
:
_versionId
,
ddl
:
_ddl
,
readOnly
:
_readOnly
,
branchId
:
_branchId
,
approvalId
:
_approvalId
,
approvalType
:
_approvalType
,
taskId
:
_taskId
,
logicId
:
_logicId
,
mergeId
:
_mergeId
});
actionRef
.
current
=
_action
;
if
(
_approvalId
)
{
...
...
@@ -605,9 +606,11 @@ const EditModel = (props) => {
变更通知
</Checkbox>
}
<Button type='primary' ghost onClick={cancelEdit} >
{
!mergeId && <Button type='primary' ghost onClick={cancelEdit} >
取消
</Button>
}
<PermissionButton
type='primary'
onClick={onHistory}
...
...
@@ -729,6 +732,7 @@ const EditModel = (props) => {
versionId={versionId} branchId={branchId} autoTabKey={autoTabKey}
approvalModelId={currentApprovalModelId} approvalId={approvalId}
logicId={logicId}
mergeId={mergeId}
height={containerHeight}
onChange={onActionChange}
{...props}
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
958b9fae
...
...
@@ -19,7 +19,7 @@ import './ImportAction.less'
export
const
importActionSubject
=
new
Subject
()
const
ImportAction
=
React
.
forwardRef
((
props
,
ref
)
=>
{
const
{
action
,
hints
,
onChange
,
form
,
modelerId
,
terms
,
ddl
,
roughModelerData
,
versionId
,
permitCheckOut
,
catalogId
,
branchId
,
approvalModelId
,
approvalId
,
logicId
,
reference
=
''
,
height
}
=
props
;
const
{
action
,
hints
,
onChange
,
form
,
modelerId
,
terms
,
ddl
,
roughModelerData
,
versionId
,
permitCheckOut
,
catalogId
,
branchId
,
approvalModelId
,
approvalId
,
logicId
,
reference
=
''
,
height
,
mergeId
}
=
props
;
const
[
constraints
,
setConstraints
]
=
useState
([]);
const
[
constraint
,
setConstraint
]
=
useState
({});
...
...
@@ -311,6 +311,14 @@ const ImportAction = React.forwardRef((props, ref) => {
}
}
else
if
(
action
===
'edit'
&&
permitCheckOut
)
{
type
=
'datamodel.checkOutDataModel'
;
}
else
if
(
action
===
'edit'
&&
mergeId
)
{
type
=
'datamodel.mergeBranch'
;
params
=
{
params
:
{
current
:
modelerId
,
merging
:
mergeId
,
}
}
}
else
if
(
action
===
'edit'
)
{
const
_action
=
getQueryParam
(
Action
,
props
.
location
?.
search
);
...
...
@@ -687,6 +695,7 @@ const ImportAction = React.forwardRef((props, ref) => {
action={action}
originAction={getQueryParam(Action, props?.location?.search)}
terms={terms}
mergeId={mergeId}
/>
{
reference !== 'full-search' && <React.Fragment>
...
...
src/view/Manage/Model/Component/ImportActionIndex.jsx
View file @
958b9fae
...
...
@@ -644,7 +644,7 @@ const ImportActionIndex = (props) => {
});
}
else
{
newData
.
splice
(
index
,
1
,
{...{
newData
.
splice
(
index
,
1
,
{...
newData
[
index
],
...
{
name
:
row
.
name
,
unique
:
row
.
unique
,
indextype
:
row
.
indextype
,
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
958b9fae
import
React
,
{
useState
,
useCallback
,
useRef
,
useEffect
,
useContext
,
useMemo
}
from
'react'
;
import
{
Input
,
Form
,
Typography
,
Button
,
Select
,
Row
,
Col
,
Popover
,
Checkbox
,
Tooltip
,
Pagination
,
Space
,
Tag
}
from
'antd'
;
import
{
Input
,
Form
,
Typography
,
Button
,
Select
,
Row
,
Col
,
Popover
,
Checkbox
,
Tooltip
,
Pagination
,
Space
,
Tag
,
Badge
}
from
'antd'
;
import
{
CheckOutlined
,
PlusOutlined
,
QuestionCircleOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
'react-dnd'
;
import
{
HTML5Backend
}
from
'react-dnd-html5-backend'
;
...
...
@@ -224,7 +224,7 @@ export const DragableBodyRow = ({ index, moveRow, className, style, ...restProps
};
export
const
ImportActionTable
=
(
props
)
=>
{
const
{
catalogId
,
modelerData
,
onChange
,
editable
,
supportedDatatypes
,
constraint
,
template
,
validateReports
,
type
=
'model'
,
terms
,
action
,
originAction
}
=
props
;
const
{
catalogId
,
modelerData
,
onChange
,
editable
,
supportedDatatypes
,
constraint
,
template
,
validateReports
,
type
=
'model'
,
terms
,
action
,
originAction
,
mergeId
}
=
props
;
const
[
data
,
setData
]
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
...
...
@@ -470,7 +470,11 @@ export const ImportActionTable = (props) => {
{ standands?.map(item => <div key={item.standardId}><a onClick={() => { window.open(`
/
center
-
home
/
menu
/
datastandard
?
id
=
$
{
item
?.
standardId
}
&
timestamp
=
$
{
timestamp
}
`); }}>{item.standardCnName}</a></div>) }
</div>}
>
<Tag>标</Tag>
<Tag style={{
color: '#196AD2',
borderColor: '#196AD2',
backgroundColor: 'white',
}}>标</Tag>
</Tooltip> }
</React.Fragment>
)
...
...
@@ -478,6 +482,37 @@ export const ImportActionTable = (props) => {
}
];
const mergeStateCol = {
title: '',
dataIndex: 'mergeState',
editable: false,
width: 30,
render: (text, record, __) => {
let title = ''
if (record.delta === 'APPENDED') {
title = '增'
}
if (record.delta === 'DELETED') {
title = '删'
}
if (record.delta === 'MODIFIED') {
title = '改'
}
return (
<>
{ title ? <Tag style={{
color: '#196AD2',
borderColor: '#196AD2',
backgroundColor: 'white',
marginRight: 0,
padding: '0 4px',
}}>{title}</Tag> : <></> }
</>
)
}
}
const attentionCol = {
title: '送审关注',
width: 80,
...
...
@@ -977,8 +1012,17 @@ export const ImportActionTable = (props) => {
};
});
let newColumns = [..._columns]
//只在编辑和评审的时候显示送审关注
setColumns((originAction === 'flow'||action === 'edit')?[..._columns, attentionCol]:_columns);
if (originAction === 'flow'||action === 'edit') {
newColumns = [...newColumns, attentionCol]
}
if (mergeId) {
newColumns = [mergeStateCol, ...newColumns]
}
setColumns(newColumns)
} else {
//只在编辑和评审的时候显示送审关注
setColumns((originAction === 'flow'||action === 'edit')?[...cols, attentionCol]:cols);
...
...
src/view/Manage/Model/Component/merge-to-master.jsx
View file @
958b9fae
...
...
@@ -6,6 +6,7 @@ import { CompareDetail } from './VersionCompare'
import
'./merge-to-master.less'
import
'./VersionCompare.less'
import
{
Action
,
ModelerId
,
ModelerMergeId
}
from
'../../../../util/constant'
const
FC
=
(
props
)
=>
{
const
{
items
,
visible
,
onCancel
}
=
props
...
...
@@ -18,6 +19,7 @@ const FC = (props) => {
const
save
=
()
=>
{
setWaiting
(
true
)
if
((
items
??[]).
length
>
1
)
{
dispatch
({
type
:
'datamodel.joinBranch'
,
payload
:
{
...
...
@@ -30,6 +32,22 @@ const FC = (props) => {
setWaiting
(
false
)
}
})
}
else
{
dispatch
({
type
:
'datamodel.getForkedModel'
,
payload
:
{
id
:
items
[
0
].
id
},
callback
:
data
=>
{
setWaiting
(
false
)
window
.
open
(
`/data-govern/data-model-action?
${
Action
}
=edit&
${
ModelerId
}
=
${
data
?.
id
}
&
$
{
ModelerMergeId
}
=
$
{
items
[
0
].
id
}
`);
},
error: () => {
setWaiting(false)
}
})
}
}
const footer = React.useMemo(() => {
...
...
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