n20-common-lib 1.3.71 → 1.3.73

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "1.3.71",
3
+ "version": "1.3.73",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -4,7 +4,7 @@
4
4
  <el-form label-position="right" label-width="5em">
5
5
  <div v-if="taskId && showBtn" class="flex-box">
6
6
  <div v-if="authList.includes('isCarboncopy')" class="flex-1">
7
- <el-form-item label="抄送">
7
+ <el-form-item label="抄送" class="m-b">
8
8
  <el-input
9
9
  :value="carbonCopyList.map((c) => c.uname).join(', ')"
10
10
  type="textarea"
@@ -13,9 +13,14 @@
13
13
  />
14
14
  </el-form-item>
15
15
  </div>
16
- <div v-if="authList.includes('加签')" class="flex-1">
17
- <el-form-item label="加签">
18
- <el-input type="textarea" :autosize="{ minRows: 1 }" />
16
+ <div v-if="authList.includes('isAddtask')" class="flex-1">
17
+ <el-form-item label="加签" class="m-b">
18
+ <el-input
19
+ type="textarea"
20
+ :value="addTaskList.map((c) => c.uname).join(', ')"
21
+ :autosize="{ minRows: 1 }"
22
+ @focus="setAddtaskV = true"
23
+ />
19
24
  </el-form-item>
20
25
  </div>
21
26
  </div>
@@ -42,6 +47,9 @@
42
47
  <cl-dialog v-drag :visible.sync="setCarboncopyV" title="设置抄送用户" width="900px" append-to-body top="7.5vh">
43
48
  <carboncopy-prop :carbon-copy-list="carbonCopyList" @close="setCarboncopyV = false" @confirm="setCarboncopyOk" />
44
49
  </cl-dialog>
50
+ <cl-dialog v-drag :visible.sync="setAddtaskV" title="设置抄送用户" width="900px" append-to-body top="7.5vh">
51
+ <carboncopy-prop :carbon-copy-list="addTaskList" @close="setAddtaskV = false" @confirm="setAddtaskOk" />
52
+ </cl-dialog>
45
53
  </div>
46
54
  </template>
47
55
 
@@ -88,7 +96,9 @@ export default {
88
96
  authList: [],
89
97
  showBtn: true,
90
98
  setCarboncopyV: false,
91
- carbonCopyList: []
99
+ carbonCopyList: [],
100
+ setAddtaskV: false,
101
+ addTaskList: []
92
102
  }
93
103
  },
94
104
  computed: {
@@ -156,7 +166,8 @@ export default {
156
166
  formData: JSON.stringify(this.formData),
157
167
  signText: this.signText,
158
168
  isAgentcy: isAgentcy,
159
- carbonCopyUserDtoList: this.carbonCopyList.map((c) => ({ userNo: c.uno, userName: c.uname }))
169
+ carbonCopyUserDtoList: this.carbonCopyList.map((c) => ({ userNo: c.uno, userName: c.uname })),
170
+ addTaskList: this.addTaskList.map((c) => ({ userNo: c.uno, userName: c.uname }))
160
171
  }
161
172
  ]
162
173
  },
@@ -244,6 +255,11 @@ export default {
244
255
  this.carbonCopyList = list
245
256
 
246
257
  this.setCarboncopyV = false
258
+ },
259
+ setAddtaskOk(list) {
260
+ this.addTaskList = list
261
+
262
+ this.setAddtaskV = false
247
263
  }
248
264
  }
249
265
  }
@@ -55,6 +55,68 @@
55
55
  <div v-if="assignee" :class="{ 'm-t-s': assigneeEnd }">{{ assignee }}</div>
56
56
  </div>
57
57
  </el-popover>
