ai.touchui-vue 1.37.0 → 1.39.0
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/ai.touchui-vue.common.js +356 -241
- package/lib/date-picker.js +29 -53
- package/lib/float.js +39 -9
- package/lib/form.js +8 -8
- package/lib/import.js +19 -11
- package/lib/index.js +1 -1
- package/lib/input.js +4 -7
- package/lib/progress.js +8 -2
- package/lib/select.js +214 -98
- package/lib/theme/css/theme/B-Design.css +1 -1
- package/lib/theme/css/theme/aiplan.css +1 -1
- package/lib/theme/css/theme/aiplangd.css +1 -1
- package/lib/theme/css/theme/chbn.css +1 -1
- package/lib/theme/css/theme/default.css +1 -1
- package/lib/theme/css/theme/dt.css +1 -1
- package/lib/theme/css/theme/ecloud.css +1 -1
- package/lib/theme/css/theme/hongkong.css +1 -1
- package/lib/theme/css/theme/logistics.css +1 -1
- package/lib/theme/css/theme/narrow.css +1 -1
- package/lib/theme/css/theme/sdpf.css +1 -1
- package/lib/theme/css/theme/upc.css +1 -1
- package/lib/theme/css/theme/website.css +1 -1
- package/lib/theme/css/theme/workbench-gz.css +1 -1
- package/lib/theme/css/theme/zj.css +1 -1
- package/lib/utils/validate.js +4 -22
- package/package.json +1 -1
- package/packages/date-picker/src/.DS_Store +0 -0
- package/packages/date-picker/src/date-picker.vue +28 -53
- package/packages/float/src/main.vue +37 -7
- package/packages/form/src/form-item.vue +1 -1
- package/packages/import/src/import.vue +1 -1
- package/packages/input/src/input.vue +2 -5
- package/packages/progress/src/progress.vue +5 -0
- package/packages/select/src/select.vue +99 -21
- package/packages/theme/lib/css/theme/B-Design.css +1 -1
- package/packages/theme/lib/css/theme/aiplan.css +1 -1
- package/packages/theme/lib/css/theme/aiplangd.css +1 -1
- package/packages/theme/lib/css/theme/chbn.css +1 -1
- package/packages/theme/lib/css/theme/default.css +1 -1
- package/packages/theme/lib/css/theme/dt.css +1 -1
- package/packages/theme/lib/css/theme/ecloud.css +1 -1
- package/packages/theme/lib/css/theme/hongkong.css +1 -1
- package/packages/theme/lib/css/theme/logistics.css +1 -1
- package/packages/theme/lib/css/theme/narrow.css +1 -1
- package/packages/theme/lib/css/theme/sdpf.css +1 -1
- package/packages/theme/lib/css/theme/upc.css +1 -1
- package/packages/theme/lib/css/theme/website.css +1 -1
- package/packages/theme/lib/css/theme/workbench-gz.css +1 -1
- package/packages/theme/lib/css/theme/zj.css +1 -1
- package/packages/theme/src/less/component/msg.less +1 -1
- package/packages/theme/src/less/element/pic.less +1 -0
- package/packages/theme/src/less/element/progress.less +1 -1
- package/packages/theme/src/less/element/select.less +8 -0
- package/src/index.js +1 -1
- package/src/utils/validate.js +4 -22
package/lib/select.js
CHANGED
|
@@ -252,7 +252,7 @@ module.exports = require("ai.touchui-vue/lib/locale");
|
|
|
252
252
|
// ESM COMPAT FLAG
|
|
253
253
|
__webpack_require__.r(__webpack_exports__);
|
|
254
254
|
|
|
255
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=template&id=
|
|
255
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=template&id=b54eb61c
|
|
256
256
|
var render = function () {
|
|
257
257
|
var _vm = this
|
|
258
258
|
var _h = _vm.$createElement
|
|
@@ -335,6 +335,7 @@ var render = function () {
|
|
|
335
335
|
_c(
|
|
336
336
|
"span",
|
|
337
337
|
{
|
|
338
|
+
ref: "selectContentRef",
|
|
338
339
|
staticClass: "to-selectContent",
|
|
339
340
|
class: _vm.setContentClass,
|
|
340
341
|
on: { click: _vm.click },
|
|
@@ -519,7 +520,7 @@ var render = function () {
|
|
|
519
520
|
),
|
|
520
521
|
]
|
|
521
522
|
: [
|
|
522
|
-
_vm.
|
|
523
|
+
_vm.conTags.filter(function (item) {
|
|
523
524
|
return !item.hide
|
|
524
525
|
}).length === 0 &&
|
|
525
526
|
!_vm.inputable &&
|
|
@@ -550,16 +551,20 @@ var render = function () {
|
|
|
550
551
|
"span",
|
|
551
552
|
{ staticClass: "to-selectTag" },
|
|
552
553
|
[
|
|
553
|
-
_vm.
|
|
554
|
-
|
|
554
|
+
(_vm.conTags.length > 0 &&
|
|
555
|
+
!(_vm.isAll && _vm.useAllText)) ||
|
|
556
|
+
(_vm.showCount && _vm.count > 0)
|
|
555
557
|
? [
|
|
556
|
-
_vm._l(_vm.
|
|
558
|
+
_vm._l(_vm.conTags, function (item, index) {
|
|
557
559
|
return [
|
|
558
560
|
!item.hide
|
|
559
561
|
? _c(
|
|
560
562
|
"to-tag",
|
|
561
563
|
{
|
|
562
564
|
key: index,
|
|
565
|
+
class: {
|
|
566
|
+
"show-count": _vm.isNeedMin,
|
|
567
|
+
},
|
|
563
568
|
attrs: {
|
|
564
569
|
color: "fg",
|
|
565
570
|
mode: "plain",
|
|
@@ -576,10 +581,20 @@ var render = function () {
|
|
|
576
581
|
: _vm._e(),
|
|
577
582
|
]
|
|
578
583
|
}),
|
|
584
|
+
_vm.showCount && _vm.count > 0
|
|
585
|
+
? _c(
|
|
586
|
+
"to-tag",
|
|
587
|
+
{
|
|
588
|
+
staticClass: "tag-count",
|
|
589
|
+
attrs: { color: "fg", mode: "plain" },
|
|
590
|
+
},
|
|
591
|
+
[_vm._v("+" + _vm._s(_vm.count))]
|
|
592
|
+
)
|
|
593
|
+
: _vm._e(),
|
|
579
594
|
]
|
|
580
595
|
: _vm._e(),
|
|
581
596
|
!_vm.$phone ||
|
|
582
|
-
(_vm.$phone && _vm.
|
|
597
|
+
(_vm.$phone && _vm.conTags.length === 0)
|
|
583
598
|
? [
|
|
584
599
|
_vm.inputable && !_vm.filterable
|
|
585
600
|
? _c("to-input", {
|
|
@@ -590,7 +605,7 @@ var render = function () {
|
|
|
590
605
|
"prevent-focus": "",
|
|
591
606
|
mode: "none",
|
|
592
607
|
placeholder:
|
|
593
|
-
_vm.
|
|
608
|
+
_vm.conTags.filter(function (item) {
|
|
594
609
|
return !item.hide
|
|
595
610
|
}).length > 0
|
|
596
611
|
? ""
|
|
@@ -620,7 +635,7 @@ var render = function () {
|
|
|
620
635
|
"prevent-focus": "",
|
|
621
636
|
mode: "none",
|
|
622
637
|
placeholder:
|
|
623
|
-
_vm.
|
|
638
|
+
_vm.conTags.filter(function (item) {
|
|
624
639
|
return !item.hide
|
|
625
640
|
}).length > 0
|
|
626
641
|
? ""
|
|
@@ -649,7 +664,7 @@ var render = function () {
|
|
|
649
664
|
"prevent-focus": "",
|
|
650
665
|
mode: "none",
|
|
651
666
|
placeholder:
|
|
652
|
-
_vm.
|
|
667
|
+
_vm.conTags.filter(function (item) {
|
|
653
668
|
return !item.hide
|
|
654
669
|
}).length > 0
|
|
655
670
|
? ""
|
|
@@ -760,6 +775,7 @@ var render = function () {
|
|
|
760
775
|
slide: _vm.layerSlide,
|
|
761
776
|
width: _vm.iOptionWidth,
|
|
762
777
|
position: _vm.layerPosition,
|
|
778
|
+
"max-height": _vm.maxHeight,
|
|
763
779
|
},
|
|
764
780
|
on: { closed: _vm.layerClose, mousedown: _vm.layerMousedown },
|
|
765
781
|
},
|
|
@@ -1906,7 +1922,7 @@ var staticRenderFns = []
|
|
|
1906
1922
|
render._withStripped = true
|
|
1907
1923
|
|
|
1908
1924
|
|
|
1909
|
-
// CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=
|
|
1925
|
+
// CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=b54eb61c
|
|
1910
1926
|
|
|
1911
1927
|
// EXTERNAL MODULE: external "ai.touchui-vue/lib/utils/ajax"
|
|
1912
1928
|
var ajax_ = __webpack_require__(15);
|
|
@@ -2159,6 +2175,7 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2159
2175
|
//
|
|
2160
2176
|
//
|
|
2161
2177
|
//
|
|
2178
|
+
//
|
|
2162
2179
|
|
|
2163
2180
|
|
|
2164
2181
|
|
|
@@ -2424,6 +2441,14 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2424
2441
|
valueType: {
|
|
2425
2442
|
type: String,
|
|
2426
2443
|
default: ''
|
|
2444
|
+
},
|
|
2445
|
+
showCount: {
|
|
2446
|
+
type: Boolean,
|
|
2447
|
+
default: false
|
|
2448
|
+
},
|
|
2449
|
+
maxHeight: {
|
|
2450
|
+
type: [Number, String],
|
|
2451
|
+
default: ''
|
|
2427
2452
|
}
|
|
2428
2453
|
},
|
|
2429
2454
|
data: function data() {
|
|
@@ -2450,7 +2475,10 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2450
2475
|
layerPosition: 'auto',
|
|
2451
2476
|
disabled: this.readonly,
|
|
2452
2477
|
iApiHeaders: {},
|
|
2453
|
-
inputing: false
|
|
2478
|
+
inputing: false,
|
|
2479
|
+
count: 0,
|
|
2480
|
+
conTags: [],
|
|
2481
|
+
isNeedMin: false
|
|
2454
2482
|
};
|
|
2455
2483
|
},
|
|
2456
2484
|
|
|
@@ -2603,6 +2631,9 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2603
2631
|
} else {
|
|
2604
2632
|
arr.push('to-box-mode-toast');
|
|
2605
2633
|
}
|
|
2634
|
+
// if (this.showCount) {
|
|
2635
|
+
// arr.push('to-select-showCount')
|
|
2636
|
+
// }
|
|
2606
2637
|
return arr;
|
|
2607
2638
|
},
|
|
2608
2639
|
validateRequired: function validateRequired() {
|
|
@@ -2618,11 +2649,7 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2618
2649
|
if (this.desc) {
|
|
2619
2650
|
return this.desc;
|
|
2620
2651
|
} else if (this.ToFormItem && this.ToFormItem.label) {
|
|
2621
|
-
|
|
2622
|
-
return this.ToFormItem.label + '-label';
|
|
2623
|
-
} else {
|
|
2624
|
-
return this.ToFormItem.label;
|
|
2625
|
-
}
|
|
2652
|
+
return this.ToFormItem.label;
|
|
2626
2653
|
} else {
|
|
2627
2654
|
return '';
|
|
2628
2655
|
}
|
|
@@ -2664,8 +2691,10 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2664
2691
|
handler: function handler(val) {
|
|
2665
2692
|
if (val) {
|
|
2666
2693
|
this.selected = [];
|
|
2694
|
+
this.conTags = [];
|
|
2667
2695
|
} else {
|
|
2668
2696
|
this.selected = {};
|
|
2697
|
+
this.conTags = {};
|
|
2669
2698
|
}
|
|
2670
2699
|
},
|
|
2671
2700
|
|
|
@@ -2723,7 +2752,9 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2723
2752
|
} else {
|
|
2724
2753
|
this.$emit('change', val, this.selected);
|
|
2725
2754
|
}
|
|
2726
|
-
|
|
2755
|
+
if (this.showCount && this.multiple) {
|
|
2756
|
+
this.getAllTag();
|
|
2757
|
+
}
|
|
2727
2758
|
var detail = {
|
|
2728
2759
|
name: 'ToSelect',
|
|
2729
2760
|
value: val,
|
|
@@ -2778,6 +2809,13 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2778
2809
|
}
|
|
2779
2810
|
},
|
|
2780
2811
|
created: function created() {
|
|
2812
|
+
var _this7 = this;
|
|
2813
|
+
|
|
2814
|
+
this.$nextTick(function () {
|
|
2815
|
+
if (_this7.showCount && _this7.multiple) {
|
|
2816
|
+
_this7.getAllTag();
|
|
2817
|
+
}
|
|
2818
|
+
});
|
|
2781
2819
|
this.iLabelText = this.labelText;
|
|
2782
2820
|
this.iValueText = this.valueText;
|
|
2783
2821
|
this.iResPath = this.resPath;
|
|
@@ -2803,6 +2841,79 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2803
2841
|
},
|
|
2804
2842
|
|
|
2805
2843
|
methods: {
|
|
2844
|
+
calculateTagLayout: function calculateTagLayout() {
|
|
2845
|
+
var _this8 = this;
|
|
2846
|
+
|
|
2847
|
+
var isRecalculate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
2848
|
+
|
|
2849
|
+
this.$nextTick(function () {
|
|
2850
|
+
var tags = _this8.$el.querySelectorAll('.to-selectTag .to-tag');
|
|
2851
|
+
var selectContent = _this8.$refs.selectContentRef;
|
|
2852
|
+
var gap = selectContent.scrollWidth - selectContent.clientWidth;
|
|
2853
|
+
if (gap > 0) {
|
|
2854
|
+
_this8.isNeedMin = true;
|
|
2855
|
+
return false;
|
|
2856
|
+
}
|
|
2857
|
+
_this8.isNeedMin = false;
|
|
2858
|
+
var firstTagTop = 0;
|
|
2859
|
+
if (tags.length > 1) {
|
|
2860
|
+
for (var i = 0; i < tags.length; i++) {
|
|
2861
|
+
if (i === 0) {
|
|
2862
|
+
firstTagTop = tags[i].offsetTop;
|
|
2863
|
+
} else {
|
|
2864
|
+
if (tags[i].offsetTop !== firstTagTop) {
|
|
2865
|
+
if (!tags[i].className.includes('tag-count')) {
|
|
2866
|
+
var _ret = function () {
|
|
2867
|
+
var index = isRecalculate && _this8.count > 0 ? i - 1 : i;
|
|
2868
|
+
_this8.conTags = _this8.selected.filter(function (item, idx) {
|
|
2869
|
+
return idx < index;
|
|
2870
|
+
});
|
|
2871
|
+
var arrs = _this8.selected.filter(function (item, idx) {
|
|
2872
|
+
return idx >= index;
|
|
2873
|
+
});
|
|
2874
|
+
_this8.count = arrs.length;
|
|
2875
|
+
if (!isRecalculate) {
|
|
2876
|
+
_this8.layoutCount();
|
|
2877
|
+
}
|
|
2878
|
+
return 'break';
|
|
2879
|
+
}();
|
|
2880
|
+
|
|
2881
|
+
if (_ret === 'break') break;
|
|
2882
|
+
} else {
|
|
2883
|
+
if (i >= 2) {
|
|
2884
|
+
var _ret2 = function () {
|
|
2885
|
+
var index = isRecalculate && _this8.count > 0 ? i - 1 : i;
|
|
2886
|
+
_this8.conTags = _this8.selected.filter(function (item, idx) {
|
|
2887
|
+
return idx < index;
|
|
2888
|
+
});
|
|
2889
|
+
var arrs = _this8.selected.filter(function (item, idx) {
|
|
2890
|
+
return idx >= index;
|
|
2891
|
+
});
|
|
2892
|
+
_this8.count = arrs.length;
|
|
2893
|
+
if (!isRecalculate) {
|
|
2894
|
+
_this8.layoutCount();
|
|
2895
|
+
}
|
|
2896
|
+
return 'break';
|
|
2897
|
+
}();
|
|
2898
|
+
|
|
2899
|
+
if (_ret2 === 'break') break;
|
|
2900
|
+
} else {
|
|
2901
|
+
_this8.isNeedMin = true;
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
});
|
|
2909
|
+
},
|
|
2910
|
+
getAllTag: function getAllTag() {
|
|
2911
|
+
this.count = 0;
|
|
2912
|
+
this.calculateTagLayout(false);
|
|
2913
|
+
},
|
|
2914
|
+
layoutCount: function layoutCount() {
|
|
2915
|
+
this.calculateTagLayout(true);
|
|
2916
|
+
},
|
|
2806
2917
|
valueChange: function valueChange(val) {
|
|
2807
2918
|
if (!this.multiple) {
|
|
2808
2919
|
if (this.inputable) {
|
|
@@ -2823,19 +2934,19 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2823
2934
|
}
|
|
2824
2935
|
},
|
|
2825
2936
|
setSeleted: function setSeleted(val) {
|
|
2826
|
-
var
|
|
2937
|
+
var _this9 = this;
|
|
2827
2938
|
|
|
2828
2939
|
var selected = JSON.parse(JSON.stringify(this.selected));
|
|
2829
2940
|
if (!this.multiple) {
|
|
2830
2941
|
if (this.options.findIndex(function (option) {
|
|
2831
|
-
return option[
|
|
2942
|
+
return option[_this9.iValueText] === val;
|
|
2832
2943
|
}) === -1) {
|
|
2833
2944
|
var _selected;
|
|
2834
2945
|
|
|
2835
2946
|
selected = (_selected = {}, _selected[this.iLabelText] = val, _selected[this.iValueText] = val, _selected);
|
|
2836
2947
|
} else {
|
|
2837
2948
|
selected = this.options.find(function (option) {
|
|
2838
|
-
return option[
|
|
2949
|
+
return option[_this9.iValueText] === val;
|
|
2839
2950
|
});
|
|
2840
2951
|
}
|
|
2841
2952
|
} else {
|
|
@@ -2846,15 +2957,15 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2846
2957
|
var selectedArr = [];
|
|
2847
2958
|
arr.map(function (item) {
|
|
2848
2959
|
if (item && item.trim()) {
|
|
2849
|
-
if (
|
|
2850
|
-
return String(option[
|
|
2960
|
+
if (_this9.options.findIndex(function (option) {
|
|
2961
|
+
return String(option[_this9.iValueText]) === String(item);
|
|
2851
2962
|
}) === -1) {
|
|
2852
2963
|
var _selectedArr$push;
|
|
2853
2964
|
|
|
2854
|
-
selectedArr.push((_selectedArr$push = {}, _selectedArr$push[
|
|
2965
|
+
selectedArr.push((_selectedArr$push = {}, _selectedArr$push[_this9.iLabelText] = item, _selectedArr$push[_this9.iValueText] = item, _selectedArr$push.hide = !_this9.inputable, _selectedArr$push));
|
|
2855
2966
|
} else {
|
|
2856
|
-
|
|
2857
|
-
if (String(option[
|
|
2967
|
+
_this9.options.map(function (option) {
|
|
2968
|
+
if (String(option[_this9.iValueText]) === String(item)) {
|
|
2858
2969
|
selectedArr.push(option);
|
|
2859
2970
|
}
|
|
2860
2971
|
});
|
|
@@ -2868,19 +2979,22 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2868
2979
|
var fn = this.beforeChange(selected);
|
|
2869
2980
|
if (fn && fn.then) {
|
|
2870
2981
|
fn.then(function (flag) {
|
|
2871
|
-
|
|
2982
|
+
_this9.selected = selected;
|
|
2983
|
+
_this9.conTags = selected;
|
|
2872
2984
|
}).catch(function (e) {});
|
|
2873
2985
|
} else {
|
|
2874
2986
|
if (fn) {
|
|
2875
2987
|
this.selected = selected;
|
|
2988
|
+
this.conTags = selected;
|
|
2876
2989
|
}
|
|
2877
2990
|
}
|
|
2878
2991
|
} else {
|
|
2879
2992
|
this.selected = selected;
|
|
2993
|
+
this.conTags = selected;
|
|
2880
2994
|
}
|
|
2881
2995
|
},
|
|
2882
2996
|
enter: function enter() {
|
|
2883
|
-
var
|
|
2997
|
+
var _this10 = this;
|
|
2884
2998
|
|
|
2885
2999
|
if (!(this.multiple && this.inputable)) {
|
|
2886
3000
|
this.toggleLayer();
|
|
@@ -2890,9 +3004,9 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2890
3004
|
// 判断重复项
|
|
2891
3005
|
var value = this.filterable ? this.multipleFilterValue : this.multipleInputValue;
|
|
2892
3006
|
if (this.selected.find(function (item) {
|
|
2893
|
-
return item[
|
|
3007
|
+
return item[_this10.iLabelText] === value;
|
|
2894
3008
|
}) || this.selected.find(function (item) {
|
|
2895
|
-
return item[
|
|
3009
|
+
return item[_this10.iValueText] === value;
|
|
2896
3010
|
})) {
|
|
2897
3011
|
this.$tip.error(this.t('to.select.tip.error.repetition'));
|
|
2898
3012
|
return;
|
|
@@ -2906,7 +3020,7 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2906
3020
|
var fn = this.beforeChange(newOption);
|
|
2907
3021
|
if (fn && fn.then) {
|
|
2908
3022
|
fn.then(function (flag) {
|
|
2909
|
-
|
|
3023
|
+
_this10.selected.push(newOption);
|
|
2910
3024
|
}).catch(function (e) {});
|
|
2911
3025
|
} else {
|
|
2912
3026
|
if (fn) {
|
|
@@ -2924,11 +3038,11 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2924
3038
|
if (this.$phone) {
|
|
2925
3039
|
if (this.filterable) {
|
|
2926
3040
|
setTimeout(function () {
|
|
2927
|
-
|
|
3041
|
+
_this10.$refs.popupFilter.focus();
|
|
2928
3042
|
}, 500);
|
|
2929
3043
|
} else {
|
|
2930
3044
|
setTimeout(function () {
|
|
2931
|
-
|
|
3045
|
+
_this10.$refs.popupInput.focus();
|
|
2932
3046
|
}, 500);
|
|
2933
3047
|
}
|
|
2934
3048
|
}
|
|
@@ -2939,30 +3053,32 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2939
3053
|
return true;
|
|
2940
3054
|
}
|
|
2941
3055
|
if (this.filterable) {
|
|
2942
|
-
return item[this.iLabelText].includes(this.filterValue)
|
|
3056
|
+
// return item[this.iLabelText].includes(this.filterValue)
|
|
3057
|
+
return item[this.iLabelText].toLowerCase().includes(this.filterValue.toLowerCase());
|
|
2943
3058
|
} else {
|
|
2944
3059
|
return true;
|
|
2945
3060
|
}
|
|
2946
3061
|
},
|
|
2947
3062
|
multipleFilter: function multipleFilter(item) {
|
|
2948
3063
|
if (this.filterable) {
|
|
2949
|
-
return item[this.iLabelText].includes(this.multipleFilterValue)
|
|
3064
|
+
// return item[this.iLabelText].includes(this.multipleFilterValue)
|
|
3065
|
+
return item[this.iLabelText].toLowerCase().includes(this.multipleFilterValue.toLowerCase());
|
|
2950
3066
|
} else {
|
|
2951
3067
|
return true;
|
|
2952
3068
|
}
|
|
2953
3069
|
},
|
|
2954
3070
|
getLabel: function getLabel(val) {
|
|
2955
|
-
var
|
|
3071
|
+
var _this11 = this;
|
|
2956
3072
|
|
|
2957
3073
|
var obj = this.options.find(function (item) {
|
|
2958
|
-
return item[
|
|
3074
|
+
return item[_this11.iValueText] === val;
|
|
2959
3075
|
});
|
|
2960
3076
|
if (obj && obj[this.iLabelText]) {
|
|
2961
3077
|
return obj[this.iLabelText];
|
|
2962
3078
|
}
|
|
2963
3079
|
},
|
|
2964
3080
|
setOptions: function setOptions() {
|
|
2965
|
-
var
|
|
3081
|
+
var _this12 = this;
|
|
2966
3082
|
|
|
2967
3083
|
// 同步选项
|
|
2968
3084
|
if (this.data) {
|
|
@@ -2995,7 +3111,7 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
2995
3111
|
// 如果设置了方法,则替换为方法
|
|
2996
3112
|
if (typeof this.setLabelFn === 'function') {
|
|
2997
3113
|
this.options.forEach(function (item) {
|
|
2998
|
-
item.label =
|
|
3114
|
+
item.label = _this12.setLabelFn(item);
|
|
2999
3115
|
});
|
|
3000
3116
|
}
|
|
3001
3117
|
}
|
|
@@ -3070,37 +3186,37 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3070
3186
|
// 直接返回一个 select 所需要的 data 对象时,不需要任何解析
|
|
3071
3187
|
// 如:[{name:'张三', id:0},{name:'李四', id:1}]
|
|
3072
3188
|
if (Array.isArray(res)) {
|
|
3073
|
-
|
|
3074
|
-
sessionStorage.setItem('static.' +
|
|
3189
|
+
_this12.options = res;
|
|
3190
|
+
sessionStorage.setItem('static.' + _this12.api, JSON.stringify(res));
|
|
3075
3191
|
|
|
3076
3192
|
// 设置 selected
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
} else if (res.code ===
|
|
3193
|
+
_this12.setSeleted(_this12.value);
|
|
3194
|
+
_this12.setPlaceholder();
|
|
3195
|
+
_this12.$emit('option-loaded', _this12.options);
|
|
3196
|
+
} else if (res.code === _this12.iSuccessCode) {
|
|
3081
3197
|
// 按照 json 格式返回,需要根据配置路径进行解析
|
|
3082
3198
|
// 如:{ code:'0', data:[{name:'张三', id:0},{name:'李四', id:1}]}
|
|
3083
3199
|
var data = [];
|
|
3084
|
-
if (
|
|
3085
|
-
var resPath =
|
|
3200
|
+
if (_this12.iResPath) {
|
|
3201
|
+
var resPath = _this12.iResPath.split('/');
|
|
3086
3202
|
resPath.forEach(function (el) {
|
|
3087
3203
|
data = res[el];
|
|
3088
3204
|
});
|
|
3089
3205
|
}
|
|
3090
|
-
|
|
3091
|
-
sessionStorage.setItem('static.' +
|
|
3206
|
+
_this12.options = data;
|
|
3207
|
+
sessionStorage.setItem('static.' + _this12.api, JSON.stringify(data));
|
|
3092
3208
|
|
|
3093
3209
|
// 设置 selected
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3210
|
+
_this12.setSeleted(_this12.value);
|
|
3211
|
+
_this12.setPlaceholder();
|
|
3212
|
+
_this12.$emit('option-loaded', _this12.options);
|
|
3097
3213
|
} else {
|
|
3098
|
-
|
|
3099
|
-
|
|
3214
|
+
_this12.options = [];
|
|
3215
|
+
_this12.t('to.select.tip.error.res', 'select api(' + _this12.api + ')');
|
|
3100
3216
|
}
|
|
3101
3217
|
},
|
|
3102
3218
|
onError: function onError(res) {
|
|
3103
|
-
|
|
3219
|
+
_this12.$tip.danger(_this12.t('to.select.tip.error.api', 'select api(' + _this12.api + ') '));
|
|
3104
3220
|
}
|
|
3105
3221
|
};
|
|
3106
3222
|
var req = this.httpRequest(options);
|
|
@@ -3129,23 +3245,23 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3129
3245
|
}
|
|
3130
3246
|
},
|
|
3131
3247
|
selectAll: function selectAll() {
|
|
3132
|
-
var
|
|
3248
|
+
var _this13 = this;
|
|
3133
3249
|
|
|
3134
3250
|
var arr = [];
|
|
3135
3251
|
this.options.map(function (item) {
|
|
3136
3252
|
if (!item.disabled) {
|
|
3137
|
-
arr.push(item[
|
|
3253
|
+
arr.push(item[_this13.iValueText]);
|
|
3138
3254
|
}
|
|
3139
3255
|
});
|
|
3140
3256
|
this.iValue = arr.toString();
|
|
3141
3257
|
},
|
|
3142
3258
|
Deselect: function Deselect() {
|
|
3143
|
-
var
|
|
3259
|
+
var _this14 = this;
|
|
3144
3260
|
|
|
3145
3261
|
var arr = [];
|
|
3146
3262
|
this.options.map(function (item) {
|
|
3147
|
-
if (!item.disabled && !
|
|
3148
|
-
arr.push(item[
|
|
3263
|
+
if (!item.disabled && !_this14.iValue.split(',').includes(item[_this14.iValueText])) {
|
|
3264
|
+
arr.push(item[_this14.iValueText]);
|
|
3149
3265
|
}
|
|
3150
3266
|
});
|
|
3151
3267
|
this.iValue = arr.toString();
|
|
@@ -3154,7 +3270,7 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3154
3270
|
this.setValue('');
|
|
3155
3271
|
},
|
|
3156
3272
|
itemChange: function itemChange(item) {
|
|
3157
|
-
var
|
|
3273
|
+
var _this15 = this;
|
|
3158
3274
|
|
|
3159
3275
|
if (item.disabled) {
|
|
3160
3276
|
return;
|
|
@@ -3162,38 +3278,38 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3162
3278
|
this.setSeleted(item[this.iValueText]);
|
|
3163
3279
|
// this.selected = item
|
|
3164
3280
|
this.$nextTick(function () {
|
|
3165
|
-
|
|
3166
|
-
|
|
3281
|
+
_this15.$emit('selected', item);
|
|
3282
|
+
_this15.closeLayer();
|
|
3167
3283
|
});
|
|
3168
3284
|
},
|
|
3169
3285
|
adjustLayer: function adjustLayer() {
|
|
3170
|
-
var
|
|
3286
|
+
var _this16 = this;
|
|
3171
3287
|
|
|
3172
3288
|
if (this.optionDisplay !== 'none' && this.$refs.layer.show) {
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
});
|
|
3289
|
+
setTimeout(function () {
|
|
3290
|
+
_this16.$refs.layer.set(_this16.$refs.link);
|
|
3291
|
+
}, 10);
|
|
3176
3292
|
}
|
|
3177
3293
|
},
|
|
3178
3294
|
openLayer: function openLayer() {
|
|
3179
|
-
var
|
|
3295
|
+
var _this17 = this;
|
|
3180
3296
|
|
|
3181
3297
|
if (!this.disabled && this.optionDisplay !== 'none') {
|
|
3182
3298
|
this.$refs.layer.open('link');
|
|
3183
3299
|
if (this.filterable && this.$phone) {
|
|
3184
3300
|
setTimeout(function () {
|
|
3185
|
-
if (
|
|
3186
|
-
|
|
3301
|
+
if (_this17.$refs.popupFilter) {
|
|
3302
|
+
_this17.$refs.popupFilter.focus();
|
|
3187
3303
|
}
|
|
3188
|
-
|
|
3189
|
-
|
|
3304
|
+
_this17.$nextTick(function () {
|
|
3305
|
+
_this17.options = _this17.s_options.concat(_this17.anotherOptions);
|
|
3190
3306
|
});
|
|
3191
3307
|
}, 500);
|
|
3192
3308
|
}
|
|
3193
3309
|
if (this.inputable && this.$phone) {
|
|
3194
3310
|
setTimeout(function () {
|
|
3195
|
-
if (
|
|
3196
|
-
|
|
3311
|
+
if (_this17.$refs.popupInput) {
|
|
3312
|
+
_this17.$refs.popupInput.focus();
|
|
3197
3313
|
}
|
|
3198
3314
|
}, 500);
|
|
3199
3315
|
}
|
|
@@ -3250,12 +3366,12 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3250
3366
|
}
|
|
3251
3367
|
},
|
|
3252
3368
|
layerMousedown: function layerMousedown() {
|
|
3253
|
-
var
|
|
3369
|
+
var _this18 = this;
|
|
3254
3370
|
|
|
3255
3371
|
this.blurByLayer = true;
|
|
3256
3372
|
var timer = null;
|
|
3257
3373
|
timer = setTimeout(function () {
|
|
3258
|
-
|
|
3374
|
+
_this18.blurByLayer = false;
|
|
3259
3375
|
clearTimeout(timer);
|
|
3260
3376
|
timer = null;
|
|
3261
3377
|
}, 200);
|
|
@@ -3283,16 +3399,16 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3283
3399
|
}
|
|
3284
3400
|
},
|
|
3285
3401
|
inputInput: function inputInput(e) {
|
|
3286
|
-
var
|
|
3402
|
+
var _this19 = this;
|
|
3287
3403
|
|
|
3288
3404
|
if (e && e.keyCode === 13) {
|
|
3289
3405
|
this.$emit('inputEnter');
|
|
3290
3406
|
}
|
|
3291
3407
|
this.$nextTick(function () {
|
|
3292
|
-
if (
|
|
3293
|
-
|
|
3408
|
+
if (_this19.value === '') {
|
|
3409
|
+
_this19.openLayer();
|
|
3294
3410
|
} else {
|
|
3295
|
-
|
|
3411
|
+
_this19.closeLayer();
|
|
3296
3412
|
}
|
|
3297
3413
|
});
|
|
3298
3414
|
},
|
|
@@ -3307,15 +3423,15 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3307
3423
|
this.openLayer();
|
|
3308
3424
|
},
|
|
3309
3425
|
filterInput: function filterInput(e) {
|
|
3310
|
-
var
|
|
3426
|
+
var _this20 = this;
|
|
3311
3427
|
|
|
3312
3428
|
if (e && e.keyCode === 13) {
|
|
3313
3429
|
this.$emit('inputEnter');
|
|
3314
3430
|
}
|
|
3315
3431
|
this.$nextTick(function () {
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3432
|
+
_this20.inputing = true;
|
|
3433
|
+
_this20.adjustLayer();
|
|
3434
|
+
_this20.openLayer();
|
|
3319
3435
|
});
|
|
3320
3436
|
},
|
|
3321
3437
|
filterClear: function filterClear() {
|
|
@@ -3334,10 +3450,10 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3334
3450
|
}
|
|
3335
3451
|
},
|
|
3336
3452
|
multipleItemChange: function multipleItemChange(value, item) {
|
|
3337
|
-
var
|
|
3453
|
+
var _this21 = this;
|
|
3338
3454
|
|
|
3339
3455
|
var val = this.selected.map(function (option) {
|
|
3340
|
-
return option[
|
|
3456
|
+
return option[_this21.iValueText];
|
|
3341
3457
|
});
|
|
3342
3458
|
if (value) {
|
|
3343
3459
|
val.push(item[this.iValueText]);
|
|
@@ -3349,11 +3465,11 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3349
3465
|
if (this.inputable && !this.filterable) {
|
|
3350
3466
|
if (this.$phone) {
|
|
3351
3467
|
setTimeout(function () {
|
|
3352
|
-
|
|
3468
|
+
_this21.$refs.popupInput.focus();
|
|
3353
3469
|
}, 500);
|
|
3354
3470
|
} else {
|
|
3355
3471
|
setTimeout(function () {
|
|
3356
|
-
|
|
3472
|
+
_this21.$refs.input.focus();
|
|
3357
3473
|
}, 500);
|
|
3358
3474
|
}
|
|
3359
3475
|
this.multipleInputValue = '';
|
|
@@ -3361,27 +3477,27 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3361
3477
|
if (this.filterable) {
|
|
3362
3478
|
if (this.$phone) {
|
|
3363
3479
|
setTimeout(function () {
|
|
3364
|
-
|
|
3480
|
+
_this21.$refs.popupFilter.focus();
|
|
3365
3481
|
}, 500);
|
|
3366
3482
|
} else {
|
|
3367
3483
|
setTimeout(function () {
|
|
3368
|
-
|
|
3484
|
+
_this21.$refs.filter.focus();
|
|
3369
3485
|
}, 500);
|
|
3370
3486
|
}
|
|
3371
3487
|
this.multipleFilterValue = '';
|
|
3372
3488
|
}
|
|
3373
3489
|
if (this.setDataFn) {
|
|
3374
3490
|
setTimeout(function () {
|
|
3375
|
-
|
|
3491
|
+
_this21.$refs.filter.focus();
|
|
3376
3492
|
}, 500);
|
|
3377
3493
|
this.setDataInputValue = '';
|
|
3378
3494
|
}
|
|
3379
3495
|
},
|
|
3380
3496
|
removeTag: function removeTag(item) {
|
|
3381
|
-
var
|
|
3497
|
+
var _this22 = this;
|
|
3382
3498
|
|
|
3383
3499
|
var val = this.selected.map(function (option) {
|
|
3384
|
-
return option[
|
|
3500
|
+
return option[_this22.iValueText];
|
|
3385
3501
|
});
|
|
3386
3502
|
this.removeItem(val, item[this.iValueText]);
|
|
3387
3503
|
this.setSeleted(val.join(','));
|
|
@@ -3390,24 +3506,24 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3390
3506
|
if (this.filterable) {
|
|
3391
3507
|
if (this.$refs.popupFilter) {
|
|
3392
3508
|
setTimeout(function () {
|
|
3393
|
-
|
|
3509
|
+
_this22.$refs.popupFilter.focus();
|
|
3394
3510
|
}, 500);
|
|
3395
3511
|
}
|
|
3396
3512
|
} else {
|
|
3397
3513
|
if (this.$refs.popupInput) {
|
|
3398
3514
|
setTimeout(function () {
|
|
3399
|
-
|
|
3515
|
+
_this22.$refs.popupInput.focus();
|
|
3400
3516
|
}, 500);
|
|
3401
3517
|
}
|
|
3402
3518
|
}
|
|
3403
3519
|
} else {
|
|
3404
3520
|
if (this.filterable) {
|
|
3405
3521
|
setTimeout(function () {
|
|
3406
|
-
|
|
3522
|
+
_this22.$refs.filter.focus();
|
|
3407
3523
|
}, 500);
|
|
3408
3524
|
} else {
|
|
3409
3525
|
setTimeout(function () {
|
|
3410
|
-
|
|
3526
|
+
_this22.$refs.input.focus();
|
|
3411
3527
|
}, 500);
|
|
3412
3528
|
}
|
|
3413
3529
|
}
|
|
@@ -3426,7 +3542,7 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3426
3542
|
}
|
|
3427
3543
|
},
|
|
3428
3544
|
removeItem: function removeItem(obj, val) {
|
|
3429
|
-
var
|
|
3545
|
+
var _this23 = this;
|
|
3430
3546
|
|
|
3431
3547
|
var index = void 0;
|
|
3432
3548
|
|
|
@@ -3450,7 +3566,7 @@ var lib_locale_ = __webpack_require__(3);
|
|
|
3450
3566
|
// 对象数组
|
|
3451
3567
|
else {
|
|
3452
3568
|
index = obj.findIndex(function (item) {
|
|
3453
|
-
return item[
|
|
3569
|
+
return item[_this23.iValueText] === val;
|
|
3454
3570
|
});
|
|
3455
3571
|
obj.splice(index, 1);
|
|
3456
3572
|
}
|