n20-common-lib 2.22.32 → 2.22.33
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
CHANGED
|
@@ -27,9 +27,10 @@
|
|
|
27
27
|
:step="step"
|
|
28
28
|
:format-tooltip="$options.filters.zoomFormat"
|
|
29
29
|
style="width: 200px"
|
|
30
|
+
@input="applyZoom"
|
|
30
31
|
/>
|
|
31
32
|
<el-button type="text" icon="el-icon-zoom-in" style="font-size: 18px" @click="scaleAdd" />
|
|
32
|
-
<span class="m-l-s m-r-s" style="display: inline-block; width:
|
|
33
|
+
<span class="m-l-s m-r-s" style="display: inline-block; width: 42px; line-height: 38px">{{
|
|
33
34
|
zoomValue | zoomFormat
|
|
34
35
|
}}</span>
|
|
35
36
|
<svg
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
></path>
|
|
55
56
|
</svg>
|
|
56
57
|
</div>
|
|
57
|
-
<el-popover ref="title-pop" v-model="
|
|
58
|
+
<el-popover ref="title-pop" v-model="popoverVisible" trigger="hover" placement="top">
|
|
58
59
|
<div class="activiti-msg">
|
|
59
60
|
<div v-if="assigneeEnd" class="m-t-ss m-b-ss">
|
|
60
61
|
<div class="flex-box flex-r">
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
</div>
|
|
85
86
|
</div>
|
|
86
87
|
</el-popover>
|
|
87
|
-
<el-popover ref="addTask-pop" v-model="
|
|
88
|
+
<el-popover ref="addTask-pop" v-model="addTaskVisible" trigger="manual" placement="bottom">
|
|
88
89
|
<div @click.stop>
|
|
89
90
|
<div class="m-b el-dialog__title">{{ '加签流程' | $lc }}</div>
|
|
90
91
|
<div class="p-a" style="text-align: center">
|
|
@@ -117,8 +118,8 @@
|
|
|
117
118
|
}"
|
|
118
119
|
:data-element-id="item.addTaskDefId"
|
|
119
120
|
:transform="`matrix(1 0 0 1 ${1 + i * 160} 1)`"
|
|
120
|
-
@mouseenter="(ev) =>
|
|
121
|
-
@mouseleave="
|
|
121
|
+
@mouseenter="(ev) => showTaskPopover(item.addTaskDefId, ev)"
|
|
122
|
+
@mouseleave="popoverVisible = false"
|
|
122
123
|
>
|
|
123
124
|
<rect
|
|
124
125
|
x="0"
|
|
@@ -151,8 +152,14 @@
|
|
|
151
152
|
</div>
|
|
152
153
|
</el-popover>
|
|
153
154
|
|
|
154
|
-
<el-popover
|
|
155
|
-
|
|
155
|
+
<el-popover
|
|
156
|
+
ref="child-pop"
|
|
157
|
+
v-model="childVisible"
|
|
158
|
+
popper-class="n20-approval-child"
|
|
159
|
+
trigger="manual"
|
|
160
|
+
placement="bottom"
|
|
161
|
+
>
|
|
162
|
+
<div v-if="childVisible" v-click-outside="clickOut">
|
|
156
163
|
<div>{{ childTitle }}</div>
|
|
157
164
|
<child :data-pro="childDataPro" />
|
|
158
165
|
</div>
|
|
@@ -181,8 +188,8 @@ export default {
|
|
|
181
188
|
}
|
|
182
189
|
},
|
|
183
190
|
data() {
|
|
184
|
-
this.
|
|
185
|
-
this.
|
|
191
|
+
this.svgWrap = undefined
|
|
192
|
+
this.svgElement = undefined
|
|
186
193
|
return {
|
|
187
194
|
assignee: undefined,
|
|
188
195
|
assigneeEnd: undefined,
|
|
@@ -192,21 +199,16 @@ export default {
|
|
|
192
199
|
step: 0.1,
|
|
193
200
|
zoomValue: 1,
|
|
194
201
|
markerId: '',
|
|
195
|
-
|
|
196
|
-
|
|
202
|
+
popoverVisible: false,
|
|
203
|
+
addTaskVisible: false,
|
|
197
204
|
addTaskList: [],
|
|
198
|
-
|
|
205
|
+
childVisible: false,
|
|
199
206
|
childTitle: '',
|
|
200
207
|
childDataPro: undefined
|
|
201
208
|
}
|
|
202
209
|
},
|
|
203
|
-
watch: {
|
|
204
|
-
zoomValue() {
|
|
205
|
-
this.scaleSvg()
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
210
|
async mounted() {
|
|
209
|
-
this.
|
|
211
|
+
this.svgWrap = this.$refs['activiti-svg-wrap']
|
|
210
212
|
let {
|
|
211
213
|
flowString,
|
|
212
214
|
seqRecords,
|
|
@@ -226,82 +228,85 @@ export default {
|
|
|
226
228
|
}
|
|
227
229
|
this.setSvgAttrs(flowSvg)
|
|
228
230
|
this.setPendingUserInfo(unApplayUserTaskCandidate)
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
let line = this.svgW.querySelector(`[data-element-id="${k}"] path`)
|
|
232
|
-
if (line) {
|
|
233
|
-
this.addNode(k, line, addTask[k])
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
for (let k in addTaskPre) {
|
|
237
|
-
let g = this.svgW.querySelector(`[data-element-id="${k}"]`)
|
|
238
|
-
if (g) {
|
|
239
|
-
this.addNode(k, g, addTaskPre[k], 'addTaskPre')
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
seqRecords.forEach((obj) => {
|
|
244
|
-
this.setTaskRecord(obj)
|
|
245
|
-
})
|
|
246
|
-
|
|
247
|
-
// 非加签节点添加事件
|
|
248
|
-
currentActivityIdList.forEach((currentActivityId) => {
|
|
249
|
-
let assignee = currAssMap[currentActivityId]
|
|
250
|
-
let assigneeEnd = taskDefIdMap[currentActivityId]
|
|
251
|
-
let task = this.svgW.querySelector(`[data-element-id="${currentActivityId}"]`)
|
|
252
|
-
if (task) {
|
|
253
|
-
task.classList.add('activiti-node-at')
|
|
254
|
-
if (!currentActivityId.includes('@addTaskType')) {
|
|
255
|
-
this.addEvent(task, { assignee, assigneeEnd }, 'pending')
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
})
|
|
259
|
-
for (let k in taskDefIdMap) {
|
|
260
|
-
if (!currentActivityIdList.includes(k)) {
|
|
261
|
-
let taskK = this.svgW.querySelector(`[data-element-id="${k}"]`)
|
|
262
|
-
if (taskK) {
|
|
263
|
-
if (!k.includes('@addTaskType')) {
|
|
264
|
-
this.addEvent(taskK, taskDefIdMap[k])
|
|
265
|
-
this.addChildEvent(taskK, taskDefIdMap[k])
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
} catch (error) {
|
|
271
|
-
console.warn('setTaskErr:', error)
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
let { default: panzoom } = await importG('panzoom', () => import(/*webpackChunkName: "panzoom"*/ 'panzoom'))
|
|
275
|
-
|
|
276
|
-
this.svgPanzoom = panzoom(this.svgC, {
|
|
277
|
-
maxZoom: this.max,
|
|
278
|
-
minZoom: this.min,
|
|
279
|
-
bounds: true,
|
|
280
|
-
boundsPadding: 0.1,
|
|
281
|
-
beforeWheel: function (e) {
|
|
282
|
-
return !e.ctrlKey
|
|
283
|
-
}
|
|
284
|
-
})
|
|
285
|
-
this.svgPanzoom.on('zoom', (e) => {
|
|
286
|
-
let { scale } = e.getTransform()
|
|
287
|
-
this.zoomValue = scale
|
|
288
|
-
})
|
|
289
|
-
|
|
231
|
+
this.bindTaskEvents({ currentActivityIdList, currAssMap, taskDefIdMap, addTask, addTaskPre, seqRecords })
|
|
232
|
+
await this.initPanzoom()
|
|
290
233
|
document.body.addEventListener('click', this.addTaskFn)
|
|
291
234
|
},
|
|
292
235
|
|
|
293
236
|
deactivated() {
|
|
294
|
-
this.
|
|
295
|
-
this.
|
|
296
|
-
this.
|
|
237
|
+
this.popoverVisible = false
|
|
238
|
+
this.childVisible = false
|
|
239
|
+
this.addTaskVisible = false
|
|
297
240
|
},
|
|
298
241
|
beforeDestroy() {
|
|
299
|
-
this.
|
|
300
|
-
this.
|
|
242
|
+
this.popoverVisible = false
|
|
243
|
+
this.childVisible = false
|
|
301
244
|
this.svgPanzoom && this.svgPanzoom.dispose()
|
|
302
245
|
document.body.removeEventListener('click', this.addTaskFn)
|
|
303
246
|
},
|
|
304
247
|
methods: {
|
|
248
|
+
bindTaskEvents({ currentActivityIdList, currAssMap, taskDefIdMap, addTask, addTaskPre, seqRecords }) {
|
|
249
|
+
try {
|
|
250
|
+
for (let k in addTask) {
|
|
251
|
+
let line = this.svgWrap.querySelector(`[data-element-id="${k}"] path`)
|
|
252
|
+
if (line) {
|
|
253
|
+
this.addNode(k, line, addTask[k])
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
for (let k in addTaskPre) {
|
|
257
|
+
let g = this.svgWrap.querySelector(`[data-element-id="${k}"]`)
|
|
258
|
+
if (g) {
|
|
259
|
+
this.addNode(k, g, addTaskPre[k], 'addTaskPre')
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
seqRecords.forEach((obj) => {
|
|
264
|
+
this.setTaskRecord(obj)
|
|
265
|
+
})
|
|
266
|
+
|
|
267
|
+
currentActivityIdList.forEach((currentActivityId) => {
|
|
268
|
+
let assignee = currAssMap[currentActivityId]
|
|
269
|
+
let assigneeEnd = taskDefIdMap[currentActivityId]
|
|
270
|
+
let task = this.svgWrap.querySelector(`[data-element-id="${currentActivityId}"]`)
|
|
271
|
+
if (task) {
|
|
272
|
+
task.classList.add('activiti-node-at')
|
|
273
|
+
if (!currentActivityId.includes('@addTaskType')) {
|
|
274
|
+
this.addEvent(task, { assignee, assigneeEnd }, 'pending')
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
})
|
|
278
|
+
for (let k in taskDefIdMap) {
|
|
279
|
+
if (!currentActivityIdList.includes(k)) {
|
|
280
|
+
let taskK = this.svgWrap.querySelector(`[data-element-id="${k}"]`)
|
|
281
|
+
if (taskK) {
|
|
282
|
+
if (!k.includes('@addTaskType')) {
|
|
283
|
+
this.addEvent(taskK, taskDefIdMap[k])
|
|
284
|
+
this.addChildEvent(taskK, taskDefIdMap[k])
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
} catch (error) {
|
|
290
|
+
console.warn('setTaskErr:', error)
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
async initPanzoom() {
|
|
294
|
+
let { default: panzoom } = await importG('panzoom', () => import(/*webpackChunkName: "panzoom"*/ 'panzoom'))
|
|
295
|
+
|
|
296
|
+
this.svgPanzoom = panzoom(this.svgElement, {
|
|
297
|
+
maxZoom: this.max,
|
|
298
|
+
minZoom: this.min,
|
|
299
|
+
bounds: true,
|
|
300
|
+
boundsPadding: 0.1,
|
|
301
|
+
beforeWheel: function (e) {
|
|
302
|
+
return !e.ctrlKey
|
|
303
|
+
}
|
|
304
|
+
})
|
|
305
|
+
this.svgPanzoom.on('zoom', (e) => {
|
|
306
|
+
let { scale } = e.getTransform()
|
|
307
|
+
this.zoomValue = scale
|
|
308
|
+
})
|
|
309
|
+
},
|
|
305
310
|
// 导出
|
|
306
311
|
uploadList(assigneeEnd) {
|
|
307
312
|
axios
|
|
@@ -328,12 +333,12 @@ export default {
|
|
|
328
333
|
})
|
|
329
334
|
},
|
|
330
335
|
addTaskFn() {
|
|
331
|
-
this.
|
|
336
|
+
this.addTaskVisible = false
|
|
332
337
|
},
|
|
333
338
|
setPendingUserInfo(data) {
|
|
334
339
|
if (data) {
|
|
335
340
|
Object.keys(data).forEach((id) => {
|
|
336
|
-
let task = this.
|
|
341
|
+
let task = this.svgWrap.querySelector(`[data-element-id="${id}"]`)
|
|
337
342
|
if (task) {
|
|
338
343
|
this.addEvent(task, { taskCandidate: data[id] }, 'unApply')
|
|
339
344
|
}
|
|
@@ -341,31 +346,31 @@ export default {
|
|
|
341
346
|
}
|
|
342
347
|
},
|
|
343
348
|
setSvgAttrs(str) {
|
|
344
|
-
this.
|
|
345
|
-
this.
|
|
346
|
-
let width = this.
|
|
347
|
-
let height = this.
|
|
348
|
-
let viewBox = this.
|
|
349
|
+
this.svgWrap.innerHTML = str
|
|
350
|
+
this.svgElement = this.svgWrap.querySelector('svg')
|
|
351
|
+
let width = this.svgElement.getAttribute('width')
|
|
352
|
+
let height = this.svgElement.getAttribute('height')
|
|
353
|
+
let viewBox = this.svgElement.getAttribute('viewBox').split(' ')
|
|
349
354
|
viewBox = [Number(viewBox[0]) - 16, Number(viewBox[1]) - 16, Number(viewBox[2]) + 32, Number(viewBox[3]) + 32]
|
|
350
355
|
viewBox = viewBox.join(' ')
|
|
351
356
|
|
|
352
|
-
this.
|
|
353
|
-
this.
|
|
354
|
-
this.
|
|
357
|
+
this.svgElement.setAttribute('width', Number(width) + 32)
|
|
358
|
+
this.svgElement.setAttribute('height', Number(height) + 32)
|
|
359
|
+
this.svgElement.setAttribute('viewBox', viewBox)
|
|
355
360
|
|
|
356
|
-
let marker = this.
|
|
361
|
+
let marker = this.svgElement.querySelector('defs marker')
|
|
357
362
|
marker && (this.markerId = marker.getAttribute('id'))
|
|
358
363
|
},
|
|
359
364
|
setTaskRecord(obj) {
|
|
360
365
|
let { resouceTaskDefId: from, targetTaskDefId: to, seqDefid: line, type: type } = obj
|
|
361
366
|
if (type === '0') {
|
|
362
|
-
this.
|
|
363
|
-
this.
|
|
364
|
-
this.
|
|
367
|
+
this.svgWrap.querySelector(`[data-element-id="${from}"]`).classList.add('activiti-node-achieve')
|
|
368
|
+
this.svgWrap.querySelector(`[data-element-id="${to}"]`).classList.add('activiti-node-achieve')
|
|
369
|
+
this.svgWrap.querySelector(`[data-element-id="${line}"]`).classList.add('activiti-line-achieve')
|
|
365
370
|
} else {
|
|
366
|
-
this.
|
|
371
|
+
this.svgWrap.querySelector(`[data-element-id="${from}"]`).classList.add('activiti-node-reject')
|
|
367
372
|
if (type === '1') {
|
|
368
|
-
this.
|
|
373
|
+
this.svgWrap.querySelector(`[data-element-id="${to}"]`).classList.add('activiti-node-reject')
|
|
369
374
|
this.setRejectLink(from, to, $lc('驳回至申请人'))
|
|
370
375
|
} else if (type === '2') {
|
|
371
376
|
this.setRejectLink(from, to, $lc('驳回至上一步'))
|
|
@@ -400,30 +405,14 @@ export default {
|
|
|
400
405
|
path.setAttribute('class', 'activiti-line-reject')
|
|
401
406
|
path.setAttribute('d', d)
|
|
402
407
|
path.style.markerEnd = `url('#${this.markerId}')`
|
|
403
|
-
this.
|
|
408
|
+
this.svgElement.appendChild(path)
|
|
404
409
|
|
|
405
410
|
if (msg) {
|
|
406
|
-
let text = document.createElementNS('http://www.w3.org/2000/svg', 'text')
|
|
407
|
-
text.setAttribute('class', 'activiti-text-reject')
|
|
408
411
|
if (fromXC !== toXC) {
|
|
409
|
-
|
|
410
|
-
text.setAttribute('y', oTop + 6)
|
|
412
|
+
this.addSvgLabel('activiti-text-reject', (fromXC + toXC) / 2, oTop + 6, msg, false)
|
|
411
413
|
} else {
|
|
412
|
-
|
|
413
|
-
text.setAttribute('x', oRight + 8)
|
|
414
|
-
text.setAttribute('writing-mode', 'tb')
|
|
414
|
+
this.addSvgLabel('activiti-text-reject', oRight + 8, (fromYC + toYC) / 2, msg, true)
|
|
415
415
|
}
|
|
416
|
-
text.textContent = msg
|
|
417
|
-
this.svgC.appendChild(text)
|
|
418
|
-
|
|
419
|
-
let textO = text.getBBox()
|
|
420
|
-
let rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect')
|
|
421
|
-
rect.setAttribute('class', 'activiti-text-bg-reject')
|
|
422
|
-
rect.setAttribute('x', textO.x)
|
|
423
|
-
rect.setAttribute('y', textO.y)
|
|
424
|
-
rect.setAttribute('width', textO.width)
|
|
425
|
-
rect.setAttribute('height', textO.height)
|
|
426
|
-
this.svgC.insertBefore(rect, text)
|
|
427
416
|
}
|
|
428
417
|
},
|
|
429
418
|
setPropelLink(from, to, msg) {
|
|
@@ -448,34 +437,38 @@ export default {
|
|
|
448
437
|
path.setAttribute('class', 'activiti-line-propel')
|
|
449
438
|
path.setAttribute('d', d)
|
|
450
439
|
path.style.markerEnd = `url('#${this.markerId}')`
|
|
451
|
-
this.
|
|
440
|
+
this.svgElement.appendChild(path)
|
|
452
441
|
|
|
453
442
|
if (msg) {
|
|
454
|
-
let text = document.createElementNS('http://www.w3.org/2000/svg', 'text')
|
|
455
|
-
text.setAttribute('class', 'activiti-text-propel')
|
|
456
443
|
if (fromXC !== toXC) {
|
|
457
|
-
|
|
458
|
-
text.setAttribute('y', oBottom + 6)
|
|
444
|
+
this.addSvgLabel('activiti-text-propel', (fromXC + toXC) / 2, oBottom + 6, msg, false)
|
|
459
445
|
} else {
|
|
460
|
-
|
|
461
|
-
text.setAttribute('x', oLeft + 8)
|
|
462
|
-
text.setAttribute('writing-mode', 'tb')
|
|
446
|
+
this.addSvgLabel('activiti-text-propel', oLeft + 8, (fromYC + toYC) / 2, msg, true)
|
|
463
447
|
}
|
|
464
|
-
text.textContent = msg
|
|
465
|
-
this.svgC.appendChild(text)
|
|
466
|
-
|
|
467
|
-
let textO = text.getBBox()
|
|
468
|
-
let rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect')
|
|
469
|
-
rect.setAttribute('class', 'activiti-text-bg-reject')
|
|
470
|
-
rect.setAttribute('x', textO.x)
|
|
471
|
-
rect.setAttribute('y', textO.y)
|
|
472
|
-
rect.setAttribute('width', textO.width)
|
|
473
|
-
rect.setAttribute('height', textO.height)
|
|
474
|
-
this.svgC.insertBefore(rect, text)
|
|
475
448
|
}
|
|
476
449
|
},
|
|
450
|
+
addSvgLabel(textClass, x, y, msg, vertical) {
|
|
451
|
+
let text = document.createElementNS('http://www.w3.org/2000/svg', 'text')
|
|
452
|
+
text.setAttribute('class', textClass)
|
|
453
|
+
text.setAttribute('x', x)
|
|
454
|
+
text.setAttribute('y', y)
|
|
455
|
+
if (vertical) {
|
|
456
|
+
text.setAttribute('writing-mode', 'tb')
|
|
457
|
+
}
|
|
458
|
+
text.textContent = msg
|
|
459
|
+
this.svgElement.appendChild(text)
|
|
460
|
+
|
|
461
|
+
let textO = text.getBBox()
|
|
462
|
+
let rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect')
|
|
463
|
+
rect.setAttribute('class', 'activiti-text-bg-reject')
|
|
464
|
+
rect.setAttribute('x', textO.x)
|
|
465
|
+
rect.setAttribute('y', textO.y)
|
|
466
|
+
rect.setAttribute('width', textO.width)
|
|
467
|
+
rect.setAttribute('height', textO.height)
|
|
468
|
+
this.svgElement.insertBefore(rect, text)
|
|
469
|
+
},
|
|
477
470
|
getElRect(id) {
|
|
478
|
-
let g = this.
|
|
471
|
+
let g = this.svgWrap.querySelector(`[data-element-id="${id}"]`)
|
|
479
472
|
let rect = {
|
|
480
473
|
with: 100,
|
|
481
474
|
height: 80,
|
|
@@ -556,7 +549,7 @@ export default {
|
|
|
556
549
|
}" stroke-width="1" stroke="#666" fill="none"></line>
|
|
557
550
|
`
|
|
558
551
|
circleG.innerHTML = cEl
|
|
559
|
-
this.
|
|
552
|
+
this.svgElement.appendChild(circleG)
|
|
560
553
|
|
|
561
554
|
circleG.addEventListener('click', (el) => {
|
|
562
555
|
if (el.currentTarget.getAttribute('class').includes('activiti-node-reject')) {
|
|
@@ -572,17 +565,17 @@ export default {
|
|
|
572
565
|
})
|
|
573
566
|
|
|
574
567
|
this.addTaskList = _list
|
|
575
|
-
this.
|
|
568
|
+
this.addTaskVisible = false
|
|
576
569
|
this.$nextTick(() => {
|
|
577
570
|
this.$refs['addTask-pop'].doDestroy()
|
|
578
571
|
this.$refs['addTask-pop'].referenceElm = circleG
|
|
579
|
-
this.
|
|
572
|
+
this.addTaskVisible = true
|
|
580
573
|
})
|
|
581
574
|
el.stopPropagation()
|
|
582
575
|
})
|
|
583
576
|
}
|
|
584
577
|
},
|
|
585
|
-
|
|
578
|
+
showTaskPopover(id, ev) {
|
|
586
579
|
if (this.dataPro.currentActivityIdList.some((cId) => cId === id) /*待审批*/) {
|
|
587
580
|
this.assignee = this.dataPro.currAssMap[id]
|
|
588
581
|
this.assigneeEnd = this.dataPro.taskDefIdMap[id]
|
|
@@ -590,7 +583,7 @@ export default {
|
|
|
590
583
|
this.$nextTick(() => {
|
|
591
584
|
this.$refs['title-pop'].doDestroy()
|
|
592
585
|
this.$refs['title-pop'].referenceElm = ev.currentTarget
|
|
593
|
-
this.
|
|
586
|
+
this.popoverVisible = true
|
|
594
587
|
})
|
|
595
588
|
} else if (this.dataPro.taskDefIdMap[id] /*已审批*/) {
|
|
596
589
|
this.assigneeEnd = this.dataPro.taskDefIdMap[id]
|
|
@@ -600,7 +593,7 @@ export default {
|
|
|
600
593
|
})
|
|
601
594
|
this.$refs['title-pop'].doDestroy()
|
|
602
595
|
this.$refs['title-pop'].referenceElm = ev.currentTarget
|
|
603
|
-
this.
|
|
596
|
+
this.popoverVisible = true
|
|
604
597
|
})
|
|
605
598
|
}
|
|
606
599
|
},
|
|
@@ -625,11 +618,11 @@ export default {
|
|
|
625
618
|
})
|
|
626
619
|
this.$refs['title-pop'].doDestroy()
|
|
627
620
|
this.$refs['title-pop'].referenceElm = task
|
|
628
|
-
this.
|
|
621
|
+
this.popoverVisible = true
|
|
629
622
|
})
|
|
630
623
|
})
|
|
631
624
|
task.addEventListener('mouseleave', () => {
|
|
632
|
-
this.
|
|
625
|
+
this.popoverVisible = false
|
|
633
626
|
})
|
|
634
627
|
},
|
|
635
628
|
addChildEvent(task, list) {
|
|
@@ -647,7 +640,7 @@ export default {
|
|
|
647
640
|
})
|
|
648
641
|
|
|
649
642
|
if (elPoppers.length === 1) {
|
|
650
|
-
this.
|
|
643
|
+
this.childVisible = !this.childVisible
|
|
651
644
|
}
|
|
652
645
|
},
|
|
653
646
|
getFlowData(procInstId, task) {
|
|
@@ -675,129 +668,28 @@ export default {
|
|
|
675
668
|
res.data['addTaskPre'] = addTaskPre
|
|
676
669
|
}
|
|
677
670
|
this.childDataPro = res.data
|
|
678
|
-
this.
|
|
671
|
+
this.childVisible = !this.childVisible
|
|
679
672
|
this.$refs['child-pop'].doDestroy()
|
|
680
673
|
this.$refs['child-pop'].referenceElm = task
|
|
681
674
|
})
|
|
682
675
|
},
|
|
683
676
|
scaleMinus() {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
this.zoomValue = newVal
|
|
687
|
-
} else {
|
|
688
|
-
this.zoomValue = this.min
|
|
689
|
-
}
|
|
677
|
+
this.zoomValue = Math.max(this.min, this.zoomValue - this.step)
|
|
678
|
+
this.applyZoom()
|
|
690
679
|
},
|
|
691
680
|
scaleAdd() {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
this.zoomValue = newVal
|
|
695
|
-
} else {
|
|
696
|
-
this.zoomValue = this.max
|
|
697
|
-
}
|
|
681
|
+
this.zoomValue = Math.min(this.max, this.zoomValue + this.step)
|
|
682
|
+
this.applyZoom()
|
|
698
683
|
},
|
|
699
684
|
scaleReset() {
|
|
700
685
|
this.zoomValue = 1
|
|
701
|
-
this.
|
|
686
|
+
this.applyZoom()
|
|
702
687
|
},
|
|
703
|
-
|
|
688
|
+
applyZoom() {
|
|
704
689
|
this.svgPanzoom && this.svgPanzoom.zoomAbs(0, 0, this.zoomValue)
|
|
705
690
|
}
|
|
706
691
|
}
|
|
707
692
|
}
|
|
708
|
-
|
|
709
|
-
/*
|
|
710
|
-
setRejectLink(from, to) {
|
|
711
|
-
console.log(this.getElRect(from), 444)
|
|
712
|
-
console.log(this.getElRect(to), 444)
|
|
713
|
-
const fromO = this.getElRect(from)
|
|
714
|
-
const toO = this.getElRect(to)
|
|
715
|
-
let direction = undefined
|
|
716
|
-
if (fromO.left + fromO.with < toO.left) {
|
|
717
|
-
if (fromO.top + fromO.height < toO.top) {
|
|
718
|
-
direction = '↘'
|
|
719
|
-
} else if (fromO.top > toO.top + toO.height) {
|
|
720
|
-
direction = '↗'
|
|
721
|
-
} else {
|
|
722
|
-
direction = '→'
|
|
723
|
-
}
|
|
724
|
-
} else if (fromO.left - fromO.with > toO.left) {
|
|
725
|
-
if (fromO.top + fromO.height < toO.top) {
|
|
726
|
-
direction = '↙'
|
|
727
|
-
} else if (fromO.top > toO.top + toO.height) {
|
|
728
|
-
direction = '↖'
|
|
729
|
-
} else {
|
|
730
|
-
direction = '←'
|
|
731
|
-
}
|
|
732
|
-
} else {
|
|
733
|
-
if (fromO.top < toO.top) {
|
|
734
|
-
direction = '↓'
|
|
735
|
-
} else {
|
|
736
|
-
direction = '↑'
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
console.log(direction)
|
|
740
|
-
let d = ''
|
|
741
|
-
switch (direction) {
|
|
742
|
-
case '↘':
|
|
743
|
-
d = `M${fromO.left + fromO.with / 2},${fromO.top + fromO.height}
|
|
744
|
-
L${fromO.left + fromO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
|
|
745
|
-
L${toO.left + toO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
|
|
746
|
-
L${toO.left + toO.with / 2},${toO.top}`
|
|
747
|
-
break
|
|
748
|
-
case '↗':
|
|
749
|
-
d = `M${fromO.left + fromO.with / 2},${fromO.top}
|
|
750
|
-
L${fromO.left + fromO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
|
|
751
|
-
L${toO.left + toO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
|
|
752
|
-
L${toO.left + toO.with / 2},${toO.top + toO.height}`
|
|
753
|
-
break
|
|
754
|
-
case '→':
|
|
755
|
-
d = `M${fromO.left + fromO.with},${fromO.top + fromO.height / 2}
|
|
756
|
-
L${(fromO.left + fromO.with + toO.left) / 2},${fromO.top + fromO.height / 2}
|
|
757
|
-
L${(fromO.left + fromO.with + toO.left) / 2},${toO.top + toO.height / 2}
|
|
758
|
-
L${toO.left},${toO.top + toO.height / 2}`
|
|
759
|
-
break
|
|
760
|
-
case '↙':
|
|
761
|
-
d = `M${fromO.left + fromO.with / 2},${fromO.top + fromO.height}
|
|
762
|
-
L${fromO.left + fromO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
|
|
763
|
-
L${toO.left + toO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
|
|
764
|
-
L${toO.left + toO.with / 2},${toO.top}`
|
|
765
|
-
break
|
|
766
|
-
case '↖':
|
|
767
|
-
d = `M${fromO.left + fromO.with / 2},${fromO.top}
|
|
768
|
-
L${fromO.left + fromO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
|
|
769
|
-
L${toO.left + toO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
|
|
770
|
-
L${toO.left + toO.with / 2},${toO.top + toO.height}`
|
|
771
|
-
break
|
|
772
|
-
case '←':
|
|
773
|
-
d = `M${fromO.left},${fromO.top + fromO.height / 2}
|
|
774
|
-
L${(fromO.left + toO.left + toO.with) / 2},${fromO.top + fromO.height / 2}
|
|
775
|
-
L${(fromO.left + toO.left + toO.with) / 2},${toO.top + toO.height / 2}
|
|
776
|
-
L${toO.left + toO.with},${toO.top + toO.height / 2}`
|
|
777
|
-
break
|
|
778
|
-
case '↓':
|
|
779
|
-
d = `M${fromO.left + fromO.with / 2},${fromO.top + fromO.height}
|
|
780
|
-
L${fromO.left + fromO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
|
|
781
|
-
L${toO.left + toO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
|
|
782
|
-
L${toO.left + toO.with / 2},${toO.top}`
|
|
783
|
-
break
|
|
784
|
-
case '↑':
|
|
785
|
-
d = `M${fromO.left + fromO.with / 2},${fromO.top}
|
|
786
|
-
L${fromO.left + fromO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
|
|
787
|
-
L${toO.left + toO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
|
|
788
|
-
L${toO.left + toO.with / 2},${toO.top + toO.height}`
|
|
789
|
-
break
|
|
790
|
-
}
|
|
791
|
-
d = d.replace(/[\s\n]+/g, ' ')
|
|
792
|
-
|
|
793
|
-
// = `M ${fromO.left},${fromO.top}L${toO.left},${toO.top}`
|
|
794
|
-
|
|
795
|
-
let path = document.createElementNS('http://www.w3.org/2000/svg', 'path')
|
|
796
|
-
path.setAttribute('class', 'activiti-line-reject')
|
|
797
|
-
path.setAttribute('d', d)
|
|
798
|
-
this.svgC.appendChild(path)
|
|
799
|
-
},
|
|
800
|
-
*/
|
|
801
693
|
</script>
|
|
802
694
|
|
|
803
695
|
<style>
|