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
a482be21
Commit
a482be21
authored
Sep 18, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型通知详情
parent
9bc02df0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
148 additions
and
53 deletions
+148
-53
datamodel.js
src/model/datamodel.js
+4
-0
datamodeler.js
src/service/datamodeler.js
+4
-0
constant.js
src/util/constant.js
+1
-0
index.js
src/util/index.js
+3
-2
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+22
-5
branch-model-sync.jsx
src/view/Manage/Model/Component/branch-model-sync.jsx
+7
-3
index.jsx
src/view/Manage/ModelCompareList/index.jsx
+107
-43
No files found.
src/model/datamodel.js
View file @
a482be21
...
...
@@ -808,6 +808,10 @@ export function* getModelBranchNotice(payload) {
return
yield
call
(
datamodelerService
.
getModelBranchNotice
,
payload
)
}
export
function
*
processConflictDataModel
(
payload
)
{
return
yield
call
(
datamodelerService
.
processConflictDataModel
,
payload
)
}
export
function
*
getMetadataTable
(
payload
)
{
return
yield
call
(
datamodelerService
.
getMetadataTable
,
payload
)
}
...
...
src/service/datamodeler.js
View file @
a482be21
...
...
@@ -764,6 +764,10 @@ export function getModelBranchNotice(payload) {
return
GetJSON
(
"/datamodeler/easyDataModelerNotice/getModelBranchNotice"
,
payload
)
}
export
function
processConflictDataModel
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerNotice/processConflictDataModel"
,
payload
)
}
export
function
getMetadataTable
(
payload
)
{
return
PostJSON
(
"/baseservice/dataSecurityGrade/getTablePage"
,
payload
)
}
...
...
src/util/constant.js
View file @
a482be21
...
...
@@ -22,6 +22,7 @@ export const ReadOnly = 'readOnly';
export
const
ApprovalId
=
'approvalId'
;
export
const
ApprovalType
=
'approvalType'
;
export
const
TaskId
=
'taskId'
;
export
const
IsConflict
=
'isConflict'
;
export
const
DataModelerRoleAdmin
=
'admin'
;
export
const
DataModelerRoleUser
=
'user'
;
...
...
src/util/index.js
View file @
a482be21
...
...
@@ -8,7 +8,7 @@ import LocalStorage from 'local-storage';
import
{
dispatchLatest
,
action
}
from
'../model'
;
import
{
set_sess_state
}
from
"../model/reducer"
;
import
{
DataModelerRoleAdmin
,
DataModelerRoleUser
,
DataModelerRoleReader
,
AssetManageReference
,
AssetBrowseReference
,
ResourceBrowseReference
,
AssetRecycleReference
,
ResourceManageReference
}
from
'./constant'
;
import
{
DataModelerRoleAdmin
,
DataModelerRoleUser
,
DataModelerRoleReader
,
AssetManageReference
,
AssetBrowseReference
,
ResourceBrowseReference
,
AssetRecycleReference
,
ResourceManageReference
,
ModelerId
,
Action
}
from
'./constant'
;
//内网深交所环境 isSzseEnv true
//元曜公网环境 isSzseEnv false
...
...
@@ -569,5 +569,5 @@ export function openMetadataDetail(id) {
}
export
function
openModelDetail
(
id
)
{
window
.
open
(
`/data-govern/data-model-action?
action=detail&mid
=
${
id
}
`
);
window
.
open
(
`/data-govern/data-model-action?
${
Action
}
=detail&
${
ModelerId
}
=
${
id
}
`
);
}
\ No newline at end of file
src/view/Manage/Model/Component/EditModel.jsx
View file @
a482be21
...
...
@@ -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
,
ModelerMergeId
}
from
'../../../../util/constant'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
VersionId
,
DDL
,
ReadOnly
,
BranchId
,
ApprovalId
,
ApprovalType
,
TaskId
,
LogicId
,
ModelerMergeId
,
IsConflict
}
from
'../../../../util/constant'
;
import
HistoryAndVersionDrawer
from
'./HistoryAndVersionDrawer'
;
import
{
EditModelContext
}
from
'./ContextManage'
;
import
EditInherited
from
'./EditInherited'
;
...
...
@@ -25,7 +25,7 @@ import './EditModel.less';
const
EditModel
=
(
props
)
=>
{
const
[
actionData
,
setActionData
]
=
useState
({
action
:
''
,
catalogId
:
''
,
modelerId
:
''
,
hints
:
[],
roughModelerData
:
null
,
permitCheckOut
:
false
,
editable
:
false
,
stateId
:
''
,
versionId
:
''
,
ddl
:
''
,
readOnly
:
false
,
branchId
:
''
,
approvalId
:
''
,
approvalType
:
''
,
taskId
:
''
,
logicId
:
''
});
const
[
actionData
,
setActionData
]
=
useState
({
action
:
''
,
catalogId
:
''
,
modelerId
:
''
,
hints
:
[],
roughModelerData
:
null
,
permitCheckOut
:
false
,
editable
:
false
,
stateId
:
''
,
versionId
:
''
,
ddl
:
''
,
readOnly
:
false
,
branchId
:
''
,
approvalId
:
''
,
approvalType
:
''
,
taskId
:
''
,
logicId
:
''
,
mergeId
:
''
,
isConflict
:
false
});
const
[
modelerData
,
setModelerData
]
=
useState
({});
const
[
terms
,
setTerms
]
=
useState
([]);
...
...
@@ -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
,
mergeId
}
=
actionData
;
const
{
action
,
catalogId
,
modelerId
,
hints
,
roughModelerData
,
permitCheckOut
,
editable
,
stateId
,
versionId
,
ddl
,
readOnly
,
branchId
,
approvalId
,
approvalType
,
taskId
,
logicId
,
mergeId
,
isConflict
}
=
actionData
;
const
[
form
]
=
Form
.
useForm
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
...
...
@@ -80,6 +80,7 @@ const EditModel = (props) => {
const
_taskId
=
getQueryParam
(
TaskId
,
props
.
location
.
search
)
const
_logicId
=
getQueryParam
(
LogicId
,
props
.
location
.
search
)
const
_mergeId
=
getQueryParam
(
ModelerMergeId
,
props
.
location
.
search
)
const
_isConflict
=
getQueryParam
(
IsConflict
,
props
.
location
.
search
)
if
(
_logicId
)
{
_action
=
'add'
...
...
@@ -97,7 +98,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
,
mergeId
:
_mergeId
});
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
,
isConflict
:
(
_isConflict
===
'true'
)
});
actionRef
.
current
=
_action
;
if
(
_approvalId
)
{
...
...
@@ -279,9 +280,13 @@ const EditModel = (props) => {
showMessage
(
"success"
,
'保存模型成功'
);
if
(
isConflict
)
{
processConflictDataModel
()
}
const
_action
=
getQueryParam
(
Action
,
props
.
location
.
search
);
setActionData
({
...
actionData
,
...{
action
:
(
_action
===
'flow'
)?
'flow'
:
'detail'
,
modelerId
:
data
.
id
||
''
,
stateId
:
data
?.
state
?.
id
||
''
,
permitCheckOut
:
data
?.
permitCheckOut
||
false
,
editable
:
data
?.
editable
||
false
}
});
setActionData
({
...
actionData
,
...{
action
:
(
_action
===
'flow'
)?
'flow'
:
'detail'
,
modelerId
:
data
.
id
||
''
,
stateId
:
data
?.
state
?.
id
||
''
,
permitCheckOut
:
data
?.
permitCheckOut
||
false
,
editable
:
data
?.
editable
||
false
,
isConflict
:
false
}
});
actionRef
.
current
=
(
_action
===
'flow'
)?
'flow'
:
'detail'
;
LocalStorage
.
set
(
'modelId'
,
data
.
id
||
''
);
...
...
@@ -317,6 +322,18 @@ const EditModel = (props) => {
})
}
const
processConflictDataModel
=
()
=>
{
dispatch
({
type
:
'datamodel.processConflictDataModel'
,
payload
:
{
params
:
{
conflictItemId
:
modelerId
}
},
callback
:
()
=>
{}
})
}
const
edit
=
()
=>
{
setActionData
({
...
actionData
,
action
:
'edit'
,
permitCheckOut
:
modelerData
?.
permitCheckOut
});
actionRef
.
current
=
'edit'
;
...
...
src/view/Manage/Model/Component/branch-model-sync.jsx
View file @
a482be21
...
...
@@ -6,10 +6,10 @@ import { CompareDetail } from './VersionCompare'
import
'./VersionCompare.less'
import
{
formatDate
}
from
'../../../../util'
import
{
Action
,
ModelerId
,
ModelerMergeId
}
from
'../../../../util/constant'
import
{
Action
,
IsConflict
,
ModelerId
,
ModelerMergeId
}
from
'../../../../util/constant'
const
FC
=
(
props
)
=>
{
const
{
item
,
visible
,
title
=
'基线模型变更提醒'
,
readonly
=
false
,
onCancel
}
=
props
const
{
type
=
''
,
item
,
visible
,
title
=
'基线模型变更提醒'
,
readonly
=
false
,
onCancel
}
=
props
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
close
=
(
val
)
=>
{
...
...
@@ -26,7 +26,11 @@ const FC = (props) => {
},
callback
:
data
=>
{
setWaiting
(
false
)
window
.
open
(
`/data-govern/data-model-action?
${
Action
}
=edit&
${
ModelerId
}
=
${
item
?.
id
}
&
$
{
ModelerMergeId
}
=
$
{
data
?.
id
}
`);
if
(
type
===
'notice'
)
{
window
.
open
(
`/data-govern/data-model-action?
${
Action
}
=edit&
${
ModelerId
}
=
${
item
?.
id
}
&
$
{
ModelerMergeId
}
=
$
{
data
?.
id
}
&
$
{
IsConflict
}
=
true
`);
} else {
window.open(`
/
data
-
govern
/
data
-
model
-
action
?
$
{
Action
}
=
edit
&
$
{
ModelerId
}
=
$
{
item
?.
id
}
&
$
{
ModelerMergeId
}
=
$
{
data
?.
id
}
`);
}
},
error: () => {
setWaiting(false)
...
...
src/view/Manage/ModelCompareList/index.jsx
View file @
a482be21
...
...
@@ -5,19 +5,21 @@ import { getQueryParam, isSzseEnv, openModelDetail } from "../../../util"
import
Table
from
'../../../util/Component/Table'
import
{
ModelNameColumn
}
from
'../Model/Component/ModelTable'
import
{
dispatch
}
from
'../../../model'
import
ModelForkDetail
from
'../Model/Component/model-fork-detail
'
import
BranchModelSync
from
'../Model/Component/branch-model-sync
'
//181d90ce2dcd4a16b47dff3663b56e36
//5658433f08734d4db0f49a0c5e6cd734
const
FC
=
(
props
)
=>
{
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
data
,
setData
]
=
React
.
useState
()
const
[
modelForkDetailParams
,
setModelForkDetail
Params
]
=
React
.
useState
({
const
[
branchModelSyncParams
,
setBranchModelSync
Params
]
=
React
.
useState
({
visible
:
false
,
item
:
undefined
,
})
const
id
=
getQueryParam
(
'id'
,
props
.
location
?.
search
)
const
c
ols
=
[
const
joinC
ols
=
[
{
title
:
'序号'
,
dataIndex
:
'index'
,
...
...
@@ -26,39 +28,108 @@ const FC = (props) => {
},
{
title
:
'模型名称'
,
dataIndex
:
'
n
ame'
,
dataIndex
:
'
masterDataModelN
ame'
,
render
:(
text
,
record
,
index
)
=>
<
ModelNameColumn
text=
{
text
}
record=
{
record
}
detailItem=
{
()
=>
{
openModelDetail
(
record
.
easyDataModelerDataModelId
)
}
}
/>
},
{
title
:
'中文名称'
,
dataIndex
:
'
c
nName'
,
dataIndex
:
'
masterDataModelC
nName'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
>
{
text
}
</
Typography
.
Text
>
</
Tooltip
>
},
{
title
:
'路径'
,
dataIndex
:
'
p
ath'
,
dataIndex
:
'
masterDataModelP
ath'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
>
{
text
}
</
Typography
.
Text
>
</
Tooltip
>
},
// {
// title: '创建人',
// dataIndex: 'editor',
// width: 100,
// },
// {
// title: '版本号',
// dataIndex: 'modifiedTs',
// width: 170,
// render:(text, record, index)=> record.modifiedTs ? new Date(record.modifiedTs).toLocaleString() : ''
// },
{
title
:
'模型描述'
,
dataIndex
:
'remark'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
overlayClassName=
'tooltip-common'
>
<
Typography
.
Text
ellipsis=
{
true
}
>
{
text
}
</
Typography
.
Text
>
title
:
'冲突的分支'
,
dataIndex
:
'conflictDataModelName'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
>
{
`${record.conflictBranch?.name}/${text}`
}
</
Typography
.
Text
>
</
Tooltip
>
},
{
title
:
'分支状态'
,
dataIndex
:
'branchState'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
>
{
record
.
conflictModelShowState
?.
name
}
</
Typography
.
Text
>
</
Tooltip
>
},
{
title
:
'处理记录'
,
dataIndex
:
'processed'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
>
{
record
.
processed
?
'已处理'
:
'未处理'
}
</
Typography
.
Text
>
</
Tooltip
>
},
{
title
:
'操作'
,
key
:
'action'
,
width
:
120
,
render
:
(
_
,
record
)
=>
{
return
(
<
a
onClick=
{
()
=>
{
setBranchModelSyncParams
({
visible
:
true
,
item
:
{
id
:
record
.
conflictEasyDataModelerDataModelId
}
})
}
}
>
冲突详情
</
a
>
)
}
}
]
const
reviewCols
=
[
{
title
:
'序号'
,
dataIndex
:
'index'
,
width
:
60
,
render
:(
_
,
__
,
index
)
=>
(
index
+
1
)
},
{
title
:
'模型名称'
,
dataIndex
:
'masterDataModelName'
,
render
:(
text
,
record
,
index
)
=>
<
ModelNameColumn
text=
{
text
}
record=
{
record
}
detailItem=
{
()
=>
{
openModelDetail
(
record
.
easyDataModelerDataModelId
)
}
}
/>
},
{
title
:
'中文名称'
,
dataIndex
:
'masterDataModelCnName'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
>
{
text
}
</
Typography
.
Text
>
</
Tooltip
>
},
{
title
:
'路径'
,
dataIndex
:
'masterDataModelPath'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
>
{
text
}
</
Typography
.
Text
>
</
Tooltip
>
},
{
title
:
'提交评审的分支'
,
dataIndex
:
'operationDataModelName'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
>
{
`${record.operationBranch?.name}/${text}`
}
</
Typography
.
Text
>
</
Tooltip
>
},
{
title
:
'项目负责人'
,
dataIndex
:
'members'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
>
{
record
.
operationBranch
?.
easyDataModelerMemberShip
?.
easyDataModelerMembers
.
map
(
item
=>
item
.
dname
).
toString
()
}
</
Typography
.
Text
>
</
Tooltip
>
},
{
title
:
'冲突的分支'
,
dataIndex
:
'conflictDataModelName'
,
render
:(
text
,
record
,
index
)
=>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
>
{
`${record.conflictBranch?.name}/${text}`
}
</
Typography
.
Text
>
</
Tooltip
>
},
]
...
...
@@ -67,9 +138,13 @@ const FC = (props) => {
getDetail
()
},
[])
const
menuData
=
React
.
useMemo
(()
=>
{
return
[
'分支模型'
]
},
[])
const
cols
=
React
.
useMemo
(()
=>
{
if
(
data
)
{
return
data
?.
sceneType
?.
type
===
'modelJoinInMaster'
?
joinCols
:
reviewCols
}
return
[]
},
[
data
])
const
getDetail
=
()
=>
{
setLoading
(
true
)
...
...
@@ -88,35 +163,24 @@ const FC = (props) => {
})
}
const
onRightMenuItemClick
=
(
key
,
record
)
=>
{
if
(
key
===
'分支模型'
)
{
setModelForkDetailParams
({
visible
:
true
,
item
:
{...
record
,
id
:
record
.
easyDataModelerDataModelId
},
})
}
}
return
(
<
Spin
spinning=
{
loading
}
>
<
div
className=
'p-5'
style=
{
{
height
:
'100%'
}
}
>
<
div
className=
'flex mb-3'
style=
{
{
justifyContent
:
'center'
}
}
>
<
h
3
>
{
data
?.
sceneTypeName
}
</
h3
>
<
div
className=
'flex mb-3'
>
<
h
4
>
{
data
?.
sceneType
?.
name
}
</
h4
>
</
div
>
<
Table
columns=
{
cols
??[]
}
dataSource=
{
data
?.
m
odelInfoList
??[]
}
dataSource=
{
data
?.
conflictM
odelInfoList
??[]
}
pagination=
{
false
}
shouldRowContextMenu=
{
()
=>
true
}
menuData=
{
menuData
}
menuPermissions=
{
menuData
}
onMenuItemClick=
{
onRightMenuItemClick
}
/>
</
div
>
<
ModelForkDetail
{
...
modelForkDetailParams
}
<
BranchModelSync
type=
'notice'
title=
'冲突详情'
{
...
branchModelSyncParams
}
onCancel=
{
()
=>
{
set
ModelForkDetail
Params
({
set
BranchModelSync
Params
({
visible
:
false
,
item
:
undefined
,
})
...
...
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