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
0def22f6
Commit
0def22f6
authored
Mar 13, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流程详情
parent
156270f6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
128 additions
and
17 deletions
+128
-17
constant.js
src/util/constant.js
+2
-0
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+119
-6
index.jsx
src/view/Manage/ModelReview/index.jsx
+7
-11
No files found.
src/util/constant.js
View file @
0def22f6
...
...
@@ -18,6 +18,8 @@ export const VersionId = 'vid';
export
const
TemplateId
=
'tid'
;
export
const
Holder
=
'holder'
;
export
const
ReadOnly
=
'readOnly'
;
export
const
ApprovalId
=
'approvalId'
;
export
const
ApprovalType
=
'approvalType'
;
export
const
DataModelerRoleAdmin
=
'admin'
;
export
const
DataModelerRoleUser
=
'user'
;
...
...
src/view/Manage/Model/Component/EditModel.jsx
View file @
0def22f6
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Form
,
Button
,
Space
,
Tooltip
,
Modal
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
,
useRef
,
useMemo
}
from
'react'
;
import
{
Form
,
Button
,
Space
,
Tooltip
,
Modal
,
Select
,
Input
,
}
from
'antd'
;
import
LocalStorage
from
'local-storage'
;
import
{
useMount
,
useUnmount
}
from
'ahooks'
;
import
{
LeftCircleFilled
,
RightCircleFilled
}
from
'@ant-design/icons'
;
import
ImportAction
from
'./ImportAction'
;
import
CatalogModal
from
'./CatalogModal'
;
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
import
{
getQueryParam
,
showMessage
,
showNotifaction
}
from
'../../../../util'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
VersionId
,
Holder
,
DDL
,
ReadOnly
,
BranchId
}
from
'../../../../util/constant'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
VersionId
,
Holder
,
DDL
,
ReadOnly
,
BranchId
,
ApprovalId
,
ApprovalType
}
from
'../../../../util/constant'
;
import
HistoryAndVersionDrawer
from
'./HistoryAndVersionDrawer'
;
import
{
EditModelContext
}
from
'./ContextManage'
;
import
EditInherited
from
'./EditInherited'
;
...
...
@@ -18,7 +19,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
:
''
});
const
[
actionData
,
setActionData
]
=
useState
({
action
:
''
,
catalogId
:
''
,
modelerId
:
''
,
hints
:
[],
roughModelerData
:
null
,
permitCheckOut
:
false
,
editable
:
false
,
stateId
:
''
,
versionId
:
''
,
ddl
:
''
,
readOnly
:
false
,
branchId
:
''
,
approvalId
:
''
,
approvalType
:
''
});
const
[
modelerData
,
setModelerData
]
=
useState
({});
const
[
terms
,
setTerms
]
=
useState
([]);
...
...
@@ -27,12 +28,14 @@ const EditModel = (props) => {
const
[
historyAndVersionDrawerVisible
,
setHistoryAndVersionDrawerVisible
]
=
useState
(
false
);
const
[
autoTabKey
,
setAutoTabKey
]
=
useState
(
null
);
const
[
editInheritedParam
,
setEditInheritedParms
]
=
useState
({
visible
:
false
,
modelerData
:
undefined
});
const
[
loadingApprovalData
,
setLoadingApprovalData
]
=
useState
(
false
)
const
[
approvalData
,
setApprovalData
]
=
useState
()
const
actionRef
=
useRef
(
''
);
const
attrIsEditingRef
=
useRef
(
false
);
const
indexIsEditingRef
=
useRef
(
false
);
const
{
action
,
catalogId
,
modelerId
,
hints
,
roughModelerData
,
permitCheckOut
,
editable
,
stateId
,
versionId
,
holder
,
ddl
,
readOnly
,
branchId
}
=
actionData
;
const
{
action
,
catalogId
,
modelerId
,
hints
,
roughModelerData
,
permitCheckOut
,
editable
,
stateId
,
versionId
,
holder
,
ddl
,
readOnly
,
branchId
,
approvalId
,
approvalType
}
=
actionData
;
const
[
form
]
=
Form
.
useForm
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
...
...
@@ -52,6 +55,8 @@ const EditModel = (props) => {
const
_ddl
=
getQueryParam
(
DDL
,
props
.
location
.
search
);
const
_readOnly
=
getQueryParam
(
ReadOnly
,
props
.
location
.
search
);
const
_branchId
=
getQueryParam
(
BranchId
,
props
.
location
.
search
)
const
_approvalId
=
getQueryParam
(
ApprovalId
,
props
.
location
.
search
)
const
_approvalType
=
getQueryParam
(
ApprovalType
,
props
.
location
.
search
)
let
_hints
=
[];
if
((
_hintsStr
||
''
)
!==
''
)
{
...
...
@@ -65,7 +70,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
,
holder
:
_holder
,
ddl
:
_ddl
,
readOnly
:
_readOnly
,
branchId
:
_branchId
});
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
;
const
interval
=
setInterval
(()
=>
{
...
...
@@ -79,6 +84,12 @@ const EditModel = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
useEffect
(()
=>
{
if
(
approvalId
)
{
getApprovalDetail
()
}
},
[
approvalId
])
useMount
(()
=>
{
window
?.
addEventListener
(
'beforeunload'
,
confirmQuit
);
})
...
...
@@ -93,6 +104,23 @@ const EditModel = (props) => {
});
}
const
getApprovalDetail
=
()
=>
{
setLoadingApprovalData
(
true
)
dispatch
({
type
:
'datamodel.getPhysicalModelApproval'
,
payload
:
{
id
:
approvalId
,
},
callback
:
(
data
)
=>
{
setLoadingApprovalData
(
false
)
setApprovalData
(
data
)
},
error
:
()
=>
{
setLoadingApprovalData
(
false
)
}
})
}
const
confirmQuit
=
(
e
)
=>
{
if
(
actionRef
.
current
===
'edit'
||
actionRef
.
current
===
'add'
)
{
e
.
returnValue
=
''
;
...
...
@@ -414,6 +442,17 @@ const EditModel = (props) => {
</
Space
>
)
}
else
if
(
action
===
'flow'
)
{
if
(
approvalId
)
{
actionsBtn
=
<
PhysicalModelApprovalBottom
loading=
{
loadingApprovalData
}
data=
{
approvalData
}
id=
{
modelerId
}
type=
{
approvalType
}
onChange=
{
(
val
)
=>
{
setActionData
({
...
actionData
,
modelerId
:
val
})
}
}
/>
}
else
{
actionsBtn
=
(
<
Space
>
<
PermissionButton
...
...
@@ -458,6 +497,7 @@ const EditModel = (props) => {
}
</
Space
>
);
}
}
else
if
(
action
===
'detail-version'
)
{
actionsBtn
=
(
<
Space
>
...
...
@@ -512,3 +552,75 @@ const EditModel = (props) => {
}
export
default
EditModel
;
const
PhysicalModelApprovalBottom
=
({
loading
,
type
,
data
,
id
,
onChange
,
onOk
})
=>
{
const
[
item
,
setItem
]
=
useState
()
useEffect
(()
=>
{
if
(
data
&&
id
)
{
const
index
=
(
data
?.
modelInfoList
??[]).
findIndex
(
item
=>
item
.
id
===
id
)
if
(
index
!==
-
1
)
{
setItem
(
data
?.
modelInfoList
[
index
])
}
}
},
[
data
,
id
])
const
[
index
,
canPrev
,
canNext
]
=
useMemo
(()
=>
{
if
(
data
&&
id
)
{
const
index
=
(
data
?.
modelInfoList
??[]).
findIndex
(
item
=>
item
.
id
===
id
)
if
(
index
!==
-
1
)
{
return
[
index
,
index
!==
0
,
index
!==
(
data
?.
modelInfoList
??[]).
length
-
1
]
}
}
return
[
0
,
false
,
false
]
},
[
data
,
id
])
const
onPrevClick
=
()
=>
{
if
(
data
?.
modelInfoList
[
index
-
1
])
{
onChange
?.(
data
?.
modelInfoList
[
index
-
1
].
id
)
}
}
const
onNextClick
=
()
=>
{
if
(
data
?.
modelInfoList
[
index
+
1
])
{
onChange
?.(
data
?.
modelInfoList
[
index
+
1
].
id
)
}
}
return
(
<
div
className=
'flex'
style=
{
{
justifyContent
:
'space-between'
}
}
>
<
Space
>
</
Space
>
<
Space
>
<
Select
value=
{
(
type
===
'design'
)?
item
?.
designReviewPass
:
item
?.
standardReviewPass
}
placeholder=
'选择评审结论'
allowClear
style=
{
{
width
:
'100%'
}
}
onChange=
{
(
val
)
=>
{
}
}
>
<
Select
.
Option
value=
{
true
}
>
通过
</
Select
.
Option
>
<
Select
.
Option
value=
{
false
}
>
不通过
</
Select
.
Option
>
</
Select
>
<
Input
.
TextArea
rows=
{
1
}
value=
{
(
type
===
'design'
)?
item
?.
designReviewComment
:
item
?.
standardReviewComment
}
placeholder=
'请输入评审意见'
autoSize=
{
{
minRows
:
1
,
maxRows
:
3
}
}
allowClear
onChange=
{
(
e
)
=>
{
}
}
/>
<
Button
type=
'primary'
>
确定
</
Button
>
<
Button
type=
'text'
icon=
{
<
LeftCircleFilled
className=
'pointer'
style=
{
{
fontSize
:
26
,
color
:
'#196AD2'
}
}
/>
}
onClick=
{
onPrevClick
}
disabled=
{
!
canPrev
}
></
Button
>
<
Button
type=
'text'
icon=
{
<
RightCircleFilled
className=
'pointer'
style=
{
{
fontSize
:
26
,
color
:
'#196AD2'
}
}
/>
}
onClick=
{
onNextClick
}
disabled=
{
!
canNext
}
></
Button
>
</
Space
>
</
div
>
)
}
\ No newline at end of file
src/view/Manage/ModelReview/index.jsx
View file @
0def22f6
...
...
@@ -6,6 +6,7 @@ import Table from '../../../util/Component/Table'
import
{
isSzseEnv
,
getQueryParam
,
showMessage
}
from
"../../../util"
import
{
dispatch
}
from
'../../../model'
;
import
{
AttachesItem
}
from
"../Model/Component/start-flow"
import
{
Action
,
ApprovalId
,
ApprovalType
,
ModelerId
}
from
"../../../util/constant"
const
FC
=
(
props
)
=>
{
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
...
...
@@ -39,14 +40,6 @@ const FC = (props) => {
})
}
const
onGraghClick
=
()
=>
{
}
const
onCloseClick
=
()
=>
{
}
const
onSaveClick
=
()
=>
{
try
{
const
tableData
=
listRef
.
current
?.
tableData
...
...
@@ -109,7 +102,6 @@ const FC = (props) => {
<
div
className=
'p-5'
style=
{
{
height
:
'100%'
}
}
>
<
div
className=
'flex'
style=
{
{
justifyContent
:
'end'
}
}
>
<
Space
>
<
Button
onClick=
{
onCloseClick
}
>
关闭
</
Button
>
<
Button
onClick=
{
onSaveClick
}
>
保存
</
Button
>
<
Button
onClick=
{
onSubmitClick
}
>
提交
</
Button
>
</
Space
>
...
...
@@ -181,12 +173,12 @@ const List = React.forwardRef(function ({type, data}, ref) {
dataIndex
:
'name'
,
width
:
isSzseEnv
?
360
:
160
,
ellipsis
:
false
,
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
,
index
)
=>
(
<
Tooltip
title=
{
text
}
>
<
Typography
.
Paragraph
ellipsis=
{
{
rows
:
3
,
}
}
><
a
onClick=
{
()
=>
{
onModelClick
(
record
,
index
)
}
}
>
{
text
}
</
a
></
Typography
.
Paragraph
>
</
Tooltip
>
)
...
...
@@ -313,6 +305,10 @@ const List = React.forwardRef(function ({type, data}, ref) {
},
]
const
onModelClick
=
(
record
,
index
)
=>
{
window
.
open
(
`/data-govern/data-model-action?
${
Action
}
=flow&
${
ModelerId
}
=
${
record
?.
id
}
&
$
{
ApprovalId
}
=
$
{
data
?.
id
}
&
$
{
ApprovalType
}
=
$
{
type
}
`)
}
return (
<Form form={form}>
<Table
...
...
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