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
cabbef77
Commit
cabbef77
authored
Mar 13, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型流程
parent
0def22f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
9 deletions
+62
-9
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+24
-6
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+38
-3
No files found.
src/view/Manage/Model/Component/EditModel.jsx
View file @
cabbef77
...
@@ -30,6 +30,7 @@ const EditModel = (props) => {
...
@@ -30,6 +30,7 @@ const EditModel = (props) => {
const
[
editInheritedParam
,
setEditInheritedParms
]
=
useState
({
visible
:
false
,
modelerData
:
undefined
});
const
[
editInheritedParam
,
setEditInheritedParms
]
=
useState
({
visible
:
false
,
modelerData
:
undefined
});
const
[
loadingApprovalData
,
setLoadingApprovalData
]
=
useState
(
false
)
const
[
loadingApprovalData
,
setLoadingApprovalData
]
=
useState
(
false
)
const
[
approvalData
,
setApprovalData
]
=
useState
()
const
[
approvalData
,
setApprovalData
]
=
useState
()
const
[
currentApprovalModelId
,
setApprovalModelId
]
=
useState
()
const
actionRef
=
useRef
(
''
);
const
actionRef
=
useRef
(
''
);
const
attrIsEditingRef
=
useRef
(
false
);
const
attrIsEditingRef
=
useRef
(
false
);
...
@@ -72,6 +73,7 @@ const EditModel = (props) => {
...
@@ -72,6 +73,7 @@ const EditModel = (props) => {
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
,
roughModelerData
:
_roughModelerData
,
permitCheckOut
:
(
_permitCheckOut
===
'true'
),
editable
:
(
_editable
===
'true'
),
stateId
:
_stateId
,
versionId
:
_versionId
,
holder
:
_holder
,
ddl
:
_ddl
,
readOnly
:
_readOnly
,
branchId
:
_branchId
,
approvalId
:
_approvalId
,
approvalType
:
_approvalType
});
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
,
roughModelerData
:
_roughModelerData
,
permitCheckOut
:
(
_permitCheckOut
===
'true'
),
editable
:
(
_editable
===
'true'
),
stateId
:
_stateId
,
versionId
:
_versionId
,
holder
:
_holder
,
ddl
:
_ddl
,
readOnly
:
_readOnly
,
branchId
:
_branchId
,
approvalId
:
_approvalId
,
approvalType
:
_approvalType
});
actionRef
.
current
=
_action
;
actionRef
.
current
=
_action
;
setApprovalModelId
(
_modelerId
);
const
interval
=
setInterval
(()
=>
{
const
interval
=
setInterval
(()
=>
{
heartbeat
();
heartbeat
();
...
@@ -446,10 +448,10 @@ const EditModel = (props) => {
...
@@ -446,10 +448,10 @@ const EditModel = (props) => {
actionsBtn
=
<
PhysicalModelApprovalBottom
actionsBtn
=
<
PhysicalModelApprovalBottom
loading=
{
loadingApprovalData
}
loading=
{
loadingApprovalData
}
data=
{
approvalData
}
data=
{
approvalData
}
id=
{
modeler
Id
}
id=
{
currentApprovalModel
Id
}
type=
{
approvalType
}
type=
{
approvalType
}
onChange=
{
(
val
)
=>
{
onChange=
{
(
val
)
=>
{
setA
ctionData
({
...
actionData
,
modelerId
:
val
}
)
setA
pprovalModelId
(
val
)
}
}
}
}
/>
/>
}
else
{
}
else
{
...
@@ -519,7 +521,7 @@ const EditModel = (props) => {
...
@@ -519,7 +521,7 @@ const EditModel = (props) => {
</
div
>
</
div
>
<
div
className=
'edit-container'
>
<
div
className=
'edit-container'
>
<
div
className=
'edit-container-card'
>
<
div
className=
'edit-container-card'
>
<
ImportAction
ref=
{
importActionRef
}
hints=
{
hints
}
onChange=
{
onActionChange
}
action=
{
action
}
modelerId=
{
modelerId
}
catalogId=
{
catalogId
}
ddl=
{
ddl
}
form=
{
form
}
terms=
{
terms
}
roughModelerData=
{
roughModelerData
}
permitCheckOut=
{
permitCheckOut
}
stateId=
{
stateId
}
versionId=
{
versionId
}
branchId=
{
branchId
}
autoTabKey=
{
autoTabKey
}
{
...
props
}
/>
<
ImportAction
ref=
{
importActionRef
}
hints=
{
hints
}
onChange=
{
onActionChange
}
action=
{
action
}
modelerId=
{
modelerId
}
catalogId=
{
catalogId
}
ddl=
{
ddl
}
form=
{
form
}
terms=
{
terms
}
roughModelerData=
{
roughModelerData
}
permitCheckOut=
{
permitCheckOut
}
stateId=
{
stateId
}
versionId=
{
versionId
}
branchId=
{
branchId
}
autoTabKey=
{
autoTabKey
}
approvalModelId=
{
currentApprovalModelId
}
approvalId=
{
approvalId
}
{
...
props
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
'edit-footer'
>
<
div
className=
'edit-footer'
>
...
@@ -599,10 +601,18 @@ const PhysicalModelApprovalBottom = ({ loading, type, data, id, onChange, onOk }
...
@@ -599,10 +601,18 @@ const PhysicalModelApprovalBottom = ({ loading, type, data, id, onChange, onOk }
placeholder=
'选择评审结论'
placeholder=
'选择评审结论'
allowClear
allowClear
style=
{
{
style=
{
{
width
:
'100%'
width
:
150
,
}
}
}
}
onChange=
{
(
val
)
=>
{
onChange=
{
(
val
)
=>
{
setItem
(
prev
=>
{
return
Object
.
assign
({},
prev
,
(
type
===
'design'
)
?
{
designReviewPass
:
val
}:
{
standardReviewPass
:
val
}
)
})
}
}
}
}
>
>
<
Select
.
Option
value=
{
true
}
>
通过
</
Select
.
Option
>
<
Select
.
Option
value=
{
true
}
>
通过
</
Select
.
Option
>
...
@@ -614,7 +624,15 @@ const PhysicalModelApprovalBottom = ({ loading, type, data, id, onChange, onOk }
...
@@ -614,7 +624,15 @@ const PhysicalModelApprovalBottom = ({ loading, type, data, id, onChange, onOk }
autoSize=
{
{
minRows
:
1
,
maxRows
:
3
}
}
autoSize=
{
{
minRows
:
1
,
maxRows
:
3
}
}
allowClear
allowClear
onChange=
{
(
e
)
=>
{
onChange=
{
(
e
)
=>
{
setItem
(
prev
=>
{
return
Object
.
assign
({},
prev
,
(
type
===
'design'
)
?
{
designReviewComment
:
e
.
target
.
value
}:
{
standardReviewComment
:
e
.
target
.
value
}
)
})
}
}
}
}
/>
/>
<
Button
type=
'primary'
>
确定
</
Button
>
<
Button
type=
'primary'
>
确定
</
Button
>
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
cabbef77
...
@@ -18,7 +18,7 @@ import './ImportAction.less'
...
@@ -18,7 +18,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
}
=
props
;
const
{
action
,
hints
,
onChange
,
form
,
modelerId
,
terms
,
ddl
,
roughModelerData
,
versionId
,
permitCheckOut
,
catalogId
,
branchId
,
approvalModelId
,
approvalId
}
=
props
;
const
[
constraints
,
setConstraints
]
=
useState
([]);
const
[
constraints
,
setConstraints
]
=
useState
([]);
const
[
constraint
,
setConstraint
]
=
useState
({});
const
[
constraint
,
setConstraint
]
=
useState
({});
...
@@ -52,7 +52,7 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -52,7 +52,7 @@ const ImportAction = React.forwardRef((props, ref) => {
//流程打开模型详情的情况下,id由-1变成-2,会再次触发获取模型详情.这里直接return掉
//流程打开模型详情的情况下,id由-1变成-2,会再次触发获取模型详情.这里直接return掉
if
(
!
mountRef
.
current
&&
action
===
'flow'
)
{
if
(
approvalId
||
(
!
mountRef
.
current
&&
action
===
'flow'
)
)
{
return
;
return
;
}
}
...
@@ -105,7 +105,42 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -105,7 +105,42 @@ const ImportAction = React.forwardRef((props, ref) => {
})
})
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
action
,
hints
,
modelerId
,
ddl
]);
},
[
action
,
hints
,
modelerId
,
ddl
,
approvalId
]);
useEffect
(()
=>
{
if
(
approvalModelId
)
{
//把数据表结构中的数据清空,解决性能问题
const
newModelerData
=
{
...
modelerData
,
easyDataModelerDataModelAttributes
:
[]
};
onChange
&&
onChange
(
newModelerData
);
setModelerData
(
newModelerData
);
modelerDataRef
.
current
=
newModelerData
;
setLoading
(
true
);
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
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
constraint
?.
name
)
{
if
(
constraint
?.
name
)
{
...
...
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