Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
67430a83
authored
Oct 28, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能修复】工作流:流程审批不通过后,重启发起时,直接报错的问题
parent
d599134d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
+19
-15
src/views/bpm/definition/index.vue
+8
-14
src/views/bpm/processInstance/create/index.vue
+11
-1
No files found.
src/views/bpm/definition/index.vue
View file @
67430a83
...
@@ -70,13 +70,7 @@
...
@@ -70,13 +70,7 @@
<!-- 弹窗:流程模型图的预览 -->
<!-- 弹窗:流程模型图的预览 -->
<Dialog
title=
"流程图"
v-model=
"bpmnDetailVisible"
width=
"800"
>
<Dialog
title=
"流程图"
v-model=
"bpmnDetailVisible"
width=
"800"
>
<MyProcessViewer
<MyProcessViewer
style=
"height: 700px"
key=
"designer"
:xml=
"bpmnXml"
/>
key=
"designer"
v-model=
"bpmnXml"
:value=
"bpmnXml as any"
v-bind=
"bpmnControlForm"
:prefix=
"bpmnControlForm.prefix"
/>
</Dialog>
</Dialog>
</template>
</template>
...
@@ -118,7 +112,7 @@ const formDetailPreview = ref({
...
@@ -118,7 +112,7 @@ const formDetailPreview = ref({
rule
:
[],
rule
:
[],
option
:
{}
option
:
{}
})
})
const
handleFormDetail
=
async
(
row
)
=>
{
const
handleFormDetail
=
async
(
row
:
any
)
=>
{
if
(
row
.
formType
==
10
)
{
if
(
row
.
formType
==
10
)
{
// 设置表单
// 设置表单
setConfAndFields2
(
formDetailPreview
,
row
.
formConf
,
row
.
formFields
)
setConfAndFields2
(
formDetailPreview
,
row
.
formConf
,
row
.
formFields
)
...
@@ -133,13 +127,13 @@ const handleFormDetail = async (row) => {
...
@@ -133,13 +127,13 @@ const handleFormDetail = async (row) => {
/** 流程图的详情按钮操作 */
/** 流程图的详情按钮操作 */
const
bpmnDetailVisible
=
ref
(
false
)
const
bpmnDetailVisible
=
ref
(
false
)
const
bpmnXml
=
ref
(
null
)
const
bpmnXml
=
ref
(
''
)
const
bpmnControlForm
=
ref
({
const
handleBpmnDetail
=
async
(
row
:
any
)
=>
{
prefix
:
'flowable'
// 设置可见
})
bpmnXml
.
value
=
''
const
handleBpmnDetail
=
async
(
row
)
=>
{
bpmnXml
.
value
=
(
await
DefinitionApi
.
getProcessDefinition
(
row
.
id
))?.
bpmnXml
bpmnDetailVisible
.
value
=
true
bpmnDetailVisible
.
value
=
true
// 加载 BPMN XML
bpmnXml
.
value
=
(
await
DefinitionApi
.
getProcessDefinition
(
row
.
id
))?.
bpmnXml
}
}
/** 初始化 **/
/** 初始化 **/
...
...
src/views/bpm/processInstance/create/index.vue
View file @
67430a83
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
*
as
DefinitionApi
from
'@/api/bpm/definition'
import
*
as
DefinitionApi
from
'@/api/bpm/definition'
import
*
as
ProcessInstanceApi
from
'@/api/bpm/processInstance'
import
*
as
ProcessInstanceApi
from
'@/api/bpm/processInstance'
import
{
setConfAndFields2
}
from
'@/utils/formCreate'
import
{
decodeFields
,
setConfAndFields2
}
from
'@/utils/formCreate'
import
type
{
ApiAttrs
}
from
'@form-create/element-ui/types/config'
import
type
{
ApiAttrs
}
from
'@form-create/element-ui/types/config'
import
ProcessInstanceBpmnViewer
from
'../detail/ProcessInstanceBpmnViewer.vue'
import
ProcessInstanceBpmnViewer
from
'../detail/ProcessInstanceBpmnViewer.vue'
import
{
CategoryApi
}
from
'@/api/bpm/category'
import
{
CategoryApi
}
from
'@/api/bpm/category'
...
@@ -185,7 +185,17 @@ const handleSelect = async (row, formVariables) => {
...
@@ -185,7 +185,17 @@ const handleSelect = async (row, formVariables) => {
// 情况一:流程表单
// 情况一:流程表单
if
(
row
.
formType
==
10
)
{
if
(
row
.
formType
==
10
)
{
// 设置表单
// 设置表单
// 注意:需要从 formVariables 中,移除不在 row.formFields 的值。
// 原因是:后端返回的 formVariables 里面,会有一些非表单的信息。例如说,某个流程节点的审批人。
// 这样,就可能导致一个流程被审批不通过后,重新发起时,会直接后端报错!!!
const
allowedFields
=
decodeFields
(
row
.
formFields
).
map
((
fieldObj
:
any
)
=>
fieldObj
.
field
)
for
(
const
key
in
formVariables
)
{
if
(
!
allowedFields
.
includes
(
key
))
{
delete
formVariables
[
key
]
}
}
setConfAndFields2
(
detailForm
,
row
.
formConf
,
row
.
formFields
,
formVariables
)
setConfAndFields2
(
detailForm
,
row
.
formConf
,
row
.
formFields
,
formVariables
)
// 加载流程图
// 加载流程图
const
processDefinitionDetail
=
await
DefinitionApi
.
getProcessDefinition
(
row
.
id
)
const
processDefinitionDetail
=
await
DefinitionApi
.
getProcessDefinition
(
row
.
id
)
if
(
processDefinitionDetail
)
{
if
(
processDefinitionDetail
)
{
...
...
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