@lambo-design/workflow-approve 1.0.0-beta.9 → 1.0.0-beta.91

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.
@@ -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
- <div class="containers" :style="'height: '+canvasHeight+ 'px'">
9
- <div class="canvas" ref="canvas"></div>
10
- </div>
11
- </div>
12
- </Panel>
13
- </Collapse>
14
-
15
- <Collapse v-show="showTable" v-model="showDefaultExpand">
16
- <Panel name="1">
17
- {{ tableName }}
18
- <div slot="content">
19
- <EditTable :columns="tableColumns" v-model="hisAudit" :show-table-option="false">
20
- </EditTable>
21
- </div>
22
- </Panel>
23
- </Collapse>
24
-
25
-
26
- <Modal v-model="showDetail" :width="modelWidth" :footer-hide='true' title="审批详情">
27
- <Card v-for="(item,index) in detailDones" :key="index" style="margin-bottom: 10px">
28
- <Form :model="item" :label-width="140" class="compactForm">
29
- <Row>
30
- <i-col span="12" offset="0">
31
- <FormItem label="审批节点:">
32
- {{ item.taskName }}
33
- </FormItem>
34
- </i-col>
35
- <i-col span="12" offset="0">
36
- <FormItem label="审批人:">
37
- <Tooltip placement="bottom-end">
38
- <span class="tooltip-text">{{ item.auditName }}</span>
39
- <div slot="content" style="white-space: normal;">
40
- {{ item.auditName }}
41
- </div>
42
- </Tooltip>
43
-
44
- </FormItem>
45
- </i-col>
46
-
47
- </Row>
48
- <Row>
49
- <i-col span="12" offset="0">
50
- <FormItem label="审批结果:">
51
- <Tag color="success" v-if="item.auditResult == '30'">通过</Tag>
52
- <Tag color="error" v-else-if="item.auditResult == '40'">驳回到上一节点</Tag>
53
- <Tag color="error" v-else-if="item.auditResult=='50'">驳回到原点</Tag>
54
- <Tag color="error" v-else-if="item.auditResult=='51'">流程终止</Tag>
55
- <Tag color="error" v-else-if="item.auditResult == '60'">撤回</Tag>
56
- <Tag color="success" v-else-if="item.auditResult == '80'">跳转到指定节点</Tag>
57
- <Tag color="success" v-else-if="item.auditResult == '90'">驳回到指定节点</Tag>
58
- <Tag color="success" v-else>待审核</Tag>
59
- </FormItem>
60
- </i-col>
61
- <i-col span="12" offset="0">
62
- <FormItem v-if="item.startDate" label="发起时间:">
63
- {{ item.startDate }}
64
- </FormItem>
65
- <FormItem v-else label="审批时间:">
66
- {{ item.auditDate }}
67
- </FormItem>
68
- </i-col>
69
- </Row>
70
- <Row>
71
- <i-col span="24" offset="0">
72
- <FormItem v-if="item.auditComment" label="审批意见:">
73
- {{ item.auditComment }}
74
- </FormItem>
75
- </i-col>
76
- </Row>
77
- </Form>
78
- </Card>
79
- </Modal>
80
-
81
-
82
- </div>
83
- </template>
84
-
85
- <script>
86
- import ajax from "@lambo-design/shared/utils/ajax";
87
- import zoomScroll from "@lambo-design/shared/utils/zoomScroll";
88
- import BpmnViewer from "bpmn-js/lib/Viewer";
89
- import ModelingModule from 'bpmn-js/lib/features/modeling';
90
- import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas';
91
- import EditTable from "@lambo-design/edit-table";
92
-
93
- export default {
94
- components: {
95
- EditTable
96
- },
97
- props: {
98
- canvasHeight: {
99
- type: Number,
100
- default: 350
101
- },
102
- modelWidth: {
103
- type: Number,
104
- default: 693
105
- },
106
- modelTitle: {
107
- type: String,
108
- default: "审批详情"
109
- },
110
- showChart: {
111
- type: Boolean,
112
- default: true
113
- },
114
- showTable: {
115
- type: Boolean,
116
- default: true
117
- },
118
- tableName: {
119
- type: String,
120
- default: "审批流程跟踪"
121
- },
122
- tableColumns: {
123
- type: Array,
124
- default: () => {
125
- return [
126
- {title: '序号', type: 'index', width: 80},
127
- {title: '审批节点', key: 'taskName', minWidth: 130},
128
- {title: '办理人', key: 'auditName', minWidth: 180, tooltip: true},
129
- {
130
- title: '审批结果', key: 'auditResult', minWidth: 100,
131
- render: (h, {row, column, index}) => {
132
- let label = "";
133
- if (row.auditResult == '30') label = '通过';
134
- else if (row.auditResult == '40') label = '驳回到上一级';
135
- else if (row.auditResult == '50') label = '驳回到原点';
136
- else if (row.auditResult == '51') label = '流程终止';
137
- else if (row.auditResult == '60') label = '撤回';
138
- else if (row.auditResult == '80') label = '跳转到指定节点';
139
- else if (row.auditResult == '90') label = '驳回到指定节点';
140
- else label = '待审核';
141
- return h('Label', {
142
- props: {
143
- value: row.auditResult
144
- }
145
- }, label)
146
- }
147
- },
148
- {
149
- title: '审批时间', key: 'auditTime', minWidth: 150,
150
- render: (h, {row}) => {
151
- const displayDate = row.startDate || row.auditDate;
152
- return h('span', displayDate);
153
- }
154
- },
155
- {
156
- title: '审批意见', key: 'auditComment', minWidth: 180, tooltip: true,
157
- render: (h, {row, column, index}) => {
158
- let label = "";
159
- if (row.auditComment == '' || row.auditComment == null) label = '无';
160
- else label = row.auditComment;
161
- return h('Label', {
162
- props: {
163
- value: row.auditComment
164
- }
165
- }, label)
166
- }
167
- }
168
- ];
169
- }
170
- },
171
- hisAudit: {
172
- type: Array,
173
- default: () => {
174
- return []
175
- }
176
- },
177
- tableData: {
178
- type: Array,
179
- default: () => {
180
- return []
181
- }
182
- },
183
- applyId: {
184
- type: String,
185
- default: ""
186
- },
187
- instanceId: {
188
- type: String,
189
- default: ""
190
- },
191
- procId: {
192
- type: String,
193
- default: ""
194
- },
195
- smartFlowServerContext: {
196
- type: String,
197
- default: '/api/smart-flow-server',
198
- },
199
- },
200
- data() {
201
- return {
202
- detailDones: [],
203
- showDetail: false,
204
- showDefaultExpand: this.getShowDefaultExpand(),
205
- }
206
- },
207
- computed: {},
208
- methods: {
209
- getShowDefaultExpand() {
210
- let expand = [];
211
- if (this.showChart) {
212
- expand.push('0');
213
- }
214
- if (this.showTable) {
215
- expand.push('1');
216
- }
217
- return expand;
218
- },
219
-
220
- //画流程图
221
- workflowInit() {
222
- const canvas = this.$refs.canvas;
223
- // this.bpmnViewer.destroy();
224
- // if (this.bpmnViewer) return
225
- if (this.bpmnViewer){
226
- this.bpmnViewer.destroy()
227
- }
228
- this.bpmnViewer = new BpmnViewer({
229
- container: canvas,
230
- additionalModules: [
231
- // MoveModule, // 可以调整元素
232
- ModelingModule, // 基础工具 MoveModule、SetColor 等依赖于此
233
- MoveCanvasModule, // 移动整个画布
234
- zoomScroll // 放大缩小
235
- ]
236
- });
237
-
238
- ajax.get(this.smartFlowServerContext + "/manage/processTodo/printData", {
239
- params: {
240
- applyId: this.applyId,
241
- instanceId: this.instanceId,
242
- procId: this.procId
243
- }
244
- }).then(resp => {
245
- if (resp.data.code == '200') {
246
- const bpmnXmlStr = resp.data.data.processXml;
247
- this.bpmnViewer.importXML(bpmnXmlStr);
248
- setTimeout(() => {
249
- const printData = resp.data.data.historicData;
250
- this.doPrint(printData);
251
- }, 700);
252
- } else {
253
- this.$Message.error("加载流程xml失败," + resp.data.data);
254
- }
255
- });
256
- },
257
- doPrint(printData) {
258
- var self = this;
259
- const {doneLightSet, donePointSet, doneTaskSet, todoPointSet} =
260
- printData;
261
- const canvas = this.bpmnViewer.get("canvas");
262
- const elementRegistry = this.bpmnViewer.get('elementRegistry');
263
- const userTaskList = elementRegistry.filter(
264
- (item) => item.type === 'bpmn:UserTask'
265
- );
266
- //循环节点查找multiple
267
- self.notMultiple = true;
268
- canvas.zoom("fit-viewport", "auto");
269
- var eventBus = this.bpmnViewer.get("eventBus");
270
- var dones = this.tableData;
271
- eventBus.on('element.click', function (evt) {
272
- self.detailDones = [];
273
- for (var item of dones) {
274
- if (item.taskNode == evt.element.id) {
275
- self.detailDones.push(item);
276
- self.showDetail = true;
277
- self.$emit("showTaskNode", item);
278
- break;
279
- }
280
- }
281
- });
282
-
283
- for (var k in doneLightSet) {
284
- if (doneLightSet[k]) {
285
- canvas.addMarker(doneLightSet[k], "done-line");
286
- }
287
- }
288
- for (var k in donePointSet) {
289
- if (donePointSet[k]) {
290
- canvas.addMarker(donePointSet[k], "done-point");
291
- }
292
- }
293
- for (var k in doneTaskSet) {
294
- if (doneTaskSet[k]) {
295
- canvas.addMarker(doneTaskSet[k], "done-task");
296
- }
297
- }
298
- for (var k in todoPointSet) {
299
- if (todoPointSet[k]) {
300
- canvas.addMarker(todoPointSet[k], "todo-point");
301
- }
302
- }
303
-
304
- },
305
- // 校验必填
306
- isNotBlank(val) {
307
- return (val != null || val === 0) && (val.toString().trim() != '' || val === 0)
308
- }
309
- },
310
- mounted() {
311
- if (this.isNotBlank(this.applyId)) {
312
- this.workflowInit();
313
- }
314
- },
315
- watch: {
316
- applyId(val) {
317
- if (this.isNotBlank(val)) {
318
- this.workflowInit();
319
- }
320
- },
321
- instanceId(val) {
322
- if (this.isNotBlank(this.applyId) && this.isNotBlank(val)) {
323
- this.workflowInit();
324
- }
325
- }
326
- }
327
- }
328
- </script>
329
-
330
- <style lang="less">
331
- @import "./styles/css/index.less";
332
- </style>
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>