58
+ <el-popover ref="addTask-pop" v-model="addTaskV" trigger="manual" placement="bottom">
59
+ <div @click.stop>
60
+ <div class="m-b el-dialog__title">加签流程</div>
61
+ <div class="p-a" style="text-align: center">
62
+ <svg v-if="addTaskList.length" :width="addTaskList.length * 160 - 50" height="82">
63
+ <template v-for="(item, i) in addTaskList">
64
+ <g
65
+ v-if="i > 0"
66
+ :key="i + '-flow'"
67
+ class="djs-element djs-connection activiti-line-achieve"
68
+ :data-element-id="item.addTaskDefId + '-flow'"
69
+ transform="matrix(1 0 0 1 100 1)"
70
+ >
71
+ <path
72
+ d="m0,40L60,40"
73
+ style="fill: none; stroke-width: 1px; stroke: black; stroke-linejoin: round"
74
+ :style="{
75
+ 'marker-end': `url(#${markerId})`
76
+ }"
77
+ />
78
+ </g>
79
+ <g
80
+ :key="i"
81
+ class="djs-element djs-shape activiti-node-achieve"
82
+ :class="{
83
+ 'activiti-node-at': dataPro.currentActivityIdList.includes(item.addTaskDefId)
84
+ }"
85
+ :data-element-id="item.addTaskDefId"
86
+ :transform="`matrix(1 0 0 1 ${1 + i * 160} 1)`"
87
+ @mouseenter="(ev) => addElIn(item.addTaskDefId, ev)"
88
+ @mouseleave="msgV = false"
89
+ >
90
+ <rect
91
+ x="0"
92
+ y="0"
93
+ width="100"
94
+ height="80"
95
+ rx="10"
96
+ ry="10"
97
+ style="stroke: black; stroke-width: 1px; fill: white; fill-opacity: 0.95"
98
+ />
99
+ <text
100
+ lineheight="1.2"
101
+ class="djs-label"
102
+ style="
103
+ font-family: Arial, sans-serif;
104
+ font-size: 12px;
105
+ font-weight: normal;
106
+ text-anchor: middle;
107
+ fill: black;
108
+ "
109
+ >
110
+ <tspan x="50" y="43.6">{{ item.taskName.slice(0, 7) }}</tspan>
111
+ <tspan x="50" y="58">{{ item.taskName.slice(7) }}</tspan>
112
+ </text>
113
+ <use xlink:href="#symbol_node_User" style="fill: rgb(102, 102, 102)" />
114
+ </g>
115
+ </template>
116
+ </svg>
117
+ </div>
118
+ </div>
119
+ </el-popover>
58
120
  </div>
59
121
  </template>
60
122
 
