@lambo-design/workflow-approve 1.0.0-beta.51 → 1.0.0-beta.53
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.
|
@@ -512,25 +512,15 @@ export default {
|
|
|
512
512
|
|
|
513
513
|
Promise.all(requests)
|
|
514
514
|
.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
|
-
});
|
|
515
|
+
let tree
|
|
516
|
+
if (self.ucAdapterType === 'x1'){
|
|
517
|
+
tree = self.x1OrganTree(results)
|
|
518
|
+
} else {
|
|
519
|
+
tree = self.scOrganTree(results)
|
|
520
|
+
}
|
|
521
|
+
for (let value of tree) {
|
|
522
|
+
self.formatOrganTree(value, childsTree, organTreeType)
|
|
523
|
+
}
|
|
534
524
|
organTree.push(childsTree);
|
|
535
525
|
const codesSeen = new Map();
|
|
536
526
|
organTree = organTree.reduce((acc, item, index) => {
|
|
@@ -550,6 +540,133 @@ export default {
|
|
|
550
540
|
}
|
|
551
541
|
});
|
|
552
542
|
},
|
|
543
|
+
x1OrganTree(results){
|
|
544
|
+
const nodeMap = new Map();
|
|
545
|
+
results.forEach(item => {
|
|
546
|
+
const organCode = item.organCode
|
|
547
|
+
const organStruPath = item.organStruPath
|
|
548
|
+
const parts = organStruPath.split('#').filter(p => p);
|
|
549
|
+
let currentNode = nodeMap.get(organCode) || { organCode, organStruPath, item, children: []};
|
|
550
|
+
currentNode.parts = parts;
|
|
551
|
+
nodeMap.set(organCode, currentNode);
|
|
552
|
+
});
|
|
553
|
+
nodeMap.forEach(node => {
|
|
554
|
+
const { organCode, parts } = node;
|
|
555
|
+
let parentCode = null;
|
|
556
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
557
|
+
parentCode = parts[i];
|
|
558
|
+
const parentNode = nodeMap.get(parentCode);
|
|
559
|
+
|
|
560
|
+
if (parentNode) {
|
|
561
|
+
if (parentNode.organId === node.item.parentId && !parentNode.children.some(child => child.organCode === organCode)) {
|
|
562
|
+
parentNode.children.push(node);
|
|
563
|
+
} else {
|
|
564
|
+
// 如果直接父节点不在流程类型范围内但祖宗节点在
|
|
565
|
+
let children = parentNode.children;
|
|
566
|
+
for (let j = i + 1; j < parts.length - 1; j++) {
|
|
567
|
+
const partCode = parts[j];
|
|
568
|
+
let existingChild = children.find(child => child.organCode === partCode);
|
|
569
|
+
|
|
570
|
+
if (!existingChild) {
|
|
571
|
+
existingChild = { organCode: partCode, children: [] };
|
|
572
|
+
children.push(existingChild);
|
|
573
|
+
}
|
|
574
|
+
children = existingChild.children;
|
|
575
|
+
}
|
|
576
|
+
// 将当前节点添加到最后一个子节点的 children 中
|
|
577
|
+
children.push(node);
|
|
578
|
+
}
|
|
579
|
+
nodeMap.delete(organCode);
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
});
|
|
585
|
+
return nodeMap.values()
|
|
586
|
+
},
|
|
587
|
+
scOrganTree(results){
|
|
588
|
+
const nodeMap = new Map();
|
|
589
|
+
results.forEach(item => {
|
|
590
|
+
const organId = item.organId
|
|
591
|
+
const parentId = item.parentId
|
|
592
|
+
let currentNode = nodeMap.get(organId) || { organId, parentId, item, children: []};
|
|
593
|
+
nodeMap.set(organId, currentNode);
|
|
594
|
+
});
|
|
595
|
+
const tree = [];
|
|
596
|
+
nodeMap.forEach((node, organId) => {
|
|
597
|
+
const parentId = node.parentId;
|
|
598
|
+
|
|
599
|
+
// 如果有父节点,则将当前节点添加到父节点的 children 数组中
|
|
600
|
+
if (parentId && nodeMap.has(parentId)) {
|
|
601
|
+
const parentNode = nodeMap.get(parentId);
|
|
602
|
+
parentNode.children.push(node);
|
|
603
|
+
} else {
|
|
604
|
+
tree.push(node);
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
return tree
|
|
608
|
+
},
|
|
609
|
+
formatOrganTree(nodeMap, childsTree, organTreeType){
|
|
610
|
+
const self = this
|
|
611
|
+
let obj = {}
|
|
612
|
+
if (nodeMap.item){
|
|
613
|
+
obj = {
|
|
614
|
+
type: nodeMap.item.organType,
|
|
615
|
+
id: nodeMap.item.id,
|
|
616
|
+
organId: nodeMap.item.organId,
|
|
617
|
+
orders: nodeMap.item.orders,
|
|
618
|
+
title: nodeMap.item.organName,
|
|
619
|
+
name: nodeMap.item.organName,
|
|
620
|
+
com: nodeMap.item.organId,
|
|
621
|
+
code: nodeMap.item.organCode,
|
|
622
|
+
loading: false,
|
|
623
|
+
checked: false,
|
|
624
|
+
hasChild: true,
|
|
625
|
+
children: [],
|
|
626
|
+
};
|
|
627
|
+
if (nodeMap.children && nodeMap.children.length > 0){
|
|
628
|
+
for (let child of nodeMap.children){
|
|
629
|
+
self.formatOrganTree(child, obj.children, organTreeType)
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
childsTree.push(obj);
|
|
633
|
+
} else {
|
|
634
|
+
let params = {
|
|
635
|
+
orgTreeType: organTreeType,
|
|
636
|
+
}
|
|
637
|
+
ajax.get(self.smartFlowServerContext + '/manage/organ/get/' + nodeMap.organCode, { params: params })
|
|
638
|
+
.then(resp => {
|
|
639
|
+
if (resp.data.code === 200) {
|
|
640
|
+
let data = resp.data.data
|
|
641
|
+
obj = {
|
|
642
|
+
type: data.organType,
|
|
643
|
+
id: data.id,
|
|
644
|
+
organId: data.organId,
|
|
645
|
+
orders: data.orders,
|
|
646
|
+
title: data.organName,
|
|
647
|
+
name: data.organName,
|
|
648
|
+
com: data.organId,
|
|
649
|
+
code: data.organCode,
|
|
650
|
+
loading: false,
|
|
651
|
+
disabled: true,
|
|
652
|
+
checked: false,
|
|
653
|
+
hasChild: true,
|
|
654
|
+
children: [],
|
|
655
|
+
}
|
|
656
|
+
if (nodeMap.children && nodeMap.children.length > 0){
|
|
657
|
+
for (let child of nodeMap.children){
|
|
658
|
+
self.formatOrganTree(child, obj.children, organTreeType)
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
childsTree.push(obj);
|
|
662
|
+
}
|
|
663
|
+
})
|
|
664
|
+
.catch(err => {
|
|
665
|
+
console.error(err);
|
|
666
|
+
return [];
|
|
667
|
+
})
|
|
668
|
+
}
|
|
669
|
+
},
|
|
553
670
|
//获取人员树信息
|
|
554
671
|
async getReadingRange(row, organTreeType) {
|
|
555
672
|
let self = this
|
|
@@ -1766,7 +1883,7 @@ export default {
|
|
|
1766
1883
|
this.permScope = permScope
|
|
1767
1884
|
this.organTreeType = organTreeType
|
|
1768
1885
|
this.organTreeRedis(this.permScope)
|
|
1769
|
-
if (inputValue){
|
|
1886
|
+
if (inputValue && inputValue.length > 0){
|
|
1770
1887
|
this.getOrgan(inputValue)
|
|
1771
1888
|
this.getUser(inputValue)
|
|
1772
1889
|
this.getRole(inputValue)
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div style="min-height: 300px;">
|
|
3
|
-
<
|
|
3
|
+
<div v-if="organTree.userMap && Object.keys(organTree.userMap).length > 0" class="searchable-select-wrapper">
|
|
4
|
+
<Select v-model="countersignersTagsData"
|
|
4
5
|
filterable multiple
|
|
5
6
|
@on-change="organChange($event)"
|
|
6
7
|
class="custom-select"
|
|
7
|
-
|
|
8
|
-
<Option v-for="(value, key) in organTree.userMap" :key="key" :value="`${key},${value}`" :label="value">
|
|
8
|
+
>
|
|
9
|
+
<Option v-for="(value, key) in organTree.userMap" :key="key" :value="`${key},${value.split('(')[0]}`" :label="value.split('(')[0]">
|
|
9
10
|
<span>{{ value }}</span>
|
|
10
11
|
</Option>
|
|
11
12
|
</Select>
|
|
12
|
-
|
|
13
|
+
<Icon type="ios-search" class="search-icon" />
|
|
14
|
+
</div>
|
|
15
|
+
<Tag v-else v-for="(item, index) in countersignersTagsData" :key="item.id" closable
|
|
16
|
+
@on-close="closeTags(index, item)"
|
|
13
17
|
size="large">
|
|
14
18
|
{{ item.split(',')[1] }}
|
|
15
19
|
</Tag>
|
|
20
|
+
|
|
16
21
|
<div class="cont">
|
|
17
22
|
<div
|
|
18
23
|
class="contLeftTwo">
|
|
@@ -658,7 +663,7 @@ export default {
|
|
|
658
663
|
this.permScope = permScope
|
|
659
664
|
this.organTreeType = organTreeType
|
|
660
665
|
// this.organTreeRedis(this.permScope)
|
|
661
|
-
if (inputValue) {
|
|
666
|
+
if (inputValue && inputValue.length > 0) {
|
|
662
667
|
//加入已选择的数据
|
|
663
668
|
this.getUser(inputValue)
|
|
664
669
|
}
|
|
@@ -684,7 +689,6 @@ export default {
|
|
|
684
689
|
watch: {
|
|
685
690
|
countersignersTagsData: {
|
|
686
691
|
handler(newVal, oldVal) {
|
|
687
|
-
console.log('countersignersTagsData', newVal)
|
|
688
692
|
let organ = []
|
|
689
693
|
let names = []
|
|
690
694
|
let organs = []
|
|
@@ -794,6 +798,10 @@ export default {
|
|
|
794
798
|
width: 136px;
|
|
795
799
|
}
|
|
796
800
|
|
|
801
|
+
/deep/ .custom-select {
|
|
802
|
+
width: 100% !important;
|
|
803
|
+
}
|
|
804
|
+
|
|
797
805
|
/deep/ .custom-select .ivu-select {
|
|
798
806
|
height: 80px; /* 控制总体高度 */
|
|
799
807
|
min-height: 80px;
|
|
@@ -806,6 +814,7 @@ export default {
|
|
|
806
814
|
line-height: normal !important;
|
|
807
815
|
padding: 0 !important;
|
|
808
816
|
margin-top: 0 !important;
|
|
817
|
+
|
|
809
818
|
}
|
|
810
819
|
|
|
811
820
|
/deep/ .custom-select .ivu-select-selection {
|
|
@@ -827,4 +836,20 @@ export default {
|
|
|
827
836
|
/deep/ .custom-select .ivu-select-arrow {
|
|
828
837
|
display: none;
|
|
829
838
|
}
|
|
839
|
+
.searchable-select-wrapper {
|
|
840
|
+
position: relative;
|
|
841
|
+
display: inline-block;
|
|
842
|
+
width: 100%;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
.search-icon {
|
|
846
|
+
position: absolute;
|
|
847
|
+
top: 50%;
|
|
848
|
+
right: 10px;
|
|
849
|
+
zoom: 120%;
|
|
850
|
+
transform: translateY(100%);
|
|
851
|
+
color: #999; /* 根据需要调整图标颜色 */
|
|
852
|
+
pointer-events: none; /* 确保点击图标不会影响选择操作 */
|
|
853
|
+
}
|
|
854
|
+
|
|
830
855
|
</style>
|