@lambo-design/workflow-approve 1.0.0-beta.52 → 1.0.0-beta.54
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.
|
@@ -287,108 +287,119 @@ export default {
|
|
|
287
287
|
},
|
|
288
288
|
methods: {
|
|
289
289
|
getOrgan(row) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
organList.
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
290
|
+
if (row.organs){
|
|
291
|
+
let self = this
|
|
292
|
+
self.organModel = []
|
|
293
|
+
let organs = row.organs
|
|
294
|
+
let organList = organs.split(",")
|
|
295
|
+
if (organs && organList.length > 0) {
|
|
296
|
+
organList.forEach(item => {
|
|
297
|
+
let organ = {
|
|
298
|
+
code: item.split(':')[0],
|
|
299
|
+
name: item.split(':')[1],
|
|
300
|
+
}
|
|
301
|
+
self.treeValueBM.push(organ)
|
|
302
|
+
self.orgList.push(organ)
|
|
303
|
+
self.organModel.push(item + ',1')
|
|
304
|
+
self.userNum = "1"
|
|
305
|
+
self.updateLength()
|
|
306
|
+
})
|
|
307
|
+
}
|
|
306
308
|
}
|
|
307
309
|
},
|
|
308
310
|
getUser(row) {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
userList.
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
311
|
+
if (row.users){
|
|
312
|
+
let self = this
|
|
313
|
+
self.selectedKeys = []
|
|
314
|
+
self.treeUserValue = []
|
|
315
|
+
self.treeUserNameCenterValue = []
|
|
316
|
+
let users = row.users
|
|
317
|
+
let userList = users.split(",")
|
|
318
|
+
if (users && userList.length > 0) {
|
|
319
|
+
userList.forEach(item => {
|
|
320
|
+
let userId = item.split(':')[0]
|
|
321
|
+
let userName = item.split(':')[1]
|
|
322
|
+
let user = {
|
|
323
|
+
userId: userId,
|
|
324
|
+
userName: userName,
|
|
325
|
+
}
|
|
326
|
+
let userStr = userId + "," + userName
|
|
327
|
+
self.treeUserValue.push(userStr)
|
|
328
|
+
self.treeUserNameCenterValue.push(user)
|
|
329
|
+
self.selectedKeys.push(userStr)
|
|
330
|
+
self.organModel.push(item + ",2")
|
|
331
|
+
self.userNum = "1"
|
|
332
|
+
self.updateLength()
|
|
333
|
+
})
|
|
334
|
+
}
|
|
331
335
|
}
|
|
332
336
|
},
|
|
333
337
|
getRole(row) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
roleList.
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
338
|
+
if (row.roles){
|
|
339
|
+
let self = this
|
|
340
|
+
self.noticeRoleList = []
|
|
341
|
+
self.noticeList = []
|
|
342
|
+
self.noticeRoleNameList = []
|
|
343
|
+
let roles = row.roles
|
|
344
|
+
let roleList = roles.split(",")
|
|
345
|
+
if (roles && roleList.length > 0) {
|
|
346
|
+
roleList.forEach(item => {
|
|
347
|
+
let roleId = item.split(':')[0]
|
|
348
|
+
let roleName = item.split(':')[1]
|
|
349
|
+
self.noticeRoleNameList.push(roleName)
|
|
350
|
+
self.organModel.push(item + ',3')
|
|
351
|
+
let roles = roleId + "," + roleName
|
|
352
|
+
self.noticeRoleList.push(roles)
|
|
353
|
+
self.noticeList.push(roles)
|
|
354
|
+
self.updateLength()
|
|
355
|
+
})
|
|
356
|
+
}
|
|
351
357
|
}
|
|
352
358
|
},
|
|
353
359
|
getPost(row) {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
positionList.
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
360
|
+
if (row.posts){
|
|
361
|
+
let self = this
|
|
362
|
+
self.treePostValue = []
|
|
363
|
+
self.postKeys = []
|
|
364
|
+
self.treePostNameCenterValue = []
|
|
365
|
+
let positions = row.positions
|
|
366
|
+
let positionList = positions.split(",")
|
|
367
|
+
if (positions && positionList.length > 0) {
|
|
368
|
+
positionList.forEach(item => {
|
|
369
|
+
let positionId = item.split(':')[0]
|
|
370
|
+
let positionName = item.split(':')[1]
|
|
371
|
+
let position = {
|
|
372
|
+
positionId: positionId,
|
|
373
|
+
positionName: positionName,
|
|
374
|
+
}
|
|
375
|
+
let post = positionId + "," + positionName
|
|
376
|
+
self.treePostValue.push(post)
|
|
377
|
+
self.postKeys.push(post)
|
|
378
|
+
// resp.data.data.code = resp.data.data.orgCode
|
|
379
|
+
// self.treePostNameCenterValue.push(resp.data.data)
|
|
380
|
+
self.treePostNameCenterValue.push(position)
|
|
381
|
+
self.organModel.push(item + ',4')
|
|
382
|
+
self.updateLength()
|
|
383
|
+
})
|
|
384
|
+
}
|
|
377
385
|
}
|
|
386
|
+
|
|
378
387
|
},
|
|
379
388
|
getOrgType(row) {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
typeList.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
389
|
+
if (row.types){
|
|
390
|
+
let self = this
|
|
391
|
+
let types = row.types
|
|
392
|
+
let typeList = types.split(",")
|
|
393
|
+
if (types && typeList.length > 0) {
|
|
394
|
+
typeList.forEach(item => {
|
|
395
|
+
let type = {
|
|
396
|
+
bizTypeCode: item.split(':')[0],
|
|
397
|
+
typeName: item.split(':')[1],
|
|
398
|
+
}
|
|
399
|
+
self.treeOrgTypeValue.push(type)
|
|
400
|
+
self.updateLength()
|
|
401
|
+
})
|
|
402
|
+
}
|
|
392
403
|
}
|
|
393
404
|
},
|
|
394
405
|
|
|
@@ -512,25 +523,15 @@ export default {
|
|
|
512
523
|
|
|
513
524
|
Promise.all(requests)
|
|
514
525
|
.then(results => {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
com: data.organId,
|
|
525
|
-
code: data.organCode,
|
|
526
|
-
loading: false,
|
|
527
|
-
checked: false,
|
|
528
|
-
children: [],
|
|
529
|
-
hasChild: true,
|
|
530
|
-
};
|
|
531
|
-
childsTree.push(obj);
|
|
532
|
-
}
|
|
533
|
-
});
|
|
526
|
+
let tree
|
|
527
|
+
if (self.ucAdapterType === 'x1'){
|
|
528
|
+
tree = self.x1OrganTree(results)
|
|
529
|
+
} else {
|
|
530
|
+
tree = self.scOrganTree(results)
|
|
531
|
+
}
|
|
532
|
+
for (let value of tree) {
|
|
533
|
+
self.formatOrganTree(value, childsTree, organTreeType)
|
|
534
|
+
}
|
|
534
535
|
organTree.push(childsTree);
|
|
535
536
|
const codesSeen = new Map();
|
|
536
537
|
organTree = organTree.reduce((acc, item, index) => {
|
|
@@ -550,6 +551,133 @@ export default {
|
|
|
550
551
|
}
|
|
551
552
|
});
|
|
552
553
|
},
|
|
554
|
+
x1OrganTree(results){
|
|
555
|
+
const nodeMap = new Map();
|
|
556
|
+
results.forEach(item => {
|
|
557
|
+
const organCode = item.organCode
|
|
558
|
+
const organStruPath = item.organStruPath
|
|
559
|
+
const parts = organStruPath.split('#').filter(p => p);
|
|
560
|
+
let currentNode = nodeMap.get(organCode) || { organCode, organStruPath, item, children: []};
|
|
561
|
+
currentNode.parts = parts;
|
|
562
|
+
nodeMap.set(organCode, currentNode);
|
|
563
|
+
});
|
|
564
|
+
nodeMap.forEach(node => {
|
|
565
|
+
const { organCode, parts } = node;
|
|
566
|
+
let parentCode = null;
|
|
567
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
568
|
+
parentCode = parts[i];
|
|
569
|
+
const parentNode = nodeMap.get(parentCode);
|
|
570
|
+
|
|
571
|
+
if (parentNode) {
|
|
572
|
+
if (parentNode.organId === node.item.parentId && !parentNode.children.some(child => child.organCode === organCode)) {
|
|
573
|
+
parentNode.children.push(node);
|
|
574
|
+
} else {
|
|
575
|
+
// 如果直接父节点不在流程类型范围内但祖宗节点在
|
|
576
|
+
let children = parentNode.children;
|
|
577
|
+
for (let j = i + 1; j < parts.length - 1; j++) {
|
|
578
|
+
const partCode = parts[j];
|
|
579
|
+
let existingChild = children.find(child => child.organCode === partCode);
|
|
580
|
+
|
|
581
|
+
if (!existingChild) {
|
|
582
|
+
existingChild = { organCode: partCode, children: [] };
|
|
583
|
+
children.push(existingChild);
|
|
584
|
+
}
|
|
585
|
+
children = existingChild.children;
|
|
586
|
+
}
|
|
587
|
+
// 将当前节点添加到最后一个子节点的 children 中
|
|
588
|
+
children.push(node);
|
|
589
|
+
}
|
|
590
|
+
nodeMap.delete(organCode);
|
|
591
|
+
break;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
});
|
|
596
|
+
return nodeMap.values()
|
|
597
|
+
},
|
|
598
|
+
scOrganTree(results){
|
|
599
|
+
const nodeMap = new Map();
|
|
600
|
+
results.forEach(item => {
|
|
601
|
+
const organId = item.organId
|
|
602
|
+
const parentId = item.parentId
|
|
603
|
+
let currentNode = nodeMap.get(organId) || { organId, parentId, item, children: []};
|
|
604
|
+
nodeMap.set(organId, currentNode);
|
|
605
|
+
});
|
|
606
|
+
const tree = [];
|
|
607
|
+
nodeMap.forEach((node, organId) => {
|
|
608
|
+
const parentId = node.parentId;
|
|
609
|
+
|
|
610
|
+
// 如果有父节点,则将当前节点添加到父节点的 children 数组中
|
|
611
|
+
if (parentId && nodeMap.has(parentId)) {
|
|
612
|
+
const parentNode = nodeMap.get(parentId);
|
|
613
|
+
parentNode.children.push(node);
|
|
614
|
+
} else {
|
|
615
|
+
tree.push(node);
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
return tree
|
|
619
|
+
},
|
|
620
|
+
formatOrganTree(nodeMap, childsTree, organTreeType){
|
|
621
|
+
const self = this
|
|
622
|
+
let obj = {}
|
|
623
|
+
if (nodeMap.item){
|
|
624
|
+
obj = {
|
|
625
|
+
type: nodeMap.item.organType,
|
|
626
|
+
id: nodeMap.item.id,
|
|
627
|
+
organId: nodeMap.item.organId,
|
|
628
|
+
orders: nodeMap.item.orders,
|
|
629
|
+
title: nodeMap.item.organName,
|
|
630
|
+
name: nodeMap.item.organName,
|
|
631
|
+
com: nodeMap.item.organId,
|
|
632
|
+
code: nodeMap.item.organCode,
|
|
633
|
+
loading: false,
|
|
634
|
+
checked: false,
|
|
635
|
+
hasChild: true,
|
|
636
|
+
children: [],
|
|
637
|
+
};
|
|
638
|
+
if (nodeMap.children && nodeMap.children.length > 0){
|
|
639
|
+
for (let child of nodeMap.children){
|
|
640
|
+
self.formatOrganTree(child, obj.children, organTreeType)
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
childsTree.push(obj);
|
|
644
|
+
} else {
|
|
645
|
+
let params = {
|
|
646
|
+
orgTreeType: organTreeType,
|
|
647
|
+
}
|
|
648
|
+
ajax.get(self.smartFlowServerContext + '/manage/organ/get/' + nodeMap.organCode, { params: params })
|
|
649
|
+
.then(resp => {
|
|
650
|
+
if (resp.data.code === 200) {
|
|
651
|
+
let data = resp.data.data
|
|
652
|
+
obj = {
|
|
653
|
+
type: data.organType,
|
|
654
|
+
id: data.id,
|
|
655
|
+
organId: data.organId,
|
|
656
|
+
orders: data.orders,
|
|
657
|
+
title: data.organName,
|
|
658
|
+
name: data.organName,
|
|
659
|
+
com: data.organId,
|
|
660
|
+
code: data.organCode,
|
|
661
|
+
loading: false,
|
|
662
|
+
disabled: true,
|
|
663
|
+
checked: false,
|
|
664
|
+
hasChild: true,
|
|
665
|
+
children: [],
|
|
666
|
+
}
|
|
667
|
+
if (nodeMap.children && nodeMap.children.length > 0){
|
|
668
|
+
for (let child of nodeMap.children){
|
|
669
|
+
self.formatOrganTree(child, obj.children, organTreeType)
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
childsTree.push(obj);
|
|
673
|
+
}
|
|
674
|
+
})
|
|
675
|
+
.catch(err => {
|
|
676
|
+
console.error(err);
|
|
677
|
+
return [];
|
|
678
|
+
})
|
|
679
|
+
}
|
|
680
|
+
},
|
|
553
681
|
//获取人员树信息
|
|
554
682
|
async getReadingRange(row, organTreeType) {
|
|
555
683
|
let self = this
|
|
@@ -1766,7 +1894,7 @@ export default {
|
|
|
1766
1894
|
this.permScope = permScope
|
|
1767
1895
|
this.organTreeType = organTreeType
|
|
1768
1896
|
this.organTreeRedis(this.permScope)
|
|
1769
|
-
if (inputValue){
|
|
1897
|
+
if (inputValue) {
|
|
1770
1898
|
this.getOrgan(inputValue)
|
|
1771
1899
|
this.getUser(inputValue)
|
|
1772
1900
|
this.getRole(inputValue)
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div style="min-height: 300px;">
|
|
3
|
-
<div v-if="organTree.userMap && Object.keys(organTree.userMap).length > 0"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
<div v-if="organTree.userMap && Object.keys(organTree.userMap).length > 0" class="searchable-select-wrapper">
|
|
4
|
+
<Select v-model="countersignersTagsData"
|
|
5
|
+
filterable multiple
|
|
6
|
+
@on-change="organChange($event)"
|
|
7
|
+
class="custom-select"
|
|
8
|
+
>
|
|
9
|
+
<Option v-for="(value, key) in organTree.userMap" :key="key" :value="`${key},${value.split('(')[0]}`"
|
|
10
|
+
:label="value.split('(')[0]">
|
|
11
|
+
<span>{{ value }}</span>
|
|
12
|
+
</Option>
|
|
13
|
+
</Select>
|
|
14
|
+
<Icon type="ios-search" class="search-icon"/>
|
|
14
15
|
</div>
|
|
15
16
|
<Tag v-else v-for="(item, index) in countersignersTagsData" :key="item.id" closable
|
|
16
17
|
@on-close="closeTags(index, item)"
|
|
@@ -161,23 +162,25 @@ export default {
|
|
|
161
162
|
methods: {
|
|
162
163
|
//把已选择的数据放入到已选列表中展示
|
|
163
164
|
getUser(row) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
userList.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
self.countersignersTagsData.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
165
|
+
if (row.users) {
|
|
166
|
+
let self = this
|
|
167
|
+
self.selectedKeys = []
|
|
168
|
+
self.treeUserValue = []
|
|
169
|
+
let users = row.users
|
|
170
|
+
let userList = users.split(',')
|
|
171
|
+
if (users && userList.length > 0) {
|
|
172
|
+
userList.forEach(item => {
|
|
173
|
+
let [userId, userName] = item.split(':')
|
|
174
|
+
let userStr = `${userId},${userName}`
|
|
175
|
+
self.selectedData.push(userStr)
|
|
176
|
+
self.treeUserValue.push(userStr)
|
|
177
|
+
self.selectedKeys.push(userStr)
|
|
178
|
+
if (!self.countersignersTagsData.includes(userStr)) {
|
|
179
|
+
self.countersignersTagsData.push(userStr)
|
|
180
|
+
}
|
|
181
|
+
self.userNum = '1'
|
|
182
|
+
})
|
|
183
|
+
}
|
|
181
184
|
}
|
|
182
185
|
},
|
|
183
186
|
|
|
@@ -593,7 +596,6 @@ export default {
|
|
|
593
596
|
organIds.push(item.organId)
|
|
594
597
|
})
|
|
595
598
|
}
|
|
596
|
-
|
|
597
599
|
ajax.get(this.smartFlowServerContext + '/manage/user/getAllUsersInfo', {
|
|
598
600
|
params: {
|
|
599
601
|
organIds: organIds.join(','),
|
|
@@ -836,6 +838,7 @@ export default {
|
|
|
836
838
|
/deep/ .custom-select .ivu-select-arrow {
|
|
837
839
|
display: none;
|
|
838
840
|
}
|
|
841
|
+
|
|
839
842
|
.searchable-select-wrapper {
|
|
840
843
|
position: relative;
|
|
841
844
|
display: inline-block;
|