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
73fae5f7
Commit
73fae5f7
authored
May 13, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
f514903e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
82 deletions
+23
-82
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+1
-44
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+22
-38
No files found.
src/view/Manage/Model/Component/EditModel.jsx
View file @
73fae5f7
...
@@ -583,7 +583,7 @@ const EditModel = (props) => {
...
@@ -583,7 +583,7 @@ const EditModel = (props) => {
onClick={onHistory}
onClick={onHistory}
ghost
ghost
permissionKey='历史版本'
permissionKey='历史版本'
defaultPermission={
branchId
?true:undefined}
defaultPermission={
(branchId||approvalId)
?true:undefined}
permissions={privilege?.optionList?.filter(item => item.enabled)?.map(item => item.name)}
permissions={privilege?.optionList?.filter(item => item.enabled)?.map(item => item.name)}
>
>
历史版本
历史版本
...
@@ -620,49 +620,6 @@ const EditModel = (props) => {
...
@@ -620,49 +620,6 @@ const EditModel = (props) => {
getApprovalDetail()
getApprovalDetail()
}}
}}
/>
/>
} else {
actionsBtn = (
<Space>
<PermissionButton
type='primary'
onClick={onHistory}
ghost
permissionKey='历史版本'
permissions={modelerData?.optionList?.filter(item => item.enabled)?.map(item => item.name)}
>
历史版本
</PermissionButton>
{
!isSzseEnv && !modelerData?.inheritedFromEasyDataModelerDataModel && <PermissionButton
type='primary'
onClick={() => {
if (importActionRef.current && importActionRef.current.isLoading()) {
showMessage("warn", '正在加载中,请稍后!');
return;
}
setEditInheritedParms({visible: true, modelerData});
}}
ghost
permissionKey='编辑'
permissions={modelerData?.optionList?.filter(item => item.enabled)?.map(item => item.name)}
>
编辑历史存储形式
</PermissionButton>
}
{
!modelerData?.inheritedFromEasyDataModelerDataModel && editable && <PermissionButton
type='primary'
tooltipPlacement='topRight'
onClick={edit}
permissionKey='编辑'
permissions={modelerData?.optionList?.filter(item => item.enabled)?.map(item => item.name)}
>
编辑
</PermissionButton>
}
</Space>
);
}
}
} else if (action === 'detail-version') {
} else if (action === 'detail-version') {
actionsBtn = (
actionsBtn = (
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
73fae5f7
...
@@ -47,13 +47,9 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -47,13 +47,9 @@ const ImportAction = React.forwardRef((props, ref) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
((
action
||
''
)
===
''
)
return
;
if
((
action
||
''
)
===
''
)
return
;
if
((
!
mountRef
.
current
&&
action
===
'edit'
&&
!
permitCheckOut
)
||
action
===
'edit-inherited'
)
{
if
((
!
mountRef
.
current
&&
action
===
'edit'
&&!
permitCheckOut
)
return
;
||
action
===
'edit-inherited'
}
||
approvalId
)
{
//流程打开模型详情的情况下,id由-1变成-2,会再次触发获取模型详情.这里直接return掉
if
(
approvalId
||
(
!
mountRef
.
current
&&
action
===
'flow'
))
{
return
;
return
;
}
}
...
@@ -110,38 +106,22 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -110,38 +106,22 @@ const ImportAction = React.forwardRef((props, ref) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
approvalModelId
)
{
if
(
approvalModelId
)
{
//把数据表结构中的数据清空,解决性能问题
if
(
action
===
'edit'
)
{
const
newModelerData
=
{
...
modelerData
,
easyDataModelerDataModelAttributes
:
[]
};
form
?.
resetFields
();
}
onChange
&&
onChange
(
newModelerData
);
setModelerData
(
newModelerData
);
if
(
action
===
'detail'
||
action
===
'flow'
)
{
modelerDataRef
.
current
=
newModelerData
;
//把数据表结构中的数据清空,解决性能问题
const
newModelerData
=
{
...
modelerData
,
easyDataModelerDataModelAttributes
:
[]
};
onChange
&&
onChange
(
newModelerData
);
setModelerData
(
newModelerData
);
modelerDataRef
.
current
=
newModelerData
;
}
setLoading
(
true
);
getCurrentDataModel
()
dispatch
({
type
:
'datamodel.getAllConstraints'
,
callback
:
data
=>
{
setConstraints
(
data
);
dispatch
({
type
:
'datamodel.getDataModelWithRecommendedDefinitionAndTermDiscovery'
,
payload
:
{
id
:
approvalModelId
,
},
callback
:
data
=>
{
setLoading
(
false
);
getExtraData
(
data
);
},
error
:
()
=>
{
setLoading
(
false
);
}
})
},
error
:
()
=>
{
setLoading
(
false
);
}
})
}
}
},
[
approvalModelId
])
},
[
approvalModelId
,
action
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
constraint
?.
name
)
{
if
(
constraint
?.
name
)
{
...
@@ -274,7 +254,8 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -274,7 +254,8 @@ const ImportAction = React.forwardRef((props, ref) => {
}
}
const
getCurrentDataModel
=
()
=>
{
const
getCurrentDataModel
=
()
=>
{
if
((
modelerId
||
''
)
===
''
)
{
if
((
action
!==
'flow'
&&!
modelerId
)
||
(
action
===
'flow'
&&!
approvalModelId
))
{
setLoading
(
false
);
setLoading
(
false
);
return
;
return
;
}
}
...
@@ -289,6 +270,9 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -289,6 +270,9 @@ const ImportAction = React.forwardRef((props, ref) => {
type
=
'datamodel.modelCopy'
;
type
=
'datamodel.modelCopy'
;
}
else
if
(
action
===
'flow'
)
{
}
else
if
(
action
===
'flow'
)
{
type
=
'datamodel.getDataModelWithRecommendedDefinitionAndTermDiscovery'
;
type
=
'datamodel.getDataModelWithRecommendedDefinitionAndTermDiscovery'
;
params
=
{
id
:
approvalModelId
,
}
}
else
if
(
action
===
'detail-version'
)
{
}
else
if
(
action
===
'detail-version'
)
{
type
=
'datamodel.getDataModelByVersionId'
;
type
=
'datamodel.getDataModelByVersionId'
;
params
=
{
params
=
{
...
...
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