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
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
108 additions
and
24 deletions
+108
-24
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
+10
-6
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
+30
-12
No files found.
src/model/datamodel.js
View file @
958b9fae
...
@@ -728,6 +728,10 @@ export function* getForkEasyDataModelerDataModelDistributions(payload) {
...
@@ -728,6 +728,10 @@ export function* getForkEasyDataModelerDataModelDistributions(payload) {
return
yield
call
(
datamodelerService
.
getForkEasyDataModelerDataModelDistributions
,
payload
)
return
yield
call
(
datamodelerService
.
getForkEasyDataModelerDataModelDistributions
,
payload
)
}
}
export
function
*
mergeBranch
(
payload
)
{
return
yield
call
(
datamodelerService
.
mergeBranch
,
payload
)
}
export
function
*
getCooperationUsers
(
payload
)
{
export
function
*
getCooperationUsers
(
payload
)
{
return
yield
call
(
datamodelerService
.
getCooperationUsers
,
payload
)
return
yield
call
(
datamodelerService
.
getCooperationUsers
,
payload
)
}
}
...
...
src/service/datamodeler.js
View file @
958b9fae
...
@@ -680,6 +680,10 @@ export function getForkEasyDataModelerDataModelDistributions(payload) {
...
@@ -680,6 +680,10 @@ export function getForkEasyDataModelerDataModelDistributions(payload) {
return
GetJSON
(
"/datamodeler/easyDataModelerBranching/getForkEasyDataModelerDataModelDistributions"
,
payload
)
return
GetJSON
(
"/datamodeler/easyDataModelerBranching/getForkEasyDataModelerDataModelDistributions"
,
payload
)
}
}
export
function
mergeBranch
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerBranching/merge"
,
payload
)
}
/*approval*/
/*approval*/
export
function
getApprovalUsers
(
payload
)
{
export
function
getApprovalUsers
(
payload
)
{
return
GetJSON
(
"/baseservice/sync/getUserByUserName"
,
payload
)
return
GetJSON
(
"/baseservice/sync/getUserByUserName"
,
payload
)
...
...
src/util/constant.js
View file @
958b9fae
...
@@ -8,6 +8,7 @@ export const Action = 'action';
...
@@ -8,6 +8,7 @@ export const Action = 'action';
export
const
CatalogId
=
'cid'
;
export
const
CatalogId
=
'cid'
;
export
const
BranchId
=
'branchId'
;
export
const
BranchId
=
'branchId'
;
export
const
ModelerId
=
'mid'
;
export
const
ModelerId
=
'mid'
;
export
const
ModelerMergeId
=
'mergeId'
;
export
const
LogicId
=
'logicId'
;
export
const
LogicId
=
'logicId'
;
export
const
Hints
=
'hints'
;
export
const
Hints
=
'hints'
;
export
const
ModelerData
=
'mdata'
;
export
const
ModelerData
=
'mdata'
;
...
...
src/view/Manage/Model/Component/EditModel.jsx
View file @
958b9fae
...
@@ -10,7 +10,7 @@ import ImportAction from './ImportAction';
...
@@ -10,7 +10,7 @@ import ImportAction from './ImportAction';
import
CatalogModal
from
'./CatalogModal'
;
import
CatalogModal
from
'./CatalogModal'
;
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
import
{
getQueryParam
,
isSzseEnv
,
showMessage
,
showNotifaction
}
from
'../../../../util'
;
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
HistoryAndVersionDrawer
from
'./HistoryAndVersionDrawer'
;
import
{
EditModelContext
}
from
'./ContextManage'
;
import
{
EditModelContext
}
from
'./ContextManage'
;
import
EditInherited
from
'./EditInherited'
;
import
EditInherited
from
'./EditInherited'
;
...
@@ -56,7 +56,7 @@ const EditModel = (props) => {
...
@@ -56,7 +56,7 @@ const EditModel = (props) => {
const
attrIsEditingRef
=
useRef
(
false
);
const
attrIsEditingRef
=
useRef
(
false
);
const
indexIsEditingRef
=
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
[
form
]
=
Form
.
useForm
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
...
@@ -79,6 +79,7 @@ const EditModel = (props) => {
...
@@ -79,6 +79,7 @@ const EditModel = (props) => {
const
_approvalType
=
getQueryParam
(
ApprovalType
,
props
.
location
.
search
)
const
_approvalType
=
getQueryParam
(
ApprovalType
,
props
.
location
.
search
)
const
_taskId
=
getQueryParam
(
TaskId
,
props
.
location
.
search
)
const
_taskId
=
getQueryParam
(
TaskId
,
props
.
location
.
search
)
const
_logicId
=
getQueryParam
(
LogicId
,
props
.
location
.
search
)
const
_logicId
=
getQueryParam
(
LogicId
,
props
.
location
.
search
)
const
_mergeId
=
getQueryParam
(
ModelerMergeId
,
props
.
location
.
search
)
if
(
_logicId
)
{
if
(
_logicId
)
{
_action
=
'add'
_action
=
'add'
...
@@ -96,7 +97,7 @@ const EditModel = (props) => {
...
@@ -96,7 +97,7 @@ const EditModel = (props) => {
judgeAttributeRepeat
(
_roughModelerData
.
easyDataModelerDataModelAttributes
);
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
;
actionRef
.
current
=
_action
;
if
(
_approvalId
)
{
if
(
_approvalId
)
{
...
@@ -605,9 +606,11 @@ const EditModel = (props) => {
...
@@ -605,9 +606,11 @@ const EditModel = (props) => {
变更通知
变更通知
</Checkbox>
</Checkbox>
}
}
<Button type='primary' ghost onClick={cancelEdit} >
{
取消
!mergeId && <Button type='primary' ghost onClick={cancelEdit} >
</Button>
取消
</Button>
}
<PermissionButton
<PermissionButton
type='primary'
type='primary'
onClick={onHistory}
onClick={onHistory}
...
@@ -729,6 +732,7 @@ const EditModel = (props) => {
...
@@ -729,6 +732,7 @@ const EditModel = (props) => {
versionId={versionId} branchId={branchId} autoTabKey={autoTabKey}
versionId={versionId} branchId={branchId} autoTabKey={autoTabKey}
approvalModelId={currentApprovalModelId} approvalId={approvalId}
approvalModelId={currentApprovalModelId} approvalId={approvalId}
logicId={logicId}
logicId={logicId}
mergeId={mergeId}
height={containerHeight}
height={containerHeight}
onChange={onActionChange}
onChange={onActionChange}
{...props}
{...props}
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
958b9fae
...
@@ -19,7 +19,7 @@ import './ImportAction.less'
...
@@ -19,7 +19,7 @@ import './ImportAction.less'
export
const
importActionSubject
=
new
Subject
()
export
const
importActionSubject
=
new
Subject
()
const
ImportAction
=
React
.
forwardRef
((
props
,
ref
)
=>
{
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
[
constraints
,
setConstraints
]
=
useState
([]);
const
[
constraint
,
setConstraint
]
=
useState
({});
const
[
constraint
,
setConstraint
]
=
useState
({});
...
@@ -311,6 +311,14 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -311,6 +311,14 @@ const ImportAction = React.forwardRef((props, ref) => {
}
}
}
else
if
(
action
===
'edit'
&&
permitCheckOut
)
{
}
else
if
(
action
===
'edit'
&&
permitCheckOut
)
{
type
=
'datamodel.checkOutDataModel'
;
type
=
'datamodel.checkOutDataModel'
;
}
else
if
(
action
===
'edit'
&&
mergeId
)
{
type
=
'datamodel.mergeBranch'
;
params
=
{
params
:
{
current
:
modelerId
,
merging
:
mergeId
,
}
}
}
else
if
(
action
===
'edit'
)
{
}
else
if
(
action
===
'edit'
)
{
const
_action
=
getQueryParam
(
Action
,
props
.
location
?.
search
);
const
_action
=
getQueryParam
(
Action
,
props
.
location
?.
search
);
...
@@ -687,6 +695,7 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -687,6 +695,7 @@ const ImportAction = React.forwardRef((props, ref) => {
action={action}
action={action}
originAction={getQueryParam(Action, props?.location?.search)}
originAction={getQueryParam(Action, props?.location?.search)}
terms={terms}
terms={terms}
mergeId={mergeId}
/>
/>
{
{
reference !== 'full-search' && <React.Fragment>
reference !== 'full-search' && <React.Fragment>
...
...
src/view/Manage/Model/Component/ImportActionIndex.jsx
View file @
958b9fae
...
@@ -644,7 +644,7 @@ const ImportActionIndex = (props) => {
...
@@ -644,7 +644,7 @@ const ImportActionIndex = (props) => {
});
});
}
else
{
}
else
{
newData
.
splice
(
index
,
1
,
{...{
newData
.
splice
(
index
,
1
,
{...
newData
[
index
],
...
{
name
:
row
.
name
,
name
:
row
.
name
,
unique
:
row
.
unique
,
unique
:
row
.
unique
,
indextype
:
row
.
indextype
,
indextype
:
row
.
indextype
,
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
958b9fae
import
React
,
{
useState
,
useCallback
,
useRef
,
useEffect
,
useContext
,
useMemo
}
from
'react'
;
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
{
CheckOutlined
,
PlusOutlined
,
QuestionCircleOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
'react-dnd'
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
'react-dnd'
;
import
{
HTML5Backend
}
from
'react-dnd-html5-backend'
;
import
{
HTML5Backend
}
from
'react-dnd-html5-backend'
;
...
@@ -224,7 +224,7 @@ export const DragableBodyRow = ({ index, moveRow, className, style, ...restProps
...
@@ -224,7 +224,7 @@ export const DragableBodyRow = ({ index, moveRow, className, style, ...restProps
};
};
export
const
ImportActionTable
=
(
props
)
=>
{
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
[
data
,
setData
]
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
...
@@ -470,7 +470,11 @@ export const ImportActionTable = (props) => {
...
@@ -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>) }
{ 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>}
</div>}
>
>
<Tag>标</Tag>
<Tag style={{
color: '#196AD2',
borderColor: '#196AD2',
backgroundColor: 'white',
}}>标</Tag>
</Tooltip> }
</Tooltip> }
</React.Fragment>
</React.Fragment>
)
)
...
@@ -478,6 +482,37 @@ export const ImportActionTable = (props) => {
...
@@ -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 = {
const attentionCol = {
title: '送审关注',
title: '送审关注',
width: 80,
width: 80,
...
@@ -977,8 +1012,17 @@ export const ImportActionTable = (props) => {
...
@@ -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 {
} else {
//只在编辑和评审的时候显示送审关注
//只在编辑和评审的时候显示送审关注
setColumns((originAction === 'flow'||action === 'edit')?[...cols, attentionCol]:cols);
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'
...
@@ -6,6 +6,7 @@ import { CompareDetail } from './VersionCompare'
import
'./merge-to-master.less'
import
'./merge-to-master.less'
import
'./VersionCompare.less'
import
'./VersionCompare.less'
import
{
Action
,
ModelerId
,
ModelerMergeId
}
from
'../../../../util/constant'
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
const
{
items
,
visible
,
onCancel
}
=
props
const
{
items
,
visible
,
onCancel
}
=
props
...
@@ -18,18 +19,35 @@ const FC = (props) => {
...
@@ -18,18 +19,35 @@ const FC = (props) => {
const
save
=
()
=>
{
const
save
=
()
=>
{
setWaiting
(
true
)
setWaiting
(
true
)
dispatch
({
if
((
items
??[]).
length
>
1
)
{
type
:
'datamodel.joinBranch'
,
dispatch
({
payload
:
{
type
:
'datamodel.joinBranch'
,
ids
:
(
items
??[]).
map
(
item
=>
item
.
id
).
toString
(),
payload
:
{
},
ids
:
(
items
??[]).
map
(
item
=>
item
.
id
).
toString
(),
callback
:
data
=>
{
},
close
(
true
)
callback
:
data
=>
{
},
close
(
true
)
error
:
()
=>
{
},
setWaiting
(
false
)
error
:
()
=>
{
}
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(() => {
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