t20-common-lib 0.12.21 → 0.12.23
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 +12 -57
- package/packages/select-tree-unit/src/selectTree/Tree/index.vue +4 -4
- package/packages/select-tree-unit-form/src/main.vue +9 -9
- package/packages/select-tree-unit-form/src/selectTreeForm/Tree/index.vue +7 -7
- package/src/common/Filters/index.vue +1 -1
- package/src/i18n.json +36 -0
package/package.json
CHANGED
|
@@ -27,9 +27,9 @@
|
|
|
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)"
|
|
32
|
+
:placeholder="$lc('请输入')"
|
|
33
33
|
class="input-w nstc-unit-search"
|
|
34
34
|
></el-input>
|
|
35
35
|
<Filters :isEnableCommonConfigControl="isEnableCommonConfigControl" @filterChange="filterChange" v-bind="$attrs" />
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<button
|
|
39
39
|
type="button"
|
|
40
40
|
@click="changeType('tree')"
|
|
41
|
-
v-title="$
|
|
41
|
+
v-title="$lc('树结构')"
|
|
42
42
|
:class="
|
|
43
43
|
isList ? 'el-button--default is-plain' : 'el-button--primary'
|
|
44
44
|
"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
<button
|
|
52
52
|
type="button"
|
|
53
53
|
@click="changeType('list')"
|
|
54
|
-
v-title="$
|
|
54
|
+
v-title="$lc('列表结构')"
|
|
55
55
|
:class="
|
|
56
56
|
isList ? 'el-button--primary' : 'el-button--default is-plain'
|
|
57
57
|
"
|
|
@@ -62,28 +62,6 @@
|
|
|
62
62
|
<i class="iconfont icon-liebiao"></i>
|
|
63
63
|
</button>
|
|
64
64
|
</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
65
|
</div>
|
|
88
66
|
<div class="nstc-unit-content">
|
|
89
67
|
<el-checkbox
|
|
@@ -91,7 +69,7 @@
|
|
|
91
69
|
v-if="showAllCheck && !single"
|
|
92
70
|
v-model="checkD"
|
|
93
71
|
class="m-l-lg nstc-unit-content-heightfix"
|
|
94
|
-
:label="$
|
|
72
|
+
:label="$lc('全部单位')"
|
|
95
73
|
@change="handleCheckBox"
|
|
96
74
|
/>
|
|
97
75
|
<Tree
|
|
@@ -115,10 +93,10 @@
|
|
|
115
93
|
</div>
|
|
116
94
|
<div class="nstc-unit-footer" v-if="!this.single">
|
|
117
95
|
<el-button type="primary" size="mini" @click="confirm">{{
|
|
118
|
-
$
|
|
96
|
+
$lc("确定")
|
|
119
97
|
}}</el-button>
|
|
120
98
|
<el-button class="nstc-unit-cancel" size="mini" @click="cancel">{{
|
|
121
|
-
$
|
|
99
|
+
$lc("取消")
|
|
122
100
|
}}</el-button>
|
|
123
101
|
</div>
|
|
124
102
|
</div>
|
|
@@ -705,7 +683,7 @@ export default {
|
|
|
705
683
|
});
|
|
706
684
|
this.checkD = true;
|
|
707
685
|
this.selectData = JSON.parse(JSON.stringify(flatTemp));
|
|
708
|
-
this.valueShow = this.$
|
|
686
|
+
this.valueShow = this.$lc("全部单位");
|
|
709
687
|
this.$nextTick(() => {
|
|
710
688
|
console.log(11111, this.selectData);
|
|
711
689
|
this.$refs.tree.setCheckedNodes(this.selectData);
|
|
@@ -796,12 +774,10 @@ export default {
|
|
|
796
774
|
this.getTreeData("1", { resolve });
|
|
797
775
|
}).then(() => {
|
|
798
776
|
this.$nextTick(() => {
|
|
799
|
-
// console.log(this.data);
|
|
800
777
|
let temp = [];
|
|
801
778
|
this.flatData(this.data, temp);
|
|
802
779
|
setTimeout(() => {
|
|
803
780
|
//默认全选时,选中数据
|
|
804
|
-
// console.log(temp, this.$refs.tree);
|
|
805
781
|
//去除没有权限的单位
|
|
806
782
|
temp = temp.filter((s) => {
|
|
807
783
|
return !s.disabled;
|
|
@@ -820,16 +796,8 @@ export default {
|
|
|
820
796
|
this.$emit("dataChange", this.selectData);
|
|
821
797
|
}
|
|
822
798
|
if (this.showAllCheck) {
|
|
823
|
-
this.valueShow = this.$
|
|
799
|
+
this.valueShow = this.$lc("全部单位");
|
|
824
800
|
}
|
|
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
801
|
});
|
|
834
802
|
});
|
|
835
803
|
} else {
|
|
@@ -840,24 +808,11 @@ export default {
|
|
|
840
808
|
return !s.disabled;
|
|
841
809
|
});
|
|
842
810
|
this.$refs.tree.setCheckedNodes(temp);
|
|
843
|
-
// const data = this.$refs.tree.getCheckedKeys()
|
|
844
811
|
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
812
|
}
|
|
853
|
-
|
|
854
|
-
// console.log(data)
|
|
855
813
|
} else {
|
|
856
814
|
this.$refs.tree.setCheckedNodes([]);
|
|
857
815
|
this.selectData = [];
|
|
858
|
-
// this.valueShow = []
|
|
859
|
-
// this.$emit('input', [])
|
|
860
|
-
// this.$message.warning(this.$t("common_a_0005"));
|
|
861
816
|
}
|
|
862
817
|
},
|
|
863
818
|
// 选择自身以及下级单位
|
|
@@ -904,7 +859,7 @@ export default {
|
|
|
904
859
|
this.selectData = temp;
|
|
905
860
|
this.checkD = this.allUnit.length === temp1.length;
|
|
906
861
|
this.valueShow = this.checkD
|
|
907
|
-
? this.$
|
|
862
|
+
? this.$lc("全部单位")
|
|
908
863
|
: this.selectData.map((s) => s.unitName);
|
|
909
864
|
//去除没有权限的单位
|
|
910
865
|
this.selectData = this.selectData.filter((s) => {
|
|
@@ -1154,7 +1109,7 @@ export default {
|
|
|
1154
1109
|
console.log("选择全部--列表");
|
|
1155
1110
|
this.checkD = true;
|
|
1156
1111
|
this.selectData = JSON.parse(JSON.stringify(this.data));
|
|
1157
|
-
this.valueShow = this.$
|
|
1112
|
+
this.valueShow = this.$lc("全部单位");
|
|
1158
1113
|
}
|
|
1159
1114
|
|
|
1160
1115
|
let data = this.selectData.map((s) => s.unitNo);
|
|
@@ -1176,7 +1131,7 @@ export default {
|
|
|
1176
1131
|
confirm() {
|
|
1177
1132
|
// console.log("sss", this.selectData);
|
|
1178
1133
|
if (this.selectData.length < 1) {
|
|
1179
|
-
this.$message.warning(this.$
|
|
1134
|
+
this.$message.warning(this.$lc("至少选择一个单位"));
|
|
1180
1135
|
return;
|
|
1181
1136
|
}
|
|
1182
1137
|
this.checkD = this.allUnit.length === this.selectData.length;
|
|
@@ -1185,7 +1140,7 @@ export default {
|
|
|
1185
1140
|
return !s.disabled;
|
|
1186
1141
|
});
|
|
1187
1142
|
if (this.checkD) {
|
|
1188
|
-
this.valueShow = this.$
|
|
1143
|
+
this.valueShow = this.$lc("全部单位");
|
|
1189
1144
|
} else {
|
|
1190
1145
|
this.valueShow = this.selectData.map((s) => s.unitName);
|
|
1191
1146
|
}
|
|
@@ -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,9 +30,9 @@
|
|
|
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)"
|
|
35
|
+
:placeholder="$lc('请输入')"
|
|
36
36
|
class="input-w nstc-unit-search"
|
|
37
37
|
></el-input>
|
|
38
38
|
<Filters :isEnableCommonConfigControl="isEnableCommonConfigControl" @filterChange="filterChange" v-bind="$attrs" />
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<button
|
|
41
41
|
type="button"
|
|
42
42
|
@click="changeType('tree')"
|
|
43
|
-
v-title="$
|
|
43
|
+
v-title="$lc('树结构')"
|
|
44
44
|
:class="
|
|
45
45
|
isList ? 'el-button--default is-plain' : 'el-button--primary'
|
|
46
46
|
"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<button
|
|
54
54
|
type="button"
|
|
55
55
|
@click="changeType('list')"
|
|
56
|
-
v-title="$
|
|
56
|
+
v-title="$lc('列表结构')"
|
|
57
57
|
:class="
|
|
58
58
|
isList ? 'el-button--primary' : 'el-button--default is-plain'
|
|
59
59
|
"
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
v-if="showAllCheck && multiple && !onlyUnit"
|
|
72
72
|
v-model="checkD"
|
|
73
73
|
class="m-l-lg nstc-unit-content-heightfix"
|
|
74
|
-
:label="$
|
|
74
|
+
:label="$lc('全部单位')"
|
|
75
75
|
@change="handleCheckBox"
|
|
76
76
|
/>
|
|
77
77
|
<Tree
|
|
@@ -95,10 +95,10 @@
|
|
|
95
95
|
</div>
|
|
96
96
|
<div class="nstc-unit-footer" v-if="multiple">
|
|
97
97
|
<el-button type="primary" size="mini" @click="confirm">{{
|
|
98
|
-
$
|
|
98
|
+
$lc("确定")
|
|
99
99
|
}}</el-button>
|
|
100
100
|
<el-button class="nstc-unit-cancel" size="mini" @click="cancel">{{
|
|
101
|
-
$
|
|
101
|
+
$lc("取消")
|
|
102
102
|
}}</el-button>
|
|
103
103
|
</div>
|
|
104
104
|
</div>
|
|
@@ -661,7 +661,7 @@ export default {
|
|
|
661
661
|
});
|
|
662
662
|
this.checkD = true;
|
|
663
663
|
this.selectData = JSON.parse(JSON.stringify(flatTemp));
|
|
664
|
-
this.valueShow = this.$
|
|
664
|
+
this.valueShow = this.$lc("全部单位");
|
|
665
665
|
this.$nextTick(() => {
|
|
666
666
|
console.log(11111, this.selectData);
|
|
667
667
|
this.$refs.tree.setCheckedNodes(this.selectData);
|
|
@@ -783,7 +783,7 @@ export default {
|
|
|
783
783
|
this.selectData = [];
|
|
784
784
|
// this.valueShow = []
|
|
785
785
|
// this.$emit('input', [])
|
|
786
|
-
// this.$message.warning(this.$
|
|
786
|
+
// this.$message.warning(this.$lc("至少选择一个单位"));
|
|
787
787
|
}
|
|
788
788
|
},
|
|
789
789
|
checkedBro(data) {
|
|
@@ -898,7 +898,7 @@ export default {
|
|
|
898
898
|
},
|
|
899
899
|
confirm() {
|
|
900
900
|
if (this.selectData.length < 1) {
|
|
901
|
-
this.$message.warning(this.$
|
|
901
|
+
this.$message.warning(this.$lc("至少选择一个单位"));
|
|
902
902
|
return;
|
|
903
903
|
}
|
|
904
904
|
//去除没有权限的单位
|
|
@@ -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,41 @@
|
|
|
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"
|
|
34
|
+
},
|
|
35
|
+
"请选择": {
|
|
36
|
+
"en": "Please select"
|
|
37
|
+
},
|
|
38
|
+
"请输入": {
|
|
39
|
+
"en": "Please enter"
|
|
4
40
|
}
|
|
5
41
|
}
|