@lambo-design/workflow-approve 1.0.0-beta.9 → 1.0.0-beta.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -3
- package/src/components/assignee-box.vue +791 -351
- package/src/components/candidate-groups-box.vue +1948 -0
- package/src/components/countersigners-box.vue +858 -0
- package/src/components/history.vue +839 -378
- package/src/components/opinion.vue +322 -302
- package/src/components/process-info.vue +542 -0
- package/src/portrait.vue +2178 -1051
- package/src/styles/css/index.less +378 -220
- package/src/utils/const.js +89 -0
- package/src/workflow-diagram.vue +439 -332
package/src/workflow-diagram.vue
CHANGED
|
@@ -1,332 +1,439 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
|
|
4
|
-
<Collapse v-show="showChart" v-model="showDefaultExpand">
|
|
5
|
-
<Panel name="0">
|
|
6
|
-
流程跟踪图
|
|
7
|
-
<div slot="content">
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<Tag color="
|
|
58
|
-
<Tag color="
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{{ item.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
type:
|
|
116
|
-
default:
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
type:
|
|
120
|
-
default:
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
type:
|
|
124
|
-
default:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="workflowDiagram">
|
|
3
|
+
|
|
4
|
+
<Collapse v-show="showChart" v-model="showDefaultExpand">
|
|
5
|
+
<Panel name="0">
|
|
6
|
+
流程跟踪图
|
|
7
|
+
<div slot="content">
|
|
8
|
+
<span class="operating-instructions">提示:Ctrl+鼠标滚轮可缩放;按住鼠标左键拖动可平移</span>
|
|
9
|
+
<div class="notes-div">
|
|
10
|
+
<span class="notes-done-task">已办节点</span>
|
|
11
|
+
<span class="notes-todo-task">在办节点</span>
|
|
12
|
+
<span class="notes-none-task">未办节点</span>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="containers" :style="'height: '+canvasHeight+ 'px'">
|
|
15
|
+
<div class="canvas" ref="canvas"></div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</Panel>
|
|
19
|
+
</Collapse>
|
|
20
|
+
|
|
21
|
+
<Collapse v-show="showTable" v-model="showDefaultExpand">
|
|
22
|
+
<Panel name="1">
|
|
23
|
+
{{ tableName }}
|
|
24
|
+
<div slot="content">
|
|
25
|
+
<EditTable :columns="tableColumns" v-model="hisAudit" :show-table-option="false">
|
|
26
|
+
</EditTable>
|
|
27
|
+
</div>
|
|
28
|
+
</Panel>
|
|
29
|
+
</Collapse>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<Modal v-model="showDetail" :width="modelWidth" :footer-hide='true' :title="detailDones[0] && detailDones[0].handleName ? detailDones[0].handleName + '详情' : '审批详情'">
|
|
33
|
+
<Card v-for="(item,index) in detailDones" :key="index" style="margin-bottom: 10px">
|
|
34
|
+
<Form :model="item" :label-width="120">
|
|
35
|
+
<Row>
|
|
36
|
+
<i-col span="12" offset="0">
|
|
37
|
+
<FormItem :label="item.handleName ? item.handleName + '节点:' : '审批节点:'">
|
|
38
|
+
{{ item.taskName }}
|
|
39
|
+
</FormItem>
|
|
40
|
+
</i-col>
|
|
41
|
+
<i-col span="12" offset="0">
|
|
42
|
+
<FormItem :label="item.handleName ? item.handleName + '人:' : '审批人:'">
|
|
43
|
+
<Tooltip placement="bottom-end">
|
|
44
|
+
<span class="tooltip-text">{{ item.auditName }}</span>
|
|
45
|
+
<div slot="content" style="white-space: normal;">
|
|
46
|
+
{{ item.auditName }}
|
|
47
|
+
</div>
|
|
48
|
+
</Tooltip>
|
|
49
|
+
|
|
50
|
+
</FormItem>
|
|
51
|
+
</i-col>
|
|
52
|
+
|
|
53
|
+
</Row>
|
|
54
|
+
<Row>
|
|
55
|
+
<i-col span="12" offset="0">
|
|
56
|
+
<FormItem :label="item.handleName ? item.handleName + '结果:' : '审批结果:'">
|
|
57
|
+
<Tag color="green" v-if="item.auditResult == '00'">流程发起</Tag>
|
|
58
|
+
<Tag color="green" v-else-if="item.auditResult == '10'">自动跳过</Tag>
|
|
59
|
+
<Tag color="green" v-else-if="item.auditResult == '11'">与上一环节办理人相同自动跳过</Tag>
|
|
60
|
+
<Tag color="green" v-else-if="item.auditResult == '12'">与发起人相同自动跳过</Tag>
|
|
61
|
+
<Tag color="green" v-else-if="item.auditResult == '13'">办理人为空自动跳过</Tag>
|
|
62
|
+
<Tag color="green" v-else-if="item.auditResult == '14'">符合流程变量条件自动跳过</Tag>
|
|
63
|
+
<Tag color="green" v-else-if="item.auditResult == '30'">通过</Tag>
|
|
64
|
+
<Tag color="volcano" v-else-if="item.auditResult == '40'">{{item.rejectName ? item.rejectName : '驳回'}}上一节点</Tag>
|
|
65
|
+
<Tag color="red" v-else-if="item.auditResult=='50'">{{item.rejectName ? item.rejectName : '驳回'}}到原点</Tag>
|
|
66
|
+
<Tag color="purple" v-else-if="item.auditResult=='51'">流程终止</Tag>
|
|
67
|
+
<Tag color="blue" v-else-if="item.auditResult == '60'">撤回</Tag>
|
|
68
|
+
<Tag color="green" v-else-if="item.auditResult == '61'">交回委派任务</Tag>
|
|
69
|
+
<Tag color="blue" v-else-if="item.auditResult == '62'">委派任务被撤回</Tag>
|
|
70
|
+
<Tag color="cyan" v-else-if="item.auditResult == '80'">跳转指定节点</Tag>
|
|
71
|
+
<Tag color="cyan" v-else-if="item.auditResult == '82'">指定他人处理</Tag>
|
|
72
|
+
<Tag color="cyan" v-else-if="item.auditResult == '83'">会签减签</Tag>
|
|
73
|
+
<Tag color="magenta" v-else-if="item.auditResult == '90'">{{item.rejectName ? item.rejectName : '驳回'}}指定节点</Tag>
|
|
74
|
+
<Tag color="orange" v-else>待审核</Tag>
|
|
75
|
+
</FormItem>
|
|
76
|
+
</i-col>
|
|
77
|
+
<i-col span="12" offset="0">
|
|
78
|
+
<FormItem v-if="item.auditDate" :label="item.handleName ? item.handleName + '时间:' : '审批时间:'">
|
|
79
|
+
{{ item.auditDate }}
|
|
80
|
+
</FormItem>
|
|
81
|
+
<FormItem v-else :label="item.auditResult == '00' ? '发起时间:' : '接收时间:'">
|
|
82
|
+
{{ item.createTime }}
|
|
83
|
+
</FormItem>
|
|
84
|
+
</i-col>
|
|
85
|
+
</Row>
|
|
86
|
+
<Row>
|
|
87
|
+
<i-col span="24" offset="0">
|
|
88
|
+
<FormItem v-if="item.auditComment" :label="item.handleName ? item.handleName + '意见:' : '审批意见:'">
|
|
89
|
+
{{ item.auditComment }}
|
|
90
|
+
</FormItem>
|
|
91
|
+
</i-col>
|
|
92
|
+
</Row>
|
|
93
|
+
</Form>
|
|
94
|
+
</Card>
|
|
95
|
+
</Modal>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
</div>
|
|
99
|
+
</template>
|
|
100
|
+
|
|
101
|
+
<script>
|
|
102
|
+
import ajax from "@lambo-design/shared/utils/ajax";
|
|
103
|
+
import zoomScroll from "@lambo-design/shared/utils/zoomScroll";
|
|
104
|
+
import BpmnViewer from "bpmn-js/lib/Viewer";
|
|
105
|
+
import ModelingModule from 'bpmn-js/lib/features/modeling';
|
|
106
|
+
import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas';
|
|
107
|
+
import EditTable from "@lambo-design/edit-table";
|
|
108
|
+
|
|
109
|
+
export default {
|
|
110
|
+
components: {
|
|
111
|
+
EditTable
|
|
112
|
+
},
|
|
113
|
+
props: {
|
|
114
|
+
canvasHeight: {
|
|
115
|
+
type: Number,
|
|
116
|
+
default: 350
|
|
117
|
+
},
|
|
118
|
+
modelWidth: {
|
|
119
|
+
type: Number,
|
|
120
|
+
default: 693
|
|
121
|
+
},
|
|
122
|
+
modelTitle: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: "审批详情"
|
|
125
|
+
},
|
|
126
|
+
showChart: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: true
|
|
129
|
+
},
|
|
130
|
+
showTable: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: true
|
|
133
|
+
},
|
|
134
|
+
tableName: {
|
|
135
|
+
type: String,
|
|
136
|
+
default: "流程跟踪表"
|
|
137
|
+
},
|
|
138
|
+
handleName: {
|
|
139
|
+
type: String,
|
|
140
|
+
default: "审批"
|
|
141
|
+
},
|
|
142
|
+
approveDetailShowWay: {
|
|
143
|
+
type: String,
|
|
144
|
+
required: false,
|
|
145
|
+
default: "click"
|
|
146
|
+
},
|
|
147
|
+
scrollElement: {
|
|
148
|
+
required: false
|
|
149
|
+
},
|
|
150
|
+
tableColumns: {
|
|
151
|
+
type: Array,
|
|
152
|
+
default: () => {
|
|
153
|
+
return [
|
|
154
|
+
{title: '序号', type: 'index', width: 60},
|
|
155
|
+
{title: '审批节点', key: 'taskName', minWidth: 130},
|
|
156
|
+
{title: '办理人', key: 'auditName', minWidth: 150, tooltip: true},
|
|
157
|
+
{
|
|
158
|
+
title: '审批结果', key: 'auditResult', minWidth: 150,
|
|
159
|
+
render: (h, {row, column, index}) => {
|
|
160
|
+
let label = "";
|
|
161
|
+
let tagColor = "";
|
|
162
|
+
if (row.auditResult == '00'){
|
|
163
|
+
label = '流程发起';
|
|
164
|
+
tagColor = 'green'; // 绿色
|
|
165
|
+
}
|
|
166
|
+
else if (row.auditResult == '10'){
|
|
167
|
+
label = '自动跳过';
|
|
168
|
+
tagColor = 'green'; // 绿色
|
|
169
|
+
}
|
|
170
|
+
else if (row.auditResult == '11') {
|
|
171
|
+
label = '与上一环节办理人相同自动跳过'
|
|
172
|
+
tagColor = 'green' // 绿色
|
|
173
|
+
}
|
|
174
|
+
else if (row.auditResult == '12') {
|
|
175
|
+
label = '与发起人相同自动跳过'
|
|
176
|
+
tagColor = 'green' // 绿色
|
|
177
|
+
}
|
|
178
|
+
else if (row.auditResult == '13') {
|
|
179
|
+
label = '办理人为空自动跳过'
|
|
180
|
+
tagColor = 'green' // 绿色
|
|
181
|
+
}
|
|
182
|
+
else if (row.auditResult == '14') {
|
|
183
|
+
label = '符合流程变量条件自动跳过'
|
|
184
|
+
tagColor = 'green' // 绿色
|
|
185
|
+
}
|
|
186
|
+
else if (row.auditResult == '30'){
|
|
187
|
+
label = '通过';
|
|
188
|
+
tagColor = 'green'; // 绿色
|
|
189
|
+
}
|
|
190
|
+
else if (row.auditResult == '40'){
|
|
191
|
+
label = `${row.rejectName ? row.rejectName : '驳回'}到上一级`;
|
|
192
|
+
tagColor = 'volcano'; // 火红色
|
|
193
|
+
}
|
|
194
|
+
else if (row.auditResult == '50'){
|
|
195
|
+
label = `${row.rejectName ? row.rejectName : '驳回'}到原点`;
|
|
196
|
+
tagColor = 'red'; // 红色
|
|
197
|
+
}
|
|
198
|
+
else if (row.auditResult == '51'){
|
|
199
|
+
label = '流程终止';
|
|
200
|
+
tagColor = 'purple'; // 紫色
|
|
201
|
+
}
|
|
202
|
+
else if (row.auditResult == '60'){
|
|
203
|
+
label = '撤回';
|
|
204
|
+
tagColor = 'blue'; // 蓝色
|
|
205
|
+
}
|
|
206
|
+
else if (row.auditResult == '61'){
|
|
207
|
+
label = '交回委派任务';
|
|
208
|
+
tagColor = 'green'; // 绿色
|
|
209
|
+
}
|
|
210
|
+
else if (row.auditResult == '62'){
|
|
211
|
+
label = '委派任务被撤回';
|
|
212
|
+
tagColor = 'blue'; // 蓝色
|
|
213
|
+
}
|
|
214
|
+
else if (row.auditResult == '80'){
|
|
215
|
+
label = '跳转到指定节点';
|
|
216
|
+
tagColor = 'cyan'; // 青色
|
|
217
|
+
}
|
|
218
|
+
else if (row.auditResult == '82'){
|
|
219
|
+
label = '指定他人处理';
|
|
220
|
+
tagColor = 'cyan'; // 青色
|
|
221
|
+
}
|
|
222
|
+
else if (row.auditResult == '83'){
|
|
223
|
+
label = '会签减签';
|
|
224
|
+
tagColor = 'red'; // 青色
|
|
225
|
+
}
|
|
226
|
+
else if (row.auditResult == '90'){
|
|
227
|
+
label = `${row.rejectName ? row.rejectName : '驳回'}到指定节点`;
|
|
228
|
+
tagColor = 'magenta'; // 品红色
|
|
229
|
+
}
|
|
230
|
+
else{
|
|
231
|
+
label = '待审核';
|
|
232
|
+
tagColor = 'orange'; // 默认橙色
|
|
233
|
+
}
|
|
234
|
+
return h('Tag', {
|
|
235
|
+
props: {
|
|
236
|
+
color: tagColor,
|
|
237
|
+
value: row.auditResult
|
|
238
|
+
}
|
|
239
|
+
}, label);
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
title: '审批时间', key: 'auditTime', minWidth: 150,
|
|
244
|
+
render: (h, {row}) => {
|
|
245
|
+
const displayDate = row.auditDate;
|
|
246
|
+
return h('span', displayDate);
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
title: '审批意见', key: 'auditComment', minWidth: 180, tooltip: true,
|
|
251
|
+
render: (h, {row, column, index}) => {
|
|
252
|
+
let label = "";
|
|
253
|
+
if (row.auditComment == '' || row.auditComment == null) label = '无';
|
|
254
|
+
else label = row.auditComment;
|
|
255
|
+
return h('Label', {
|
|
256
|
+
props: {
|
|
257
|
+
value: row.auditComment
|
|
258
|
+
}
|
|
259
|
+
}, label)
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
];
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
hisAudit: {
|
|
266
|
+
type: Array,
|
|
267
|
+
default: () => {
|
|
268
|
+
return []
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
tableData: {
|
|
272
|
+
type: Array,
|
|
273
|
+
default: () => {
|
|
274
|
+
return []
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
applyId: {
|
|
278
|
+
type: String,
|
|
279
|
+
default: ""
|
|
280
|
+
},
|
|
281
|
+
instanceId: {
|
|
282
|
+
type: String,
|
|
283
|
+
default: ""
|
|
284
|
+
},
|
|
285
|
+
procId: {
|
|
286
|
+
type: String,
|
|
287
|
+
default: ""
|
|
288
|
+
},
|
|
289
|
+
smartFlowServerContext: {
|
|
290
|
+
type: String,
|
|
291
|
+
default: '/api/smart-flow-server',
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
data() {
|
|
295
|
+
return {
|
|
296
|
+
detailDones: [],
|
|
297
|
+
showDetail: false,
|
|
298
|
+
showDefaultExpand: this.getShowDefaultExpand(),
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
computed: {},
|
|
302
|
+
methods: {
|
|
303
|
+
getShowDefaultExpand() {
|
|
304
|
+
let expand = [];
|
|
305
|
+
if (this.showChart) {
|
|
306
|
+
expand.push('0');
|
|
307
|
+
}
|
|
308
|
+
if (this.showTable) {
|
|
309
|
+
expand.push('1');
|
|
310
|
+
}
|
|
311
|
+
return expand;
|
|
312
|
+
},
|
|
313
|
+
|
|
314
|
+
//画流程图
|
|
315
|
+
workflowInit() {
|
|
316
|
+
const canvas = this.$refs.canvas;
|
|
317
|
+
// this.bpmnViewer.destroy();
|
|
318
|
+
// if (this.bpmnViewer) return
|
|
319
|
+
if (this.bpmnViewer) {
|
|
320
|
+
this.bpmnViewer.destroy()
|
|
321
|
+
}
|
|
322
|
+
this.bpmnViewer = new BpmnViewer({
|
|
323
|
+
container: canvas,
|
|
324
|
+
additionalModules: [
|
|
325
|
+
// MoveModule, // 可以调整元素
|
|
326
|
+
ModelingModule, // 基础工具 MoveModule、SetColor 等依赖于此
|
|
327
|
+
MoveCanvasModule, // 移动整个画布
|
|
328
|
+
zoomScroll // 放大缩小
|
|
329
|
+
]
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
//修改zoomScroll的scroll方法,滚动目标element
|
|
333
|
+
zoomScroll.zoomScroll[1].prototype.scroll = (delta)=>{
|
|
334
|
+
let scrollElement = this.scrollElement ? this.scrollElement : this.$refs.workflowDiagram.parentElement.parentElement
|
|
335
|
+
scrollElement.scrollTop -= delta.dy;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
ajax.get(this.smartFlowServerContext + "/manage/processTodo/printData", {
|
|
339
|
+
params: {
|
|
340
|
+
applyId: this.applyId,
|
|
341
|
+
instanceId: this.instanceId,
|
|
342
|
+
procId: this.procId
|
|
343
|
+
}
|
|
344
|
+
}).then(resp => {
|
|
345
|
+
if (resp.data.code == '200') {
|
|
346
|
+
const bpmnXmlStr = resp.data.data.processXml;
|
|
347
|
+
this.bpmnViewer.importXML(bpmnXmlStr);
|
|
348
|
+
setTimeout(() => {
|
|
349
|
+
const printData = resp.data.data.historicData;
|
|
350
|
+
this.doPrint(printData);
|
|
351
|
+
}, 700);
|
|
352
|
+
} else {
|
|
353
|
+
this.$Message.error("加载流程xml失败," + resp.data.data);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
},
|
|
357
|
+
doPrint(printData) {
|
|
358
|
+
var self = this;
|
|
359
|
+
const {doneLightSet, donePointSet, doneTaskSet, todoPointSet} =
|
|
360
|
+
printData;
|
|
361
|
+
const canvas = this.bpmnViewer.get("canvas");
|
|
362
|
+
const elementRegistry = this.bpmnViewer.get('elementRegistry');
|
|
363
|
+
const userTaskList = elementRegistry.filter(
|
|
364
|
+
(item) => item.type === 'bpmn:UserTask'
|
|
365
|
+
);
|
|
366
|
+
//循环节点查找multiple
|
|
367
|
+
self.notMultiple = true;
|
|
368
|
+
canvas.zoom("fit-viewport", "auto");
|
|
369
|
+
var eventBus = this.bpmnViewer.get("eventBus");
|
|
370
|
+
var dones = this.tableData;
|
|
371
|
+
// eventBus.on('element.click', function (evt) {
|
|
372
|
+
// eventBus.on('element.hover', function (evt) {
|
|
373
|
+
eventBus.on(`element.${this.approveDetailShowWay}`, function (evt) {
|
|
374
|
+
self.detailDones = [];
|
|
375
|
+
for (var item of dones) {
|
|
376
|
+
if (item.taskNode == evt.element.id) {
|
|
377
|
+
self.detailDones.push(item);
|
|
378
|
+
// self.showDetail = true;
|
|
379
|
+
// self.$emit("showTaskNode", item);
|
|
380
|
+
// break;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (self.detailDones.length > 0) {
|
|
384
|
+
self.showDetail = true;
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
for (var k in doneLightSet) {
|
|
389
|
+
if (doneLightSet[k]) {
|
|
390
|
+
canvas.addMarker(doneLightSet[k], "done-line");
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
for (var k in donePointSet) {
|
|
394
|
+
if (donePointSet[k]) {
|
|
395
|
+
canvas.addMarker(donePointSet[k], "done-point");
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
for (var k in doneTaskSet) {
|
|
399
|
+
if (doneTaskSet[k]) {
|
|
400
|
+
canvas.addMarker(doneTaskSet[k], "done-task");
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
for (var k in todoPointSet) {
|
|
404
|
+
if (todoPointSet[k]) {
|
|
405
|
+
canvas.addMarker(todoPointSet[k], "todo-point");
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
},
|
|
410
|
+
// 校验必填
|
|
411
|
+
isNotBlank(val) {
|
|
412
|
+
return (val != null || val === 0) && (val.toString().trim() != '' || val === 0)
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
mounted() {
|
|
416
|
+
if (this.isNotBlank(this.applyId)) {
|
|
417
|
+
this.$nextTick(() => {
|
|
418
|
+
this.workflowInit();
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
watch: {
|
|
423
|
+
applyId(val) {
|
|
424
|
+
if (this.isNotBlank(val)) {
|
|
425
|
+
this.workflowInit();
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
instanceId(val) {
|
|
429
|
+
if (this.isNotBlank(this.applyId) && this.isNotBlank(val)) {
|
|
430
|
+
this.workflowInit();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
</script>
|
|
436
|
+
|
|
437
|
+
<style lang="less">
|
|
438
|
+
@import "./styles/css/index.less";
|
|
439
|
+
</style>
|