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
05b408d1
authored
Mar 21, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BPM:新增流程的重新发起
parent
0d4b6f63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
19 deletions
+49
-19
src/router/modules/remaining.ts
+8
-8
src/views/bpm/processInstance/create/index.vue
+34
-8
src/views/bpm/processInstance/index.vue
+7
-3
No files found.
src/router/modules/remaining.ts
View file @
05b408d1
...
@@ -243,7 +243,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
...
@@ -243,7 +243,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
},
},
children
:
[
children
:
[
{
{
path
:
'
/
manager/form/edit'
,
path
:
'manager/form/edit'
,
component
:
()
=>
import
(
'@/views/bpm/form/editor/index.vue'
),
component
:
()
=>
import
(
'@/views/bpm/form/editor/index.vue'
),
name
:
'BpmFormEditor'
,
name
:
'BpmFormEditor'
,
meta
:
{
meta
:
{
...
@@ -255,7 +255,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
...
@@ -255,7 +255,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
}
}
},
},
{
{
path
:
'
/
manager/model/edit'
,
path
:
'manager/model/edit'
,
component
:
()
=>
import
(
'@/views/bpm/model/editor/index.vue'
),
component
:
()
=>
import
(
'@/views/bpm/model/editor/index.vue'
),
name
:
'BpmModelEditor'
,
name
:
'BpmModelEditor'
,
meta
:
{
meta
:
{
...
@@ -267,7 +267,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
...
@@ -267,7 +267,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
}
}
},
},
{
{
path
:
'
/
manager/simple/workflow/model/edit'
,
path
:
'manager/simple/workflow/model/edit'
,
component
:
()
=>
import
(
'@/views/bpm/simpleWorkflow/index.vue'
),
component
:
()
=>
import
(
'@/views/bpm/simpleWorkflow/index.vue'
),
name
:
'SimpleWorkflowDesignEditor'
,
name
:
'SimpleWorkflowDesignEditor'
,
meta
:
{
meta
:
{
...
@@ -279,7 +279,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
...
@@ -279,7 +279,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
}
}
},
},
{
{
path
:
'
/
manager/definition'
,
path
:
'manager/definition'
,
component
:
()
=>
import
(
'@/views/bpm/definition/index.vue'
),
component
:
()
=>
import
(
'@/views/bpm/definition/index.vue'
),
name
:
'BpmProcessDefinition'
,
name
:
'BpmProcessDefinition'
,
meta
:
{
meta
:
{
...
@@ -291,7 +291,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
...
@@ -291,7 +291,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
}
}
},
},
{
{
path
:
'
/
process-instance/detail'
,
path
:
'process-instance/detail'
,
component
:
()
=>
import
(
'@/views/bpm/processInstance/detail/index.vue'
),
component
:
()
=>
import
(
'@/views/bpm/processInstance/detail/index.vue'
),
name
:
'BpmProcessInstanceDetail'
,
name
:
'BpmProcessInstanceDetail'
,
meta
:
{
meta
:
{
...
@@ -299,11 +299,11 @@ const remainingRouter: AppRouteRecordRaw[] = [
...
@@ -299,11 +299,11 @@ const remainingRouter: AppRouteRecordRaw[] = [
hidden
:
true
,
hidden
:
true
,
canTo
:
true
,
canTo
:
true
,
title
:
'流程详情'
,
title
:
'流程详情'
,
activeMenu
:
'
bpm/processInstance/detail
'
activeMenu
:
'
/bpm/task/my
'
}
}
},
},
{
{
path
:
'
/bpm/
oa/leave/create'
,
path
:
'oa/leave/create'
,
component
:
()
=>
import
(
'@/views/bpm/oa/leave/create.vue'
),
component
:
()
=>
import
(
'@/views/bpm/oa/leave/create.vue'
),
name
:
'OALeaveCreate'
,
name
:
'OALeaveCreate'
,
meta
:
{
meta
:
{
...
@@ -315,7 +315,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
...
@@ -315,7 +315,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
}
}
},
},
{
{
path
:
'
/bpm/
oa/leave/detail'
,
path
:
'oa/leave/detail'
,
component
:
()
=>
import
(
'@/views/bpm/oa/leave/detail.vue'
),
component
:
()
=>
import
(
'@/views/bpm/oa/leave/detail.vue'
),
name
:
'OALeaveDetail'
,
name
:
'OALeaveDetail'
,
meta
:
{
meta
:
{
...
...
src/views/bpm/processInstance/create/index.vue
View file @
05b408d1
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
<form-create
<form-create
:rule=
"detailForm.rule"
:rule=
"detailForm.rule"
v-model:api=
"fApi"
v-model:api=
"fApi"
v-model=
"detailForm.value"
:option=
"detailForm.option"
:option=
"detailForm.option"
@
submit=
"submitForm"
@
submit=
"submitForm"
/>
/>
...
@@ -67,12 +68,16 @@ import { setConfAndFields2 } from '@/utils/formCreate'
...
@@ -67,12 +68,16 @@ import { 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'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
defineOptions
({
name
:
'BpmProcessInstanceCreate'
})
defineOptions
({
name
:
'BpmProcessInstanceCreate'
})
const
router
=
useRouter
()
// 路由
const
route
=
useRoute
()
// 路由
const
{
push
,
currentRoute
}
=
useRouter
()
// 路由
const
message
=
useMessage
()
// 消息
const
message
=
useMessage
()
// 消息
const
{
delView
}
=
useTagsViewStore
()
// 视图操作
const
processInstanceId
=
route
.
query
.
processInstanceId
const
loading
=
ref
(
true
)
// 加载中
const
loading
=
ref
(
true
)
// 加载中
const
categoryList
=
ref
([])
// 分类的列表
const
categoryList
=
ref
([])
// 分类的列表
const
categoryActive
=
ref
(
''
)
// 选中的分类
const
categoryActive
=
ref
(
''
)
// 选中的分类
...
@@ -91,6 +96,23 @@ const getList = async () => {
...
@@ -91,6 +96,23 @@ const getList = async () => {
processDefinitionList
.
value
=
await
DefinitionApi
.
getProcessDefinitionList
({
processDefinitionList
.
value
=
await
DefinitionApi
.
getProcessDefinitionList
({
suspensionState
:
1
suspensionState
:
1
})
})
// 如果 processInstanceId 非空,说明是重新发起
if
(
processInstanceId
?.
length
>
0
)
{
const
processInstance
=
await
ProcessInstanceApi
.
getProcessInstance
(
processInstanceId
)
if
(
!
processInstance
)
{
message
.
error
(
'重新发起流程失败,原因:流程实例不存在'
)
return
}
const
processDefinition
=
processDefinitionList
.
value
.
find
(
(
item
)
=>
item
.
key
==
processInstance
.
processDefinition
?.
key
)
if
(
!
processDefinition
)
{
message
.
error
(
'重新发起流程失败,原因:流程定义不存在'
)
return
}
await
handleSelect
(
processDefinition
,
processInstance
.
formVariables
)
}
}
finally
{
}
finally
{
loading
.
value
=
false
loading
.
value
=
false
}
}
...
@@ -105,26 +127,26 @@ const categoryProcessDefinitionList = computed(() => {
...
@@ -105,26 +127,26 @@ const categoryProcessDefinitionList = computed(() => {
const
bpmnXML
=
ref
(
null
)
// BPMN 数据
const
bpmnXML
=
ref
(
null
)
// BPMN 数据
const
fApi
=
ref
<
ApiAttrs
>
()
const
fApi
=
ref
<
ApiAttrs
>
()
const
detailForm
=
ref
({
const
detailForm
=
ref
({
// 流程表单详情
rule
:
[],
rule
:
[],
option
:
{}
option
:
{},
})
value
:
{}
})
// 流程表单详情
const
selectProcessDefinition
=
ref
()
// 选择的流程定义
const
selectProcessDefinition
=
ref
()
// 选择的流程定义
/** 处理选择流程的按钮操作 **/
/** 处理选择流程的按钮操作 **/
const
handleSelect
=
async
(
row
)
=>
{
const
handleSelect
=
async
(
row
,
formVariables
)
=>
{
// 设置选择的流程
// 设置选择的流程
selectProcessDefinition
.
value
=
row
selectProcessDefinition
.
value
=
row
// 情况一:流程表单
// 情况一:流程表单
if
(
row
.
formType
==
10
)
{
if
(
row
.
formType
==
10
)
{
// 设置表单
// 设置表单
setConfAndFields2
(
detailForm
,
row
.
formConf
,
row
.
formFields
)
setConfAndFields2
(
detailForm
,
row
.
formConf
,
row
.
formFields
,
formVariables
)
// 加载流程图
// 加载流程图
bpmnXML
.
value
=
await
DefinitionApi
.
getProcessDefinitionBpmnXML
(
row
.
id
)
bpmnXML
.
value
=
await
DefinitionApi
.
getProcessDefinitionBpmnXML
(
row
.
id
)
// 情况二:业务表单
// 情况二:业务表单
}
else
if
(
row
.
formCustomCreatePath
)
{
}
else
if
(
row
.
formCustomCreatePath
)
{
await
router
.
push
({
await
push
({
path
:
row
.
formCustomCreatePath
path
:
row
.
formCustomCreatePath
})
})
// 这里暂时无需加载流程图,因为跳出到另外个 Tab;
// 这里暂时无需加载流程图,因为跳出到另外个 Tab;
...
@@ -145,7 +167,11 @@ const submitForm = async (formData) => {
...
@@ -145,7 +167,11 @@ const submitForm = async (formData) => {
})
})
// 提示
// 提示
message
.
success
(
'发起流程成功'
)
message
.
success
(
'发起流程成功'
)
router
.
go
(
-
1
)
// 跳转回去
delView
(
unref
(
currentRoute
))
await
push
({
name
:
'BpmProcessInstance'
})
}
finally
{
}
finally
{
fApi
.
value
.
btn
.
loading
(
false
)
fApi
.
value
.
btn
.
loading
(
false
)
}
}
...
...
src/views/bpm/processInstance/index.vue
View file @
05b408d1
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
type=
"primary"
type=
"primary"
plain
plain
v-hasPermi=
"['bpm:process-instance:query']"
v-hasPermi=
"['bpm:process-instance:query']"
@
click=
"handleCreate"
@
click=
"handleCreate
()
"
>
>
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
发起流程
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
发起流程
</el-button>
</el-button>
...
@@ -135,6 +135,9 @@
...
@@ -135,6 +135,9 @@
>
>
取消
取消
</el-button>
</el-button>
<el-button
link
type=
"primary"
v-else
@
click=
"handleCreate(scope.row.id)"
>
重新发起
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -200,9 +203,10 @@ const resetQuery = () => {
...
@@ -200,9 +203,10 @@ const resetQuery = () => {
}
}
/** 发起流程操作 **/
/** 发起流程操作 **/
const
handleCreate
=
()
=>
{
const
handleCreate
=
(
id
)
=>
{
router
.
push
({
router
.
push
({
name
:
'BpmProcessInstanceCreate'
name
:
'BpmProcessInstanceCreate'
,
query
:
{
processInstanceId
:
id
}
})
})
}
}
...
...
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