t20-common-lib 0.12.21 → 0.12.22
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 +1 -1
- package/packages/select-tree-unit/src/main.vue +9 -57
- package/packages/select-tree-unit/src/selectTree/Tree/index.vue +4 -4
- package/packages/select-tree-unit-form/src/main.vue +8 -9
- package/packages/select-tree-unit-form/src/selectTreeForm/Tree/index.vue +7 -7
- package/src/common/Filters/index.vue +0 -1
- package/src/i18n.json +30 -0
package/package.json
CHANGED
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
<el-input
|
|
28
28
|
v-model="searchKey"
|
|
29
29
|
:validate-event="false"
|
|
30
|
-
:placeholder="$t('common_a_0004')"
|
|
31
30
|
clearable
|
|
32
31
|
@input="debounce(searchTree, 1000)"
|
|
33
32
|
class="input-w nstc-unit-search"
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
<button
|
|
39
38
|
type="button"
|
|
40
39
|
@click="changeType('tree')"
|
|
41
|
-
v-title="$
|
|
40
|
+
v-title="$lc('树结构')"
|
|
42
41
|
:class="
|
|
43
42
|
isList ? 'el-button--default is-plain' : 'el-button--primary'
|
|
44
43
|
"
|
|
@@ -51,7 +50,6 @@
|
|
|
51
50
|
<button
|
|
52
51
|
type="button"
|
|
53
52
|
@click="changeType('list')"
|
|
54
|
-
v-title="$t('common_a_0010')"
|
|
55
53
|
:class="
|
|
56
54
|
isList ? 'el-button--primary' : 'el-button--default is-plain'
|
|
57
55
|
"
|
|
@@ -62,28 +60,6 @@
|
|
|
62
60
|
<i class="iconfont icon-liebiao"></i>
|
|
63
61
|
</button>
|
|
64
62
|
</div>
|
|
65
|
-
<!-- <div class="nstc-select-icon-box nstc-select-icon-box-fix">
|
|
66
|
-
<div class="nstc-select-icon-box">
|
|
67
|
-
<span
|
|
68
|
-
@click="changeType('tree')"
|
|
69
|
-
v-title="$t('common_a_0009')"
|
|
70
|
-
:class="isList ? 'nstc-select-icon-un' : ''"
|
|
71
|
-
class="nstc-select-icon"
|
|
72
|
-
>
|
|
73
|
-
<i class="iconfont icon-goujianshu"></i>
|
|
74
|
-
</span>
|
|
75
|
-
</div>
|
|
76
|
-
<div class="nstc-select-icon-box">
|
|
77
|
-
<span
|
|
78
|
-
@click="changeType('list')"
|
|
79
|
-
v-title="$t('common_a_0010')"
|
|
80
|
-
:class="isList ? '' : 'nstc-select-icon-un'"
|
|
81
|
-
class="nstc-select-icon"
|
|
82
|
-
>
|
|
83
|
-
<i class="iconfont icon-liebiao"></i>
|
|
84
|
-
</span>
|
|
85
|
-
</div>
|
|
86
|
-
</div> -->
|
|
87
63
|
</div>
|
|
88
64
|
<div class="nstc-unit-content">
|
|
89
65
|
<el-checkbox
|
|
@@ -91,7 +67,6 @@
|
|
|
91
67
|
v-if="showAllCheck && !single"
|
|
92
68
|
v-model="checkD"
|
|
93
69
|
class="m-l-lg nstc-unit-content-heightfix"
|
|
94
|
-
:label="$t('common_a_0003')"
|
|
95
70
|
@change="handleCheckBox"
|
|
96
71
|
/>
|
|
97
72
|
<Tree
|
|
@@ -115,10 +90,10 @@
|
|
|
115
90
|
</div>
|
|
116
91
|
<div class="nstc-unit-footer" v-if="!this.single">
|
|
117
92
|
<el-button type="primary" size="mini" @click="confirm">{{
|
|
118
|
-
$
|
|
93
|
+
$lc("确定")
|
|
119
94
|
}}</el-button>
|
|
120
95
|
<el-button class="nstc-unit-cancel" size="mini" @click="cancel">{{
|
|
121
|
-
$
|
|
96
|
+
$lc("取消")
|
|
122
97
|
}}</el-button>
|
|
123
98
|
</div>
|
|
124
99
|
</div>
|
|
@@ -705,7 +680,7 @@ export default {
|
|
|
705
680
|
});
|
|
706
681
|
this.checkD = true;
|
|
707
682
|
this.selectData = JSON.parse(JSON.stringify(flatTemp));
|
|
708
|
-
this.valueShow = this.$
|
|
683
|
+
this.valueShow = this.$lc("全部单位");
|
|
709
684
|
this.$nextTick(() => {
|
|
710
685
|
console.log(11111, this.selectData);
|
|
711
686
|
this.$refs.tree.setCheckedNodes(this.selectData);
|
|
@@ -796,12 +771,10 @@ export default {
|
|
|
796
771
|
this.getTreeData("1", { resolve });
|
|
797
772
|
}).then(() => {
|
|
798
773
|
this.$nextTick(() => {
|
|
799
|
-
// console.log(this.data);
|
|
800
774
|
let temp = [];
|
|
801
775
|
this.flatData(this.data, temp);
|
|
802
776
|
setTimeout(() => {
|
|
803
777
|
//默认全选时,选中数据
|
|
804
|
-
// console.log(temp, this.$refs.tree);
|
|
805
778
|
//去除没有权限的单位
|
|
806
779
|
temp = temp.filter((s) => {
|
|
807
780
|
return !s.disabled;
|
|
@@ -820,16 +793,8 @@ export default {
|
|
|
820
793
|
this.$emit("dataChange", this.selectData);
|
|
821
794
|
}
|
|
822
795
|
if (this.showAllCheck) {
|
|
823
|
-
this.valueShow = this.$
|
|
796
|
+
this.valueShow = this.$lc("全部单位");
|
|
824
797
|
}
|
|
825
|
-
// let s = temp.map((t) => {
|
|
826
|
-
// return t.unitNo;
|
|
827
|
-
// });
|
|
828
|
-
// this.valueShow = temp.map(t => {
|
|
829
|
-
// return t.unitName
|
|
830
|
-
// })
|
|
831
|
-
// console.log(22222222222222222, data)
|
|
832
|
-
// this.$emit('input', s)
|
|
833
798
|
});
|
|
834
799
|
});
|
|
835
800
|
} else {
|
|
@@ -840,24 +805,11 @@ export default {
|
|
|
840
805
|
return !s.disabled;
|
|
841
806
|
});
|
|
842
807
|
this.$refs.tree.setCheckedNodes(temp);
|
|
843
|
-
// const data = this.$refs.tree.getCheckedKeys()
|
|
844
808
|
this.selectData = temp;
|
|
845
|
-
// let s = temp.map((t) => {
|
|
846
|
-
// return t.unitNo;
|
|
847
|
-
// });
|
|
848
|
-
// this.valueShow = temp.map(t => {
|
|
849
|
-
// return t.unitName
|
|
850
|
-
// })
|
|
851
|
-
// this.$emit('input', s)
|
|
852
809
|
}
|
|
853
|
-
|
|
854
|
-
// console.log(data)
|
|
855
810
|
} else {
|
|
856
811
|
this.$refs.tree.setCheckedNodes([]);
|
|
857
812
|
this.selectData = [];
|
|
858
|
-
// this.valueShow = []
|
|
859
|
-
// this.$emit('input', [])
|
|
860
|
-
// this.$message.warning(this.$t("common_a_0005"));
|
|
861
813
|
}
|
|
862
814
|
},
|
|
863
815
|
// 选择自身以及下级单位
|
|
@@ -904,7 +856,7 @@ export default {
|
|
|
904
856
|
this.selectData = temp;
|
|
905
857
|
this.checkD = this.allUnit.length === temp1.length;
|
|
906
858
|
this.valueShow = this.checkD
|
|
907
|
-
? this.$
|
|
859
|
+
? this.$lc("全部单位")
|
|
908
860
|
: this.selectData.map((s) => s.unitName);
|
|
909
861
|
//去除没有权限的单位
|
|
910
862
|
this.selectData = this.selectData.filter((s) => {
|
|
@@ -1154,7 +1106,7 @@ export default {
|
|
|
1154
1106
|
console.log("选择全部--列表");
|
|
1155
1107
|
this.checkD = true;
|
|
1156
1108
|
this.selectData = JSON.parse(JSON.stringify(this.data));
|
|
1157
|
-
this.valueShow = this.$
|
|
1109
|
+
this.valueShow = this.$lc("全部单位");
|
|
1158
1110
|
}
|
|
1159
1111
|
|
|
1160
1112
|
let data = this.selectData.map((s) => s.unitNo);
|
|
@@ -1176,7 +1128,7 @@ export default {
|
|
|
1176
1128
|
confirm() {
|
|
1177
1129
|
// console.log("sss", this.selectData);
|
|
1178
1130
|
if (this.selectData.length < 1) {
|
|
1179
|
-
this.$message.warning(this.$
|
|
1131
|
+
this.$message.warning(this.$lc("至少选择一个单位"));
|
|
1180
1132
|
return;
|
|
1181
1133
|
}
|
|
1182
1134
|
this.checkD = this.allUnit.length === this.selectData.length;
|
|
@@ -1185,7 +1137,7 @@ export default {
|
|
|
1185
1137
|
return !s.disabled;
|
|
1186
1138
|
});
|
|
1187
1139
|
if (this.checkD) {
|
|
1188
|
-
this.valueShow = this.$
|
|
1140
|
+
this.valueShow = this.$lc("全部单位");
|
|
1189
1141
|
} else {
|
|
1190
1142
|
this.valueShow = this.selectData.map((s) => s.unitName);
|
|
1191
1143
|
}
|
|
@@ -31,20 +31,20 @@
|
|
|
31
31
|
<el-dropdown-menu slot="dropdown" class="nstc-unit-tree-drop">
|
|
32
32
|
<el-dropdown-item
|
|
33
33
|
@click.native.stop="handleCheckedBro(node, data)"
|
|
34
|
-
>{{ $
|
|
34
|
+
>{{ $lc("勾选本单位及平级单位") }}</el-dropdown-item
|
|
35
35
|
>
|
|
36
36
|
<el-dropdown-item
|
|
37
37
|
@click.native.stop="handleCheckedChild(node, data, 'direct')"
|
|
38
38
|
>
|
|
39
|
-
{{ $
|
|
39
|
+
{{ $lc("勾选直接下级单位") }}</el-dropdown-item
|
|
40
40
|
>
|
|
41
41
|
<el-dropdown-item
|
|
42
42
|
@click.native.stop="handleCheckedChild(node, data, 'all')"
|
|
43
|
-
>{{ $
|
|
43
|
+
>{{ $lc("勾选本单位及子单位") }}</el-dropdown-item
|
|
44
44
|
>
|
|
45
45
|
<el-dropdown-item
|
|
46
46
|
@click.native.stop="handleCheckedChild(node, data, 'cancel')"
|
|
47
|
-
>{{ $
|
|
47
|
+
>{{ $lc("取消勾选所有下级单位") }}</el-dropdown-item
|
|
48
48
|
>
|
|
49
49
|
</el-dropdown-menu>
|
|
50
50
|
</el-dropdown>
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
<el-input
|
|
31
31
|
v-model="searchKey"
|
|
32
32
|
:validate-event="false"
|
|
33
|
-
:placeholder="$t('common_a_0004')"
|
|
34
33
|
clearable
|
|
35
34
|
@input="debounce(searchTree, 1000)"
|
|
36
35
|
class="input-w nstc-unit-search"
|
|
@@ -40,7 +39,7 @@
|
|
|
40
39
|
<button
|
|
41
40
|
type="button"
|
|
42
41
|
@click="changeType('tree')"
|
|
43
|
-
v-title="$
|
|
42
|
+
v-title="$lc('树结构')"
|
|
44
43
|
:class="
|
|
45
44
|
isList ? 'el-button--default is-plain' : 'el-button--primary'
|
|
46
45
|
"
|
|
@@ -53,7 +52,7 @@
|
|
|
53
52
|
<button
|
|
54
53
|
type="button"
|
|
55
54
|
@click="changeType('list')"
|
|
56
|
-
v-title="$
|
|
55
|
+
v-title="$lc('列表结构')"
|
|
57
56
|
:class="
|
|
58
57
|
isList ? 'el-button--primary' : 'el-button--default is-plain'
|
|
59
58
|
"
|
|
@@ -71,7 +70,7 @@
|
|
|
71
70
|
v-if="showAllCheck && multiple && !onlyUnit"
|
|
72
71
|
v-model="checkD"
|
|
73
72
|
class="m-l-lg nstc-unit-content-heightfix"
|
|
74
|
-
:label="$
|
|
73
|
+
:label="$lc('全部单位')"
|
|
75
74
|
@change="handleCheckBox"
|
|
76
75
|
/>
|
|
77
76
|
<Tree
|
|
@@ -95,10 +94,10 @@
|
|
|
95
94
|
</div>
|
|
96
95
|
<div class="nstc-unit-footer" v-if="multiple">
|
|
97
96
|
<el-button type="primary" size="mini" @click="confirm">{{
|
|
98
|
-
$
|
|
97
|
+
$lc("确定")
|
|
99
98
|
}}</el-button>
|
|
100
99
|
<el-button class="nstc-unit-cancel" size="mini" @click="cancel">{{
|
|
101
|
-
$
|
|
100
|
+
$lc("取消")
|
|
102
101
|
}}</el-button>
|
|
103
102
|
</div>
|
|
104
103
|
</div>
|
|
@@ -661,7 +660,7 @@ export default {
|
|
|
661
660
|
});
|
|
662
661
|
this.checkD = true;
|
|
663
662
|
this.selectData = JSON.parse(JSON.stringify(flatTemp));
|
|
664
|
-
this.valueShow = this.$
|
|
663
|
+
this.valueShow = this.$lc("全部单位");
|
|
665
664
|
this.$nextTick(() => {
|
|
666
665
|
console.log(11111, this.selectData);
|
|
667
666
|
this.$refs.tree.setCheckedNodes(this.selectData);
|
|
@@ -783,7 +782,7 @@ export default {
|
|
|
783
782
|
this.selectData = [];
|
|
784
783
|
// this.valueShow = []
|
|
785
784
|
// this.$emit('input', [])
|
|
786
|
-
// this.$message.warning(this.$
|
|
785
|
+
// this.$message.warning(this.$lc("至少选择一个单位"));
|
|
787
786
|
}
|
|
788
787
|
},
|
|
789
788
|
checkedBro(data) {
|
|
@@ -898,7 +897,7 @@ export default {
|
|
|
898
897
|
},
|
|
899
898
|
confirm() {
|
|
900
899
|
if (this.selectData.length < 1) {
|
|
901
|
-
this.$message.warning(this.$
|
|
900
|
+
this.$message.warning(this.$lc("至少选择一个单位"));
|
|
902
901
|
return;
|
|
903
902
|
}
|
|
904
903
|
//去除没有权限的单位
|
|
@@ -39,20 +39,20 @@
|
|
|
39
39
|
<el-dropdown-menu slot="dropdown" class="nstc-unit-tree-drop">
|
|
40
40
|
<el-dropdown-item
|
|
41
41
|
@click.native.stop="handleCheckedBro(node, data)"
|
|
42
|
-
>{{ $
|
|
42
|
+
>{{ $lc("勾选本单位及平级单位") }}</el-dropdown-item
|
|
43
43
|
>
|
|
44
44
|
<el-dropdown-item
|
|
45
45
|
@click.native.stop="handleCheckedChild(node, data, 'direct')"
|
|
46
46
|
>
|
|
47
|
-
{{ $
|
|
47
|
+
{{ $lc("勾选直接下级单位") }}</el-dropdown-item
|
|
48
48
|
>
|
|
49
49
|
<el-dropdown-item
|
|
50
50
|
@click.native.stop="handleCheckedChild(node, data, 'all')"
|
|
51
|
-
>{{ $
|
|
51
|
+
>{{ $lc("勾选本单位及子单位") }}</el-dropdown-item
|
|
52
52
|
>
|
|
53
53
|
<el-dropdown-item
|
|
54
54
|
@click.native.stop="handleCheckedChild(node, data, 'cancel')"
|
|
55
|
-
>{{ $
|
|
55
|
+
>{{ $lc("取消勾选所有下级单位") }}</el-dropdown-item
|
|
56
56
|
>
|
|
57
57
|
</el-dropdown-menu>
|
|
58
58
|
</el-dropdown>
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
<!-- <!– <div v-if="!node.data.disabled" @click="handleChecked(node, data)">只勾选本单位</div> –>-->
|
|
70
70
|
<!-- <!– 勾选本单位及平级单位–>-->
|
|
71
71
|
<!-- <div v-if="!node.data.disabled" @click="handleCheckedBro(node, data)">-->
|
|
72
|
-
<!-- {{ $
|
|
72
|
+
<!-- {{ $lc("勾选本单位及平级单位") }}-->
|
|
73
73
|
<!-- </div>-->
|
|
74
74
|
<!-- <!–勾选直接下级单位–>-->
|
|
75
75
|
<!-- <div @click="handleCheckedChild(node, data, 'direct')">-->
|
|
76
|
-
<!-- {{ $
|
|
76
|
+
<!-- {{ $lc("勾选直接下级单位") }}-->
|
|
77
77
|
<!-- </div>-->
|
|
78
78
|
<!-- <!–勾选所有下级单位–>-->
|
|
79
79
|
<!-- <div @click="handleCheckedChild(node, data, 'all')">-->
|
|
80
|
-
<!-- {{ $
|
|
80
|
+
<!-- {{ $lc("勾选本单位及子单位") }}-->
|
|
81
81
|
<!-- </div>-->
|
|
82
82
|
<!-- </div>-->
|
|
83
83
|
<!-- </div>-->
|
package/src/i18n.json
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"此处只可设置个人自定义常用审批意见,全局需到工作流审批意见设置中设置": {
|
|
3
3
|
"en": "You can only set personal custom common phrases here. The global setting needs to be set in the workflow approval opinion setting."
|
|
4
|
+
},
|
|
5
|
+
"树结构": {
|
|
6
|
+
"en": "Tree Structure"
|
|
7
|
+
},
|
|
8
|
+
"列表结构": {
|
|
9
|
+
"en": "List Structure"
|
|
10
|
+
},
|
|
11
|
+
"确定": {
|
|
12
|
+
"en": "Confirm"
|
|
13
|
+
},
|
|
14
|
+
"取消": {
|
|
15
|
+
"en": "Cancel"
|
|
16
|
+
},
|
|
17
|
+
"全部单位": {
|
|
18
|
+
"en": "All Units"
|
|
19
|
+
},
|
|
20
|
+
"至少选择一个单位": {
|
|
21
|
+
"en": "At least one unit is required"
|
|
22
|
+
},
|
|
23
|
+
"勾选本单位及平级单位": {
|
|
24
|
+
"en": "Select your own unit and your peers"
|
|
25
|
+
},
|
|
26
|
+
"勾选直接下级单位": {
|
|
27
|
+
"en": "Select direct sub-units"
|
|
28
|
+
},
|
|
29
|
+
"勾选本单位及子单位": {
|
|
30
|
+
"en": "Select your own unit and its sub-units"
|
|
31
|
+
},
|
|
32
|
+
"取消勾选所有下级单位": {
|
|
33
|
+
"en": "Unselect all sub-units"
|
|
4
34
|
}
|
|
5
35
|
}
|