eoss-mobiles 0.2.30 → 0.2.31
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/eoss-mobile.common.js +63 -46
- package/lib/index.js +1 -1
- package/lib/picker.js +57 -40
- package/package.json +1 -1
- package/packages/picker/src/main.vue +20 -2
- package/src/index.js +1 -1
package/lib/picker.js
CHANGED
|
@@ -2039,7 +2039,7 @@ module.exports = require("sm-crypto");
|
|
|
2039
2039
|
// ESM COMPAT FLAG
|
|
2040
2040
|
__webpack_require__.r(__webpack_exports__);
|
|
2041
2041
|
|
|
2042
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/picker/src/main.vue?vue&type=template&id=
|
|
2042
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/picker/src/main.vue?vue&type=template&id=6f8d4ed8&
|
|
2043
2043
|
var render = function () {
|
|
2044
2044
|
var _vm = this
|
|
2045
2045
|
var _h = _vm.$createElement
|
|
@@ -2311,7 +2311,7 @@ var staticRenderFns = []
|
|
|
2311
2311
|
render._withStripped = true
|
|
2312
2312
|
|
|
2313
2313
|
|
|
2314
|
-
// CONCATENATED MODULE: ./packages/picker/src/main.vue?vue&type=template&id=
|
|
2314
|
+
// CONCATENATED MODULE: ./packages/picker/src/main.vue?vue&type=template&id=6f8d4ed8&
|
|
2315
2315
|
|
|
2316
2316
|
// EXTERNAL MODULE: ./src/config/api.js
|
|
2317
2317
|
var api = __webpack_require__(2);
|
|
@@ -2525,6 +2525,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2525
2525
|
type: String,
|
|
2526
2526
|
default: 'name'
|
|
2527
2527
|
},
|
|
2528
|
+
objectType: {
|
|
2529
|
+
type: Boolean,
|
|
2530
|
+
default: true
|
|
2531
|
+
},
|
|
2528
2532
|
sysAppCode: {
|
|
2529
2533
|
type: String,
|
|
2530
2534
|
default: ''
|
|
@@ -2573,7 +2577,20 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2573
2577
|
return this.getValue();
|
|
2574
2578
|
},
|
|
2575
2579
|
set: function set(val) {
|
|
2576
|
-
this
|
|
2580
|
+
var _this = this;
|
|
2581
|
+
|
|
2582
|
+
if (!this.objectType && val.length === undefined) {
|
|
2583
|
+
this.$emit('input', val[this.sysAppCode ? 'cciValue' : this.valueKey]);
|
|
2584
|
+
} else if (!this.objectType && val.length != undefined) {
|
|
2585
|
+
val.map(function (x) {
|
|
2586
|
+
if ((typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object') {
|
|
2587
|
+
x = x[_this.sysAppCode ? 'cciValue' : _this.valueKey];
|
|
2588
|
+
}
|
|
2589
|
+
});
|
|
2590
|
+
this.$emit('input', val);
|
|
2591
|
+
} else {
|
|
2592
|
+
this.$emit('input', val);
|
|
2593
|
+
}
|
|
2577
2594
|
}
|
|
2578
2595
|
}
|
|
2579
2596
|
},
|
|
@@ -2621,7 +2638,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2621
2638
|
}
|
|
2622
2639
|
},
|
|
2623
2640
|
mounted: function mounted() {
|
|
2624
|
-
var
|
|
2641
|
+
var _this2 = this;
|
|
2625
2642
|
|
|
2626
2643
|
if ((this.sysAppCode || this.url) && this.newColumns.length == 0 && !this.isCheck) {
|
|
2627
2644
|
this.getSysCode();
|
|
@@ -2636,7 +2653,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2636
2653
|
} else if (this.isCheck) {
|
|
2637
2654
|
var _data = this.value;
|
|
2638
2655
|
_data.map(function (item) {
|
|
2639
|
-
|
|
2656
|
+
_this2.checkList.push(item[_this2.valueKey] || item.value || item);
|
|
2640
2657
|
});
|
|
2641
2658
|
}
|
|
2642
2659
|
},
|
|
@@ -2677,13 +2694,13 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2677
2694
|
this.$refs.checkboxes[index].toggle();
|
|
2678
2695
|
},
|
|
2679
2696
|
onConfirm: function onConfirm(value, isConfirm) {
|
|
2680
|
-
var
|
|
2697
|
+
var _this3 = this;
|
|
2681
2698
|
|
|
2682
2699
|
if (isConfirm) {
|
|
2683
2700
|
if (this.isCheck) {
|
|
2684
2701
|
var data = [];
|
|
2685
2702
|
this.newColumns.filter(function (x) {
|
|
2686
|
-
|
|
2703
|
+
_this3.checkList.find(function (y) {
|
|
2687
2704
|
if (x.value === y) {
|
|
2688
2705
|
data.push(x);
|
|
2689
2706
|
}
|
|
@@ -2697,7 +2714,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2697
2714
|
if (this.isCheck) {
|
|
2698
2715
|
this.checkList = [];
|
|
2699
2716
|
this.pickerValue.map(function (x) {
|
|
2700
|
-
|
|
2717
|
+
_this3.checkList.push(x.value);
|
|
2701
2718
|
});
|
|
2702
2719
|
}
|
|
2703
2720
|
}
|
|
@@ -2705,15 +2722,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2705
2722
|
this.showPicker = false;
|
|
2706
2723
|
},
|
|
2707
2724
|
getValue: function getValue() {
|
|
2708
|
-
var
|
|
2725
|
+
var _this4 = this;
|
|
2709
2726
|
|
|
2710
2727
|
var value = '';
|
|
2711
2728
|
if (this.isCheck) {
|
|
2712
2729
|
var val = [];
|
|
2713
2730
|
if (this.newColumns && this.newColumns.length > 0) {
|
|
2714
2731
|
this.newColumns.filter(function (x) {
|
|
2715
|
-
|
|
2716
|
-
if (x[
|
|
2732
|
+
_this4.value.find(function (y) {
|
|
2733
|
+
if (x[_this4.valueKey] == y || x[_this4.valueKey] == y.value) {
|
|
2717
2734
|
val.push(x);
|
|
2718
2735
|
}
|
|
2719
2736
|
});
|
|
@@ -2731,7 +2748,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2731
2748
|
this.newColumns.map(function (x, i) {
|
|
2732
2749
|
if (typeof x === 'string' && value.indexOf(x) != -1) {
|
|
2733
2750
|
index = i;
|
|
2734
|
-
} else if (x[
|
|
2751
|
+
} else if (x[_this4.newValueKey] == value || x[_this4.newValueKey].indexOf(value) != -1) {
|
|
2735
2752
|
index = i;
|
|
2736
2753
|
}
|
|
2737
2754
|
});
|
|
@@ -2739,8 +2756,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2739
2756
|
} else {
|
|
2740
2757
|
var list = [];
|
|
2741
2758
|
this.value.map(function (item) {
|
|
2742
|
-
if (item[
|
|
2743
|
-
list.push(item[
|
|
2759
|
+
if (item[_this4.labelKey] || item[_this4.newValueKey]) {
|
|
2760
|
+
list.push(item[_this4.labelKey] || item[_this4.newValueKey]);
|
|
2744
2761
|
} else if (typeof item === 'string') {
|
|
2745
2762
|
list.push(item);
|
|
2746
2763
|
}
|
|
@@ -2750,7 +2767,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2750
2767
|
this.newColumns.map(function (x, i) {
|
|
2751
2768
|
if (typeof x === 'string' && value.indexOf(x) != -1) {
|
|
2752
2769
|
_index = i;
|
|
2753
|
-
} else if (x[
|
|
2770
|
+
} else if (x[_this4.newValueKey] === value) {
|
|
2754
2771
|
_index = i;
|
|
2755
2772
|
}
|
|
2756
2773
|
});
|
|
@@ -2763,9 +2780,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2763
2780
|
if (typeof x === 'string' && value.indexOf(x) != -1) {
|
|
2764
2781
|
_index2 = i;
|
|
2765
2782
|
value = x;
|
|
2766
|
-
} else if (x[
|
|
2783
|
+
} else if (x[_this4.newValueKey] === value) {
|
|
2767
2784
|
_index2 = i;
|
|
2768
|
-
value = x[
|
|
2785
|
+
value = x[_this4.labelKey] || x[_this4.newValueKey];
|
|
2769
2786
|
}
|
|
2770
2787
|
});
|
|
2771
2788
|
this.newDefaultIndex = _index2;
|
|
@@ -2775,7 +2792,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2775
2792
|
return value;
|
|
2776
2793
|
},
|
|
2777
2794
|
getSysCode: function getSysCode() {
|
|
2778
|
-
var
|
|
2795
|
+
var _this5 = this;
|
|
2779
2796
|
|
|
2780
2797
|
var url = this.url,
|
|
2781
2798
|
method = this.method,
|
|
@@ -2798,45 +2815,45 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
|
|
|
2798
2815
|
rCode = res.rCode,
|
|
2799
2816
|
results = res.results;
|
|
2800
2817
|
|
|
2801
|
-
|
|
2818
|
+
_this5.listLoading = false;
|
|
2802
2819
|
if (status == 'success' || rCode === 0 || status === true) {
|
|
2803
|
-
var info =
|
|
2820
|
+
var info = _this5.resultsName ? data ? data[_this5.resultsName] : results[_this5.resultsName] : data ? data : results;
|
|
2804
2821
|
info.map(function (x) {
|
|
2805
|
-
if (
|
|
2806
|
-
x.name = x[sysAppCode ? 'shortName' :
|
|
2822
|
+
if (_this5.isCheck) {
|
|
2823
|
+
x.name = x[sysAppCode ? 'shortName' : _this5.labelKey] && x[sysAppCode ? 'shortName' : _this5.labelKey].replace(/<[^>]+>/g, '');
|
|
2807
2824
|
} else {
|
|
2808
|
-
x.name = x[sysAppCode ? 'shortName' :
|
|
2825
|
+
x.name = x[sysAppCode ? 'shortName' : _this5.labelKey];
|
|
2809
2826
|
}
|
|
2810
|
-
x.value = x[sysAppCode ? 'cciValue' :
|
|
2827
|
+
x.value = x[sysAppCode ? 'cciValue' : _this5.valueKey];
|
|
2811
2828
|
});
|
|
2812
2829
|
if (data && data.totalCount) {
|
|
2813
|
-
|
|
2814
|
-
if (data.totalCount ===
|
|
2815
|
-
|
|
2830
|
+
_this5.total = data.totalCount;
|
|
2831
|
+
if (data.totalCount === _this5.newColumns.length) {
|
|
2832
|
+
_this5.listFinished = true;
|
|
2816
2833
|
} else {
|
|
2817
|
-
if (
|
|
2818
|
-
|
|
2834
|
+
if (_this5.newColumns.length != 0) {
|
|
2835
|
+
_this5.newColumns.push.apply(_this5.newColumns, info);
|
|
2819
2836
|
} else {
|
|
2820
|
-
|
|
2837
|
+
_this5.newColumns = info;
|
|
2821
2838
|
}
|
|
2822
|
-
|
|
2839
|
+
_this5.pageIndex = res.data.nextPageNo;
|
|
2823
2840
|
}
|
|
2824
2841
|
} else {
|
|
2825
|
-
|
|
2826
|
-
|
|
2842
|
+
_this5.listFinished = true;
|
|
2843
|
+
_this5.newColumns = info;
|
|
2827
2844
|
}
|
|
2828
|
-
if (
|
|
2829
|
-
|
|
2830
|
-
|
|
2845
|
+
if (_this5.beforResponse) {
|
|
2846
|
+
_this5.newColumns = _this5.beforResponse(_this5.newColumns);
|
|
2847
|
+
_this5.getValue();
|
|
2831
2848
|
} else {
|
|
2832
|
-
|
|
2849
|
+
_this5.getValue();
|
|
2833
2850
|
}
|
|
2834
2851
|
} else {
|
|
2835
|
-
|
|
2852
|
+
_this5.$toast(message);
|
|
2836
2853
|
}
|
|
2837
|
-
|
|
2854
|
+
_this5.newLoading = false;
|
|
2838
2855
|
}).catch(function (err) {
|
|
2839
|
-
|
|
2856
|
+
_this5.$toast(err.message);
|
|
2840
2857
|
});
|
|
2841
2858
|
},
|
|
2842
2859
|
handlePicker: function handlePicker() {
|
package/package.json
CHANGED
|
@@ -198,6 +198,10 @@ export default {
|
|
|
198
198
|
type: String,
|
|
199
199
|
default: 'name'
|
|
200
200
|
},
|
|
201
|
+
objectType: {
|
|
202
|
+
type: Boolean,
|
|
203
|
+
default: true
|
|
204
|
+
},
|
|
201
205
|
sysAppCode: {
|
|
202
206
|
type: String,
|
|
203
207
|
default: ''
|
|
@@ -244,7 +248,21 @@ export default {
|
|
|
244
248
|
return this.getValue();
|
|
245
249
|
},
|
|
246
250
|
set(val) {
|
|
247
|
-
this
|
|
251
|
+
if (!this.objectType && val.length === undefined) {
|
|
252
|
+
this.$emit(
|
|
253
|
+
'input',
|
|
254
|
+
val[this.sysAppCode ? 'cciValue' : this.valueKey]
|
|
255
|
+
);
|
|
256
|
+
} else if (!this.objectType && val.length != undefined) {
|
|
257
|
+
val.map(x => {
|
|
258
|
+
if (typeof x === 'object') {
|
|
259
|
+
x = x[this.sysAppCode ? 'cciValue' : this.valueKey];
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
this.$emit('input', val);
|
|
263
|
+
} else {
|
|
264
|
+
this.$emit('input', val);
|
|
265
|
+
}
|
|
248
266
|
}
|
|
249
267
|
}
|
|
250
268
|
},
|
|
@@ -459,7 +477,7 @@ export default {
|
|
|
459
477
|
.then(res => {
|
|
460
478
|
const { status, data, message, rCode, results } = res;
|
|
461
479
|
this.listLoading = false;
|
|
462
|
-
if (status == 'success' || rCode === 0|| status === true) {
|
|
480
|
+
if (status == 'success' || rCode === 0 || status === true) {
|
|
463
481
|
let info = this.resultsName
|
|
464
482
|
? data
|
|
465
483
|
? data[this.resultsName]
|