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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
168 additions
and
58 deletions
+168
-58
constant.js
src/util/constant.js
+2
-0
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+159
-47
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';
...
@@ -18,6 +18,8 @@ export const VersionId = 'vid';
export
const
TemplateId
=
'tid'
;
export
const
TemplateId
=
'tid'
;
export
const
Holder
=
'holder'
;
export
const
Holder
=
'holder'
;
export
const
ReadOnly
=
'readOnly'
;
export
const
ReadOnly
=
'readOnly'
;
export
const
ApprovalId
=
'approvalId'
;
export
const
ApprovalType
=
'approvalType'
;
export
const
DataModelerRoleAdmin
=
'admin'
;
export
const
DataModelerRoleAdmin
=
'admin'
;
export
const
DataModelerRoleUser
=
'user'
;
export
const
DataModelerRoleUser
=
'user'
;
...
...
src/view/Manage/Model/Component/EditModel.jsx
View file @
0def22f6
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
,
useMemo
}
from
'react'
;
import
{
Form
,
Button
,
Space
,
Tooltip
,
Modal
}
from
'antd'
;
import
{
Form
,
Button
,
Space
,
Tooltip
,
Modal
,
Select
,
Input
,
}
from
'antd'
;
import
LocalStorage
from
'local-storage'
;
import
LocalStorage
from
'local-storage'
;
import
{
useMount
,
useUnmount
}
from
'ahooks'
;
import
{
useMount
,
useUnmount
}
from
'ahooks'
;
import
{
LeftCircleFilled
,
RightCircleFilled
}
from
'@ant-design/icons'
;
import
ImportAction
from
'./ImportAction'
;
import
ImportAction
from
'./ImportAction'
;
import
CatalogModal
from
'./CatalogModal'
;
import
CatalogModal
from
'./CatalogModal'
;
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
import
{
getQueryParam
,
showMessage
,
showNotifaction
}
from
'../../../../util'
;
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
HistoryAndVersionDrawer
from
'./HistoryAndVersionDrawer'
;
import
{
EditModelContext
}
from
'./ContextManage'
;
import
{
EditModelContext
}
from
'./ContextManage'
;
import
EditInherited
from
'./EditInherited'
;
import
EditInherited
from
'./EditInherited'
;
...
@@ -18,7 +19,7 @@ import './EditModel.less';
...
@@ -18,7 +19,7 @@ import './EditModel.less';
const
EditModel
=
(
props
)
=>
{
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
[
modelerData
,
setModelerData
]
=
useState
({});
const
[
terms
,
setTerms
]
=
useState
([]);
const
[
terms
,
setTerms
]
=
useState
([]);
...
@@ -27,12 +28,14 @@ const EditModel = (props) => {
...
@@ -27,12 +28,14 @@ const EditModel = (props) => {
const
[
historyAndVersionDrawerVisible
,
setHistoryAndVersionDrawerVisible
]
=
useState
(
false
);
const
[
historyAndVersionDrawerVisible
,
setHistoryAndVersionDrawerVisible
]
=
useState
(
false
);
const
[
autoTabKey
,
setAutoTabKey
]
=
useState
(
null
);
const
[
autoTabKey
,
setAutoTabKey
]
=
useState
(
null
);
const
[
editInheritedParam
,
setEditInheritedParms
]
=
useState
({
visible
:
false
,
modelerData
:
undefined
});
const
[
editInheritedParam
,
setEditInheritedParms
]
=
useState
({
visible
:
false
,
modelerData
:
undefined
});
const
[
loadingApprovalData
,
setLoadingApprovalData
]
=
useState
(
false
)
const
[
approvalData
,
setApprovalData
]
=
useState
()
const
actionRef
=
useRef
(
''
);
const
actionRef
=
useRef
(
''
);
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
,
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
[
form
]
=
Form
.
useForm
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
...
@@ -52,6 +55,8 @@ const EditModel = (props) => {
...
@@ -52,6 +55,8 @@ const EditModel = (props) => {
const
_ddl
=
getQueryParam
(
DDL
,
props
.
location
.
search
);
const
_ddl
=
getQueryParam
(
DDL
,
props
.
location
.
search
);
const
_readOnly
=
getQueryParam
(
ReadOnly
,
props
.
location
.
search
);
const
_readOnly
=
getQueryParam
(
ReadOnly
,
props
.
location
.
search
);
const
_branchId
=
getQueryParam
(
BranchId
,
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
=
[];
let
_hints
=
[];
if
((
_hintsStr
||
''
)
!==
''
)
{
if
((
_hintsStr
||
''
)
!==
''
)
{
...
@@ -65,7 +70,7 @@ const EditModel = (props) => {
...
@@ -65,7 +70,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
,
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
;
actionRef
.
current
=
_action
;
const
interval
=
setInterval
(()
=>
{
const
interval
=
setInterval
(()
=>
{
...
@@ -79,6 +84,12 @@ const EditModel = (props) => {
...
@@ -79,6 +84,12 @@ const EditModel = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
},
[])
useEffect
(()
=>
{
if
(
approvalId
)
{
getApprovalDetail
()
}
},
[
approvalId
])
useMount
(()
=>
{
useMount
(()
=>
{
window
?.
addEventListener
(
'beforeunload'
,
confirmQuit
);
window
?.
addEventListener
(
'beforeunload'
,
confirmQuit
);
})
})
...
@@ -93,6 +104,23 @@ const EditModel = (props) => {
...
@@ -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
)
=>
{
const
confirmQuit
=
(
e
)
=>
{
if
(
actionRef
.
current
===
'edit'
||
actionRef
.
current
===
'add'
)
{
if
(
actionRef
.
current
===
'edit'
||
actionRef
.
current
===
'add'
)
{
e
.
returnValue
=
''
;
e
.
returnValue
=
''
;
...
@@ -414,50 +442,62 @@ const EditModel = (props) => {
...
@@ -414,50 +442,62 @@ const EditModel = (props) => {
</
Space
>
</
Space
>
)
)
}
else
if
(
action
===
'flow'
)
{
}
else
if
(
action
===
'flow'
)
{
actionsBtn
=
(
if
(
approvalId
)
{
<
Space
>
actionsBtn
=
<
PhysicalModelApprovalBottom
<
PermissionButton
loading=
{
loadingApprovalData
}
type=
'primary'
data=
{
approvalData
}
onClick=
{
onHistory
}
id=
{
modelerId
}
danger
type=
{
approvalType
}
permissionKey=
'历史版本'
onChange=
{
(
val
)
=>
{
permissions=
{
modelerData
?.
optionList
?.
filter
(
item
=>
item
.
enabled
)?.
map
(
item
=>
item
.
name
)
}
setActionData
({
...
actionData
,
modelerId
:
val
})
>
}
}
版本历史
/>
</
PermissionButton
>
}
else
{
{
actionsBtn
=
(
!
modelerData
?.
inheritedFromEasyDataModelerDataModel
&&
<
PermissionButton
<
Space
>
<
PermissionButton
type=
'primary'
onClick=
{
onHistory
}
danger
permissionKey=
'历史版本'
permissions=
{
modelerData
?.
optionList
?.
filter
(
item
=>
item
.
enabled
)?.
map
(
item
=>
item
.
name
)
}
>
版本历史
</
PermissionButton
>
{
!
modelerData
?.
inheritedFromEasyDataModelerDataModel
&&
<
PermissionButton
type=
'primary'
onClick=
{
()
=>
{
if
(
importActionRef
.
current
&&
importActionRef
.
current
.
isLoading
())
{
showMessage
(
"warn"
,
'正在加载中,请稍后!'
);
return
;
}
setActionData
({
...
actionData
,
action
:
'edit-inherited'
});
actionRef
.
current
=
'edit-inherited'
;
setEditInheritedParms
({
visible
:
true
,
modelerData
});
}
}
danger
permissionKey=
'编辑'
permissions=
{
modelerData
?.
optionList
?.
filter
(
item
=>
item
.
enabled
)?.
map
(
item
=>
item
.
name
)
}
>
编辑历史存储形式
</
PermissionButton
>
}
{
!
modelerData
?.
inheritedFromEasyDataModelerDataModel
&&
editable
&&
<
PermissionButton
type=
'primary'
type=
'primary'
onClick=
{
()
=>
{
onClick=
{
edit
}
if
(
importActionRef
.
current
&&
importActionRef
.
current
.
isLoading
())
{
showMessage
(
"warn"
,
'正在加载中,请稍后!'
);
return
;
}
setActionData
({
...
actionData
,
action
:
'edit-inherited'
});
actionRef
.
current
=
'edit-inherited'
;
setEditInheritedParms
({
visible
:
true
,
modelerData
});
}
}
danger
danger
permissionKey=
'编辑'
permissionKey=
'编辑'
permissions=
{
modelerData
?.
optionList
?.
filter
(
item
=>
item
.
enabled
)?.
map
(
item
=>
item
.
name
)
}
permissions=
{
modelerData
?.
optionList
?.
filter
(
item
=>
item
.
enabled
)?.
map
(
item
=>
item
.
name
)
}
>
>
编辑历史存储形式
编辑
</
PermissionButton
>
</
PermissionButton
>
}
}
{
</
Space
>
!
modelerData
?.
inheritedFromEasyDataModelerDataModel
&&
editable
&&
<
PermissionButton
);
type=
'primary'
}
onClick=
{
edit
}
danger
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
=
(
<
Space
>
<
Space
>
...
@@ -511,4 +551,76 @@ const EditModel = (props) => {
...
@@ -511,4 +551,76 @@ const EditModel = (props) => {
);
);
}
}
export
default
EditModel
;
export
default
EditModel
;
\ No newline at end of file
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'
...
@@ -6,6 +6,7 @@ import Table from '../../../util/Component/Table'
import
{
isSzseEnv
,
getQueryParam
,
showMessage
}
from
"../../../util"
import
{
isSzseEnv
,
getQueryParam
,
showMessage
}
from
"../../../util"
import
{
dispatch
}
from
'../../../model'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
AttachesItem
}
from
"../Model/Component/start-flow"
import
{
AttachesItem
}
from
"../Model/Component/start-flow"
import
{
Action
,
ApprovalId
,
ApprovalType
,
ModelerId
}
from
"../../../util/constant"
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
...
@@ -39,14 +40,6 @@ const FC = (props) => {
...
@@ -39,14 +40,6 @@ const FC = (props) => {
})
})
}
}
const
onGraghClick
=
()
=>
{
}
const
onCloseClick
=
()
=>
{
}
const
onSaveClick
=
()
=>
{
const
onSaveClick
=
()
=>
{
try
{
try
{
const
tableData
=
listRef
.
current
?.
tableData
const
tableData
=
listRef
.
current
?.
tableData
...
@@ -109,7 +102,6 @@ const FC = (props) => {
...
@@ -109,7 +102,6 @@ const FC = (props) => {
<
div
className=
'p-5'
style=
{
{
height
:
'100%'
}
}
>
<
div
className=
'p-5'
style=
{
{
height
:
'100%'
}
}
>
<
div
className=
'flex'
style=
{
{
justifyContent
:
'end'
}
}
>
<
div
className=
'flex'
style=
{
{
justifyContent
:
'end'
}
}
>
<
Space
>
<
Space
>
<
Button
onClick=
{
onCloseClick
}
>
关闭
</
Button
>
<
Button
onClick=
{
onSaveClick
}
>
保存
</
Button
>
<
Button
onClick=
{
onSaveClick
}
>
保存
</
Button
>
<
Button
onClick=
{
onSubmitClick
}
>
提交
</
Button
>
<
Button
onClick=
{
onSubmitClick
}
>
提交
</
Button
>
</
Space
>
</
Space
>
...
@@ -181,12 +173,12 @@ const List = React.forwardRef(function ({type, data}, ref) {
...
@@ -181,12 +173,12 @@ const List = React.forwardRef(function ({type, data}, ref) {
dataIndex
:
'name'
,
dataIndex
:
'name'
,
width
:
isSzseEnv
?
360
:
160
,
width
:
isSzseEnv
?
360
:
160
,
ellipsis
:
false
,
ellipsis
:
false
,
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
,
index
)
=>
(
<
Tooltip
title=
{
text
}
>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Paragraph
ellipsis=
{
{
<
Typography
.
Paragraph
ellipsis=
{
{
rows
:
3
,
rows
:
3
,
}
}
><
a
onClick=
{
()
=>
{
}
}
><
a
onClick=
{
()
=>
{
onModelClick
(
record
,
index
)
}
}
>
{
text
}
</
a
></
Typography
.
Paragraph
>
}
}
>
{
text
}
</
a
></
Typography
.
Paragraph
>
</
Tooltip
>
</
Tooltip
>
)
)
...
@@ -313,6 +305,10 @@ const List = React.forwardRef(function ({type, data}, ref) {
...
@@ -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 (
return (
<Form form={form}>
<Form form={form}>
<Table
<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