eoss-mobiles 0.2.25 → 0.2.26
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/lib/checkbox.js +0 -1
- package/lib/eoss-mobile.common.js +184 -78
- package/lib/flow.js +0 -1
- package/lib/index.js +1 -1
- package/lib/picker.js +0 -1
- package/lib/radio.js +0 -1
- package/lib/retrial-auth.js +0 -1
- package/lib/selector.js +178 -72
- package/lib/table-column.js +0 -1
- package/lib/table.js +0 -1
- package/lib/utils/http.js +0 -1
- package/package.json +1 -1
- package/packages/selector/src/main.vue +4 -1
- package/packages/selector/src/selector-tree.vue +103 -21
- package/packages/selector/src/tree.vue +20 -5
- package/src/index.js +1 -1
- package/src/utils/http.js +0 -1
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
<div class="em-tree-box">
|
|
36
36
|
<em-tree
|
|
37
37
|
v-if="personnel && personnel.length > 0"
|
|
38
|
+
ref="emTree"
|
|
38
39
|
:model="personnel"
|
|
39
40
|
:value-key="valueKey"
|
|
40
41
|
:label-key="labelKey"
|
|
@@ -45,7 +46,9 @@
|
|
|
45
46
|
:nodeKey="nodeKey"
|
|
46
47
|
v-on="$listeners"
|
|
47
48
|
@popen="open"
|
|
49
|
+
:isAllCheck="isAllCheck"
|
|
48
50
|
:isTreeIcon="isTreeIcon"
|
|
51
|
+
:showMore="showMore"
|
|
49
52
|
@checke="checked"
|
|
50
53
|
:showTree="showTree"
|
|
51
54
|
:oldIsSearch="oldIsSearch"
|
|
@@ -68,7 +71,7 @@
|
|
|
68
71
|
<!-- r[labelKey].length > 6
|
|
69
72
|
? r[labelKey].slice(0, 6) + '...'
|
|
70
73
|
: r[labelKey] -->
|
|
71
|
-
<div class="name" v-if="r[labelKey]
|
|
74
|
+
<div class="name" v-if="r[labelKey] || r['showname']">
|
|
72
75
|
{{ r[labelKey] || r['showname'] }}
|
|
73
76
|
</div>
|
|
74
77
|
<div class="delte" @click="delteList(i)">
|
|
@@ -109,6 +112,10 @@ export default {
|
|
|
109
112
|
type: [Array, String], //传入选中数组
|
|
110
113
|
default: () => []
|
|
111
114
|
},
|
|
115
|
+
isAllCheck: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: false
|
|
118
|
+
},
|
|
112
119
|
// pid: {
|
|
113
120
|
// type: String, // 父id或者是空
|
|
114
121
|
// default: 'root'
|
|
@@ -180,6 +187,10 @@ export default {
|
|
|
180
187
|
type: Boolean,
|
|
181
188
|
default: true
|
|
182
189
|
},
|
|
190
|
+
showMore: {
|
|
191
|
+
type: Boolean,
|
|
192
|
+
default: true
|
|
193
|
+
},
|
|
183
194
|
isTreeIcon: {
|
|
184
195
|
type: Boolean,
|
|
185
196
|
default: false
|
|
@@ -208,6 +219,10 @@ export default {
|
|
|
208
219
|
type: [String, Number],
|
|
209
220
|
default: 0
|
|
210
221
|
},
|
|
222
|
+
isDefaultNode: {
|
|
223
|
+
type: Boolean,
|
|
224
|
+
default: true
|
|
225
|
+
},
|
|
211
226
|
nodeList: Array,
|
|
212
227
|
baseUrl: String
|
|
213
228
|
},
|
|
@@ -224,6 +239,7 @@ export default {
|
|
|
224
239
|
newParam: {},
|
|
225
240
|
oldIsSearch: false,
|
|
226
241
|
selectIndex: 0,
|
|
242
|
+
checkObj: {},
|
|
227
243
|
first: true
|
|
228
244
|
};
|
|
229
245
|
},
|
|
@@ -529,13 +545,13 @@ export default {
|
|
|
529
545
|
typeof this.selectList != 'string' &&
|
|
530
546
|
(this.list = $.deepClone(this.selectList));
|
|
531
547
|
|
|
532
|
-
this.$nextTick(() => {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
});
|
|
548
|
+
// this.$nextTick(() => {
|
|
549
|
+
// if (this.nodeList) {
|
|
550
|
+
// this.getNodeList();
|
|
551
|
+
// } else {
|
|
552
|
+
// this.getContent();
|
|
553
|
+
// }
|
|
554
|
+
// });
|
|
539
555
|
},
|
|
540
556
|
methods: {
|
|
541
557
|
handleClick(index) {
|
|
@@ -660,8 +676,8 @@ export default {
|
|
|
660
676
|
].param.selecttype;
|
|
661
677
|
if (this.newParam.selecttype === 'persongroup') {
|
|
662
678
|
this.newParam.pid = 'root';
|
|
663
|
-
}else{
|
|
664
|
-
this.newParam.pid = this.param.pid || 'root'
|
|
679
|
+
} else {
|
|
680
|
+
this.newParam.pid = this.param.pid || 'root';
|
|
665
681
|
}
|
|
666
682
|
request({
|
|
667
683
|
url: this.url
|
|
@@ -733,6 +749,19 @@ export default {
|
|
|
733
749
|
params: params
|
|
734
750
|
}).then(res => {
|
|
735
751
|
if (res.rCode == 0) {
|
|
752
|
+
if (
|
|
753
|
+
res.results.length > 0 &&
|
|
754
|
+
res.results[0].nocheck == false &&
|
|
755
|
+
this.isAllCheck
|
|
756
|
+
) {
|
|
757
|
+
res.results.unshift({
|
|
758
|
+
showshortname: '全选',
|
|
759
|
+
checked: false,
|
|
760
|
+
isAllCheck: true,
|
|
761
|
+
id: $.generateUUID(),
|
|
762
|
+
parentshowid: res.results[0].parentshowid
|
|
763
|
+
});
|
|
764
|
+
}
|
|
736
765
|
this.$set(obj, 'children', res.results);
|
|
737
766
|
let _this = this;
|
|
738
767
|
this.selectList.filter(r => {
|
|
@@ -742,13 +771,26 @@ export default {
|
|
|
742
771
|
}
|
|
743
772
|
});
|
|
744
773
|
});
|
|
774
|
+
if (this.isAllCheck) {
|
|
775
|
+
let checkList = obj.children
|
|
776
|
+
.slice(1, obj.children.length)
|
|
777
|
+
.filter(x => x.checked);
|
|
778
|
+
if (
|
|
779
|
+
checkList.length ===
|
|
780
|
+
obj.children.slice(1, obj.children.length).length
|
|
781
|
+
) {
|
|
782
|
+
_this.$set(obj.children[0], 'checked', true);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
745
785
|
}
|
|
746
786
|
this.$toast.clear();
|
|
747
787
|
});
|
|
748
788
|
},
|
|
749
789
|
getChiled(res, isStart, key) {
|
|
750
790
|
const _that = this;
|
|
751
|
-
let data = _that.$listeners[key]
|
|
791
|
+
let data = _that.$listeners[key]
|
|
792
|
+
? _that.$listeners[key](res.obj, !!res.obj.children)
|
|
793
|
+
: undefined;
|
|
752
794
|
if (!isStart) {
|
|
753
795
|
if (res.obj.open) {
|
|
754
796
|
this.$set(res.obj, 'open', false);
|
|
@@ -822,14 +864,20 @@ export default {
|
|
|
822
864
|
const _that = this;
|
|
823
865
|
_that.oldIsSearch = _that.isSearch;
|
|
824
866
|
// debugger
|
|
825
|
-
if (
|
|
867
|
+
if (
|
|
868
|
+
this.$listeners['node-click'] &&
|
|
869
|
+
(this.$listeners['left-icon'] || (this.showMore && !this.isDefaultNode))
|
|
870
|
+
) {
|
|
826
871
|
if (this.$listeners['left-icon'] && !isNode) {
|
|
827
872
|
this.getChiled(res, isStart, 'left-icon');
|
|
873
|
+
} else if (this.showMore && !isNode) {
|
|
874
|
+
this.getChiled(res, isStart, 'right-icon');
|
|
828
875
|
}
|
|
829
876
|
isNode && _that.$listeners['node-click'](res.obj, !!res.obj.children);
|
|
830
877
|
} else if (
|
|
831
878
|
this.$listeners['node-click'] ||
|
|
832
|
-
this.$listeners['left-icon']
|
|
879
|
+
this.$listeners['left-icon'] ||
|
|
880
|
+
(this.showMore && !this.isDefaultNode)
|
|
833
881
|
) {
|
|
834
882
|
isNode &&
|
|
835
883
|
this.$listeners['node-click'] &&
|
|
@@ -837,6 +885,10 @@ export default {
|
|
|
837
885
|
this.$listeners['left-icon'] &&
|
|
838
886
|
!isNode &&
|
|
839
887
|
this.getChiled(res, isStart, 'left-icon');
|
|
888
|
+
this.showMore &&
|
|
889
|
+
!this.isDefaultNode &&
|
|
890
|
+
!isNode &&
|
|
891
|
+
this.getChiled(res, isStart, 'right-icon');
|
|
840
892
|
} else {
|
|
841
893
|
if (!isStart) {
|
|
842
894
|
if (res.obj.open) {
|
|
@@ -850,23 +902,53 @@ export default {
|
|
|
850
902
|
}
|
|
851
903
|
}
|
|
852
904
|
},
|
|
853
|
-
checked(res) {
|
|
905
|
+
checked(res, model) {
|
|
854
906
|
this.oldIsSearch = this.isSearch;
|
|
855
907
|
if (res.obj.checked) {
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
this.list
|
|
908
|
+
if (res.obj.isAllCheck) {
|
|
909
|
+
model.map(x => {
|
|
910
|
+
for (let i in this.list) {
|
|
911
|
+
if (this.list[i][this.valueKey] == x[this.valueKey]) {
|
|
912
|
+
this.list.splice(i, 1);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
this.$set(x, 'checked', false);
|
|
916
|
+
});
|
|
917
|
+
} else {
|
|
918
|
+
for (let i in this.list) {
|
|
919
|
+
if (this.list[i][this.valueKey] == res.obj[this.valueKey]) {
|
|
920
|
+
this.list.splice(i, 1);
|
|
921
|
+
}
|
|
859
922
|
}
|
|
923
|
+
this.$set(res.obj, 'checked', false);
|
|
860
924
|
}
|
|
861
|
-
|
|
862
|
-
this.$set(res.obj, 'checked', false);
|
|
863
925
|
} else {
|
|
864
926
|
if (!this.multiple && this.list.length >= 1) {
|
|
865
927
|
this.$toast(this.promptText);
|
|
866
928
|
return;
|
|
867
929
|
}
|
|
868
|
-
|
|
869
|
-
|
|
930
|
+
if (res.obj.isAllCheck) {
|
|
931
|
+
model.map(x => {
|
|
932
|
+
this.$set(x, 'checked', true);
|
|
933
|
+
});
|
|
934
|
+
this.list.unshift(...model.slice(1, model.length));
|
|
935
|
+
} else {
|
|
936
|
+
this.$set(res.obj, 'checked', true);
|
|
937
|
+
this.list.unshift(res.obj);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
if (this.isAllCheck) {
|
|
941
|
+
let checkList = model.slice(1, model.length).filter(x => x.checked);
|
|
942
|
+
var obj = {};
|
|
943
|
+
this.list = this.list.reduce((item, next) => {
|
|
944
|
+
obj[next.showid] ? '' : (obj[next.showid] = true && item.push(next));
|
|
945
|
+
return item;
|
|
946
|
+
}, []);
|
|
947
|
+
if (this.isAllCheck && model.length - 1 === checkList.length) {
|
|
948
|
+
this.$set(model[0], 'checked', true);
|
|
949
|
+
} else if (this.isAllCheck) {
|
|
950
|
+
this.$set(model[0], 'checked', false);
|
|
951
|
+
}
|
|
870
952
|
}
|
|
871
953
|
},
|
|
872
954
|
dispose() {
|
|
@@ -20,12 +20,15 @@
|
|
|
20
20
|
? item[labelKey].slice(0, 12) + '...'
|
|
21
21
|
: item[labelKey] -->
|
|
22
22
|
</div>
|
|
23
|
-
<div
|
|
24
|
-
|
|
23
|
+
<div
|
|
24
|
+
v-if="isTreeIcon"
|
|
25
|
+
v-tap="{ methods: handleClickIcon, obj: item }"
|
|
26
|
+
>
|
|
27
|
+
<slot name="tree-icon" :value="item"></slot>
|
|
25
28
|
</div>
|
|
26
29
|
{{ item[labelKey] }}
|
|
27
30
|
</div>
|
|
28
|
-
<van-icon name="arrow" class="right" v-if="
|
|
31
|
+
<van-icon name="arrow" v-tap="{ methods: handleClickIcon, obj: item }" class="right" v-if="showMore" />
|
|
29
32
|
<i
|
|
30
33
|
class="iconfont icon-gou select-icon"
|
|
31
34
|
v-show="
|
|
@@ -58,9 +61,11 @@
|
|
|
58
61
|
:nodeKey="nodeKey"
|
|
59
62
|
:oldIsSearch="oldIsSearch"
|
|
60
63
|
:isSearch="isSearch"
|
|
64
|
+
:isAllCheck="isAllCheck"
|
|
61
65
|
:label-key="labelKey"
|
|
62
66
|
:value-key="valueKey"
|
|
63
67
|
:showTree="showTree"
|
|
68
|
+
:showMore="showMore"
|
|
64
69
|
:enterprise="enterprise"
|
|
65
70
|
:isTreeIcon="isTreeIcon"
|
|
66
71
|
:department="department"
|
|
@@ -202,6 +207,14 @@ export default {
|
|
|
202
207
|
type: String,
|
|
203
208
|
default: 'showshortname'
|
|
204
209
|
},
|
|
210
|
+
isAllCheck:{
|
|
211
|
+
type:Boolean,
|
|
212
|
+
default:false
|
|
213
|
+
},
|
|
214
|
+
showMore:{
|
|
215
|
+
type:Boolean,
|
|
216
|
+
default:true
|
|
217
|
+
},
|
|
205
218
|
oldIsSearch: Boolean,
|
|
206
219
|
isSearch: Boolean
|
|
207
220
|
},
|
|
@@ -232,14 +245,16 @@ export default {
|
|
|
232
245
|
},
|
|
233
246
|
methods: {
|
|
234
247
|
handleClickIcon(res, isStart){
|
|
235
|
-
if(!this.$listeners['left-icon']) return
|
|
248
|
+
if(!this.$listeners['left-icon'] && !this.showMore) return
|
|
236
249
|
this.$emit('popen', res, res.isStart || isStart);
|
|
237
250
|
},
|
|
238
251
|
opened(res, isStart) {
|
|
239
252
|
this.$emit('popen', res, res.isStart || isStart,true);
|
|
240
253
|
},
|
|
241
254
|
checke(res) {
|
|
242
|
-
|
|
255
|
+
let model = undefined
|
|
256
|
+
if(this.isAllCheck) model = this.model
|
|
257
|
+
this.$emit('checke', res,model);
|
|
243
258
|
},
|
|
244
259
|
isShowNode(id) {
|
|
245
260
|
let isShow = true;
|
package/src/index.js
CHANGED