3
3
4
4
<ContentWrap >
5
5
<el-table v-loading =" loading" :data =" list" >
6
- <el-table-column label =" 定义编号" align =" center" prop =" id" width =" 400" />
7
- <el-table-column label =" 流程名称" align =" center" prop =" name" width =" 200" >
8
- <template #default =" scope " >
9
- <el-button type =" primary" link @click =" handleBpmnDetail(scope.row)" >
10
- <span >{{ scope.row.name }}</span >
11
- </el-button >
6
+ <el-table-column label =" 定义编号" align =" center" prop =" id" min-width =" 250" />
7
+ <el-table-column label =" 流程名称" align =" center" prop =" name" min-width =" 150" />
8
+ <el-table-column label =" 流程图标" align =" center" min-width =" 50" >
9
+ <template #default =" { row } " >
10
+ <el-image v-if =" row.icon" :src =" row.icon" class =" h-24px w-24pxrounded" />
11
+ </template >
12
+ </el-table-column >
13
+ <el-table-column label =" 可见范围" prop =" startUserIds" min-width =" 100" >
14
+ <template #default =" { row } " >
15
+ <el-text v-if =" !row.startUsers?.length" > 全部可见 </el-text >
16
+ <el-text v-else-if =" row.startUsers.length === 1" >
17
+ {{ row.startUsers[0].nickname }}
18
+ </el-text >
19
+ <el-text v-else >
20
+ <el-tooltip
21
+ class =" box-item"
22
+ effect =" dark"
23
+ placement =" top"
24
+ :content =" row.startUsers.map((user: any) => user.nickname).join('、')"
25
+ >
26
+ {{ row.startUsers[0].nickname }}等 {{ row.startUsers.length }} 人可见
27
+ </el-tooltip >
28
+ </el-text >
29
+ </template >
30
+ </el-table-column >
31
+ <el-table-column label =" 流程类型" prop =" modelType" min-width =" 120" >
32
+ <template #default =" { row } " >
33
+ <dict-tag :value =" row.modelType" :type =" DICT_TYPE.BPM_MODEL_TYPE" />
12
34
</template >
13
35
</el-table-column >
14
- <el-table-column label =" 定义分类" align =" center" prop =" categoryName" width =" 100" />
15
- <el-table-column label =" 表单信息" align =" center" prop =" formType" width =" 200" >
36
+ <el-table-column label =" 表单信息" prop =" formType" min-width =" 150" >
16
37
<template #default =" scope " >
17
38
<el-button
18
- v-if =" scope.row.formType === 10 "
39
+ v-if =" scope.row.formType === BpmModelFormType.NORMAL "
19
40
type =" primary"
20
41
link
21
42
@click =" handleFormDetail(scope.row)"
22
43
>
23
44
<span >{{ scope.row.formName }}</span >
24
45
</el-button >
25
- <el-button v-else type =" primary" link @click =" handleFormDetail(scope.row)" >
46
+ <el-button
47
+ v-else-if =" scope.row.formType === BpmModelFormType.CUSTOM"
48
+ type =" primary"
49
+ link
50
+ @click =" handleFormDetail(scope.row)"
51
+ >
26
52
<span >{{ scope.row.formCustomCreatePath }}</span >
27
53
</el-button >
54
+ <label v-else >暂无表单</label >
28
55
</template >
29
56
</el-table-column >
30
- <el-table-column label =" 流程版本" align =" center" prop = " processDefinition.version " width =" 80" >
57
+ <el-table-column label =" 流程版本" align =" center" min- width =" 80" >
31
58
<template #default =" scope " >
32
- <el-tag v-if =" scope.row" >v{{ scope.row.version }}</el-tag >
33
- <el-tag type =" warning" v-else >未部署</el-tag >
34
- </template >
35
- </el-table-column >
36
- <el-table-column label =" 状态" align =" center" prop =" version" width =" 80" >
37
- <template #default =" scope " >
38
- <el-tag type =" success" v-if =" scope.row.suspensionState === 1" >激活</el-tag >
39
- <el-tag type =" warning" v-if =" scope.row.suspensionState === 2" >挂起</el-tag >
59
+ <el-tag >v{{ scope.row.version }}</el-tag >
40
60
</template >
41
61
</el-table-column >
42
62
<el-table-column
46
66
width =" 180"
47
67
:formatter =" dateFormatter"
48
68
/>
49
- <el-table-column
50
- label =" 定义描述"
51
- align =" center"
52
- prop =" description"
53
- width =" 300"
54
- show-overflow-tooltip
55
- />
56
69
</el-table >
57
70
<!-- 分页 -->
58
71
<Pagination
67
80
<Dialog title =" 表单详情" v-model =" formDetailVisible" width =" 800" >
68
81
<form-create :rule =" formDetailPreview.rule" :option =" formDetailPreview.option" />
69
82
</Dialog >
70
-
71
- <!-- 弹窗:流程模型图的预览 -->
72
- <Dialog title =" 流程图" v-model =" bpmnDetailVisible" width =" 800" >
73
- <MyProcessViewer style =" height : 700px " key =" designer" :xml =" bpmnXml" />
74
- </Dialog >
75
83
</template >
76
84
77
85
<script lang="ts" setup>
78
86
import { dateFormatter } from ' @/utils/formatTime'
79
- import { MyProcessViewer } from ' @/components/bpmnProcessDesigner/package'
80
87
import * as DefinitionApi from ' @/api/bpm/definition'
81
88
import { setConfAndFields2 } from ' @/utils/formCreate'
89
+ import { DICT_TYPE } from ' @/utils/dict'
90
+ import { BpmModelFormType } from ' @/utils/constants'
82
91
83
92
defineOptions ({ name: ' BpmProcessDefinition' })
84
93
@@ -113,7 +122,7 @@ const formDetailPreview = ref({
113
122
option: {}
114
123
})
115
124
const handleFormDetail = async (row : any ) => {
116
- if (row .formType == 10 ) {
125
+ if (row .formType == BpmModelFormType . NORMAL ) {
117
126
// 设置表单
118
127
setConfAndFields2 (formDetailPreview , row .formConf , row .formFields )
119
128
// 弹窗打开
@@ -125,19 +134,21 @@ const handleFormDetail = async (row: any) => {
125
134
}
126
135
}
127
136
128
- /** 流程图的详情按钮操作 */
129
- const bpmnDetailVisible = ref (false )
130
- const bpmnXml = ref (' ' )
131
- const handleBpmnDetail = async (row : any ) => {
132
- // 设置可见
133
- bpmnXml .value = ' '
134
- bpmnDetailVisible .value = true
135
- // 加载 BPMN XML
136
- bpmnXml .value = (await DefinitionApi .getProcessDefinition (row .id ))?.bpmnXml
137
- }
138
-
139
137
/** 初始化 **/
140
138
onMounted (() => {
141
139
getList ()
142
140
})
143
141
</script >
142
+
143
+ <style lang="scss" scoped>
144
+ .flow-icon {
145
+ display : flex ;
146
+ width : 38px ;
147
+ height : 38px ;
148
+ margin-right : 10px ;
149
+ background-color : var (--el-color-primary );
150
+ border-radius : 0.25rem ;
151
+ align-items : center ;
152
+ justify-content : center ;
153
+ }
154
+ </style >
0 commit comments