@@ -75,7 +137,6 @@ export default {
75
137
  data() {
76
138
  this.svgW = undefined
77
139
  this.svgC = undefined
78
- this.markerId = ''
79
140
  return {
80
141
  assignee: undefined,
81
142
  assigneeEnd: undefined,
@@ -83,7 +144,10 @@ export default {
83
144
  max: 2,
84
145
  step: 0.1,
85
146
  zoomValue: 1,
86
- msgV: false
147
+ markerId: '',
148
+ msgV: false,
149
+ addTaskV: false,
150
+ addTaskList: []
87
151
  }
88
152
  },
89
153
  watch: {
@@ -94,7 +158,14 @@ export default {
94
158
  async mounted() {
95
159
  this.svgW = this.$refs['activiti-svg-wrap']
96
160
 
97
- let { flowString, seqRecords, taskDefIdMap = {}, currAssMap = {}, currentActivityIdList = [] } = this.dataPro
161
+ let {
162
+ flowString,
163
+ seqRecords,
164
+ taskDefIdMap = {},
165
+ currAssMap = {},
166
+ currentActivityIdList = [],
167
+ addTask = {}
168
+ } = this.dataPro
98
169
  let flowSvg = flowString
99
170
  if (flowString.includes('bpmn2:definitions')) {
100
171
  let { default: bpmn2svg } = await importG('bpmn2svg', () =>
@@ -104,23 +175,40 @@ export default {
104
175
  }
105
176
  this.setSvgAttrs(flowSvg)
106
177
  try {
178
+ for (let k in addTask) {
179
+ let line = this.svgW.querySelector(`[data-element-id="${k}"] path`)
180
+ if (line) {
181
+ this.addNode(k, line, addTask[k])
182
+ }
183
+ }
184
+
107
185
  seqRecords.forEach((obj) => {
108
186
  this.setTaskRecord(obj)
109
187
  })
188
+
110
189
  currentActivityIdList.forEach((currentActivityId) => {
111
190
  let assignee = currAssMap[currentActivityId]
112
191
  let assigneeEnd = taskDefIdMap[currentActivityId]
113
192
  taskDefIdMap[currentActivityId] = undefined
114
193
 
115
- this.addEvent(currentActivityId, { assignee, assigneeEnd }, 'pending')
116
-
117
- this.svgW.querySelector(`[data-element-id="${currentActivityId}"]`).classList.add('activiti-node-at')
194
+ let task = this.svgW.querySelector(`[data-element-id="${currentActivityId}"]`)
195
+ if (task) {
196
+ task.classList.add('activiti-node-at')
197
+ !currentActivityId.includes('@addTaskType') && this.addEvent(task, { assignee, assigneeEnd }, 'pending')
198
+ // this.addEvent(task, { assignee, assigneeEnd }, 'pending')
199
+ }
118
200
  })
119
201
  for (let k in taskDefIdMap) {
120
- taskDefIdMap[k] && this.addEvent(k, taskDefIdMap[k])
202
+ if (taskDefIdMap[k]) {
203
+ let taskK = this.svgW.querySelector(`[data-element-id="${k}"]`)
204
+ if (taskK) {
205
+ !k.includes('@addTaskType') && this.addEvent(taskK, taskDefIdMap[k])
206
+ // this.addEvent(taskK, taskDefIdMap[k])
207
+ }
208
+ }
121
209
  }
122
210
  } catch (error) {
123
- console.log('setTaskErr:', error)
211
+ console.warn('setTaskErr:', error)
124
212
  }
125
213
 
126
214
  let { default: panzoom } = await importG('panzoom', () => import(/*webpackChunkName: "panzoom"*/ 'panzoom'))
@@ -138,15 +226,23 @@ export default {
138
226
  let { scale } = e.getTransform()
139
227
  this.zoomValue = scale
140
228
  })
229
+
230
+ document.body.addEventListener('click', this.addTaskFn)
141
231
  },
142
232
  deactivated() {
143
233
  this.msgV = false
234
+ this.addTaskV = false
144
235
  },
145
236
  beforeDestroy() {
146
237
  this.msgV = false
147
238
  this.svgPanzoom && this.svgPanzoom.dispose()
239
+
240
+ document.body.removeEventListener('click', this.addTaskFn)
148
241
  },
149
242
  methods: {
243
+ addTaskFn() {
244
+ this.addTaskV = false
245
+ },
150
246
  setSvgAttrs(str) {
151
247
  this.svgW.innerHTML = str
152
248
  this.svgC = this.svgW.querySelector('svg')
@@ -219,6 +315,15 @@ export default {
219
315
  left: undefined,
220
316
  top: undefined
221
317
  }
318
+ if (id.includes('@addTaskType')) {
319
+ rect = {
320
+ with: 20,
321
+ height: 20,
322
+ left: Number(g.getAttribute('data-element-left')),
323
+ top: Number(g.getAttribute('data-element-top'))
324
+ }
325
+ return rect
326
+ }
222
327
 
223
328
  if (g.querySelector('circle')) {
224
329
  rect.with = 36
@@ -233,8 +338,72 @@ export default {
233
338
  }
234
339
  return rect
235
340
  },
236
- addEvent(id, list, type) {
237
- let task = this.svgW.querySelector(`[data-element-id="${id}"]`)
341
+ addNode(id, line, list) {
342
+ let D = line.getAttribute('d')
343
+ let Ds = D.replace(/\s+/g, '')
344
+ .split(/[A-z]/)
345
+ .filter((d) => !!d)
346
+
347
+ let centreD
348
+ if (Ds.length === 2) {
349
+ let Ds1 = Ds[0].split(',')
350
+ let Ds2 = Ds[1].split(',')
351
+ centreD = [(Number(Ds1[0]) + Number(Ds2[0])) / 2, (Number(Ds1[1]) + Number(Ds2[1])) / 2]
352
+ } else if (Ds.length > 2) {
353
+ let Ds2 = Ds[1].split(',')
354
+ centreD = [Number(Ds2[0]), Number(Ds2[1])]
355
+ }
356
+ if (centreD) {
357
+ let circleG = document.createElementNS('http://www.w3.org/2000/svg', 'g')
358
+ circleG.classList.add('activiti-node-achieve')
359
+ circleG.setAttribute('data-element-left', centreD[0] - 10)
360
+ circleG.setAttribute('data-element-top', centreD[1] - 10)
361
+
362
+ circleG.setAttribute('data-element-id', list?.[0]?.addTaskDefId || '')
363
+ let cEl = `<circle r="10" cx="${centreD[0]}" cy="${
364
+ centreD[1]
365
+ }" stroke-width="1" stroke="#666" fill="#fff"></circle>
366
+ <line class="add-and" x1="${centreD[0] - 7}" y1="${centreD[1]}" x2="${centreD[0] + 7}" y2="${
367
+ centreD[1]
368
+ }" stroke-width="1" stroke="#666" fill="none"></line>
369
+ <line class="add-and" x1="${centreD[0]}" y1="${centreD[1] - 7}" x2="${centreD[0]}" y2="${
370
+ centreD[1] + 7
371
+ }" stroke-width="1" stroke="#666" fill="none"></line>
372
+ `
373
+ circleG.innerHTML = cEl
374
+ this.svgC.appendChild(circleG)
375
+
376
+ circleG.addEventListener('click', (el) => {
377
+ this.addTaskList = list
378
+ this.$nextTick(() => {
379
+ this.$refs['addTask-pop'].doDestroy()
380
+ this.$refs['addTask-pop'].referenceElm = circleG
381
+ this.addTaskV = true
382
+ })
383
+ el.stopPropagation()
384
+ })
385
+ }
386
+ },
387
+ addElIn(id, ev) {
388
+ if (this.dataPro.currentActivityIdList.some((cId) => cId === id) /*待审批*/) {
389
+ this.assignee = this.dataPro.currAssMap[id]
390
+ this.assigneeEnd = this.dataPro.taskDefIdMap[id]
391
+
392
+ this.$nextTick(() => {
393
+ this.$refs['title-pop'].doDestroy()
394
+ this.$refs['title-pop'].referenceElm = ev.target
395
+ this.msgV = true
396
+ })
397
+ } else if (this.dataPro.taskDefIdMap[id] /*已审批*/) {
398
+ this.assigneeEnd = this.dataPro.taskDefIdMap[id]
399
+ this.$nextTick(() => {
400
+ this.$refs['title-pop'].doDestroy()
401
+ this.$refs['title-pop'].referenceElm = ev.target
402
+ this.msgV = true
403
+ })
404
+ }
405
+ },
406
+ addEvent(task, list, type) {
238
407
  task.addEventListener('mouseenter', () => {
239
408
  if (type === 'pending') {
240
409
  this.assignee = list.assignee
@@ -397,6 +566,7 @@ setRejectLink(from, to) {
397
566
  bottom: 0;
398
567
  }
399
568
 
569
+ .n20-approval-img-por .djs-hit,
400
570
  .n20-approval-img-por .djs-hit-all,
401
571
  .n20-approval-img-por .djs-outline {
402
572
  display: none !important;
@@ -407,6 +577,7 @@ setRejectLink(from, to) {
407
577
  .activiti-node-achieve circle,
408
578
  .activiti-node-achieve rect,
409
579
  .activiti-node-achieve polygon,
580
+ .activiti-node-achieve .add-and,
410
581
  .activiti-line-achieve path {
411
582
  stroke: #3cb495 !important;
412
583
  }
@@ -414,13 +585,15 @@ setRejectLink(from, to) {
414
585
  fill: #3cb495 !important;
415
586
  }
416
587
  .activiti-node-reject circle,
417
- .activiti-node-reject rect {
588
+ .activiti-node-reject rect,
589
+ .activiti-node-reject .add-and {
418
590
  stroke: #ea5454 !important;
419
591
  }
420
592
  .activiti-node-reject use {
421
593
  fill: #ea5454 !important;
422
594
  }
423
- .activiti-node-at rect {
595
+ .activiti-node-at rect,
596
+ .activiti-node-at .add-and {
424
597
  stroke: #fe943c !important;
425
598
  }
426
599
  .activiti-node-at use {
@@ -337,6 +337,9 @@ export default {
337
337
  if (supplier === 'bjca') {
338
338
  // 北京CA
339
339
  window.sessionStorage.setItem('signType', 'bjcaSign')
340
+ } else if (supplier === 'Itrus') {
341
+ // 天威CA
342
+ window.sessionStorage.setItem('signType', 'ItrusSign')
340
343
  } else {
341
344
  // 信安CA
342
345
  window.sessionStorage.setItem('signType', 'inetSign')