n20-common-lib 2.5.0-beta.5 → 2.5.0-beta.6

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": "2.5.0-beta.5",
3
+ "version": "2.5.0-beta.6",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -53,6 +53,12 @@
53
53
  </table>
54
54
  </div>
55
55
  <div v-if="assignee" :class="{ 'm-t-s': assigneeEnd }">{{ assignee }}</div>
56
+
57
+ <div v-if="taskCandidate" class="m-t-ss m-b-ss">
58
+ <div v-if="taskCandidate.cltNames.length">待审批单位:{{ taskCandidate.cltNames.join('、') }}</div>
59
+ <div v-if="taskCandidate.roleNames.length">待审批角色:{{ taskCandidate.roleNames.join('、') }}</div>
60
+ <div v-if="taskCandidate.unames.length">待审批人:{{ taskCandidate.unames.join('、') }}</div>
61
+ </div>
56
62
  </div>
57
63
  </el-popover>
58
64
  <el-popover ref="addTask-pop" v-model="addTaskV" trigger="manual" placement="bottom">
@@ -145,6 +151,7 @@ export default {
145
151
  return {
146
152
  assignee: undefined,
147
153
  assigneeEnd: undefined,
154
+ taskCandidate: undefined,
148
155
  min: 0.4,
149
156
  max: 2,
150
157
  step: 0.1,
@@ -162,7 +169,6 @@ export default {
162
169
  },
163
170
  async mounted() {
164
171
  this.svgW = this.$refs['activiti-svg-wrap']
165
-
166
172
  let {
167
173
  flowString,
168
174
  seqRecords,
@@ -170,7 +176,8 @@ export default {
170
176
  currAssMap = {},
171
177
  currentActivityIdList = [],
172
178
  addTask = {},
173
- addTaskPre = {}
179
+ addTaskPre = {},
180
+ unApplayUserTaskCandidate = {}
174
181
  } = this.dataPro
175
182
  let flowSvg = flowString
176
183
  if (flowString.includes('bpmn2:definitions')) {
@@ -180,6 +187,7 @@ export default {
180
187
  flowSvg = await bpmn2svg(flowString)
181
188
  }
182
189
  this.setSvgAttrs(flowSvg)
190
+ this.setPendingUserInfo(unApplayUserTaskCandidate)
183
191
  try {
184
192
  for (let k in addTask) {
185
193
  let line = this.svgW.querySelector(`[data-element-id="${k}"] path`)
@@ -242,6 +250,7 @@ export default {
242
250
 
243
251
  document.body.addEventListener('click', this.addTaskFn)
244
252
  },
253
+
245
254
  deactivated() {
246
255
  this.msgV = false
247
256
  this.addTaskV = false
@@ -249,13 +258,21 @@ export default {
249
258
  beforeDestroy() {
250
259
  this.msgV = false
251
260
  this.svgPanzoom && this.svgPanzoom.dispose()
252
-
253
261
  document.body.removeEventListener('click', this.addTaskFn)
254
262
  },
255
263
  methods: {
256
264
  addTaskFn() {
257
265
  this.addTaskV = false
258
266
  },
267
+ setPendingUserInfo(data) {
268
+ Object.keys(data).forEach((id) => {
269
+ let task = this.svgW.querySelector(`[data-element-id="${id}"]`)
270
+ if (task) {
271
+ console.log('setPendingUserInfo:', data[id])
272
+ this.addEvent(task, { taskCandidate: data[id] }, 'unApply')
273
+ }
274
+ })
275
+ },
259
276
  setSvgAttrs(str) {
260
277
  this.svgW.innerHTML = str
261
278
  this.svgC = this.svgW.querySelector('svg')
@@ -520,6 +537,11 @@ export default {
520
537
  if (type === 'pending') {
521
538
  this.assignee = list.assignee
522
539
  this.assigneeEnd = list.assigneeEnd
540
+ this.taskCandidate = undefined
541
+ } else if (type === 'unApply') {
542
+ this.assignee = undefined
543
+ this.assigneeEnd = undefined
544
+ this.taskCandidate = list.taskCandidate
523
545
  } else {
524
546
  this.assignee = undefined
525
547
  this.assigneeEnd = list
@@ -39,7 +39,15 @@
39
39
  v-bind="$attrs"
40
40
  @node-click="nodeClick"
41
41
  @check="checkChange"
42
- />
42
+ >
43
+ <div
44
+ slot-scope="{ node, data }"
45
+ :class="data[props.disabled] ? 'cursor-not' : ''"
46
+ :style="{ color: data[props.disabled] ? 'var(--color-text-placeholder) ' : '' }"
47
+ >
48
+ {{ data[props.label] }}
49
+ </div></el-tree
50
+ >
43
51
  </el-select>
44
52
  </template>
45
53
 
@@ -204,7 +212,7 @@ export default {
204
212
  this.filterMethod && this.filterMethod(val)
205
213
  },
206
214
  nodeClick(data) {
207
- if (!this.multiple) {
215
+ if (!this.multiple && !data.disabled) {
208
216
  this.lazy && (this.tCdList = [data])
209
217
 
210
218
  let vK = this.props.value
@@ -47,6 +47,7 @@
47
47
  v-else-if="
48
48
  showCheckbox &&
49
49
  !node.checked &&
50
+ !node.disabled &&
50
51
  node.data[nodeKey] === (checkFlag && checkFlag.data && checkFlag.data[nodeKey])
51
52
  "
52
53
  type="text"