@cloudbase/weda-ui-mp 3.20.3 → 3.20.5
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.
|
@@ -4,6 +4,7 @@ import itemBehavior from '../form-field-behavior/item-behavior';
|
|
|
4
4
|
import { convertFixedIcon, SELECT_ICON_H5 } from '../../utils/getFormLegacy';
|
|
5
5
|
import debounce from '../../utils/debounce';
|
|
6
6
|
import { arrayToMap, getSelected } from '../../utils/tool';
|
|
7
|
+
import { isFormatNeedFetch } from './select/formats-util';
|
|
7
8
|
|
|
8
9
|
Component({
|
|
9
10
|
options: { virtualHost: true, styleIsolation: 'shared' },
|
|
@@ -80,7 +81,9 @@ Component({
|
|
|
80
81
|
this.setData({ _suffixType, _suffixIcon });
|
|
81
82
|
},
|
|
82
83
|
range: function (range) {
|
|
83
|
-
|
|
84
|
+
if (!isFormatNeedFetch(this.data.format)) {
|
|
85
|
+
this.updateSelect({ detail: { value: this.data.value, option: range } });
|
|
86
|
+
}
|
|
84
87
|
},
|
|
85
88
|
selectFieldLabel: function (selectFieldLabel) {
|
|
86
89
|
this.setData({
|
|
@@ -108,6 +108,7 @@ Component({
|
|
|
108
108
|
currentPageNo: 1,
|
|
109
109
|
_filterable: false,
|
|
110
110
|
hasNextPage: true,
|
|
111
|
+
preDisplayValue: '',
|
|
111
112
|
},
|
|
112
113
|
lifetimes: {
|
|
113
114
|
attached() {
|
|
@@ -154,6 +155,15 @@ Component({
|
|
|
154
155
|
displayValue: label,
|
|
155
156
|
});
|
|
156
157
|
},
|
|
158
|
+
displayValue: function (displayValue) {
|
|
159
|
+
if (!deepEqual(this.data.preDisplayValue, displayValue)) {
|
|
160
|
+
const { value, option } = this.data;
|
|
161
|
+
this.triggerEvent('updateSelect', { value, option });
|
|
162
|
+
this.setData({
|
|
163
|
+
preDisplayValue: displayValue,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
},
|
|
157
167
|
enumName: function (enumName) {
|
|
158
168
|
if (this.properties.format === 'x-enum' && enumName) {
|
|
159
169
|
this._fetchEnumData();
|
|
@@ -276,7 +286,6 @@ Component({
|
|
|
276
286
|
currentPageNo: pageNo,
|
|
277
287
|
hasNextPage: stringRange?.length < res?.total,
|
|
278
288
|
});
|
|
279
|
-
this.triggerEvent('updateSelect', { value: value, option: stringRange });
|
|
280
289
|
},
|
|
281
290
|
_childFetchData: function (data) {
|
|
282
291
|
if (this.data.hasNextPage) {
|
|
@@ -4,6 +4,7 @@ import itemBehavior from '../form-field-behavior/item-behavior';
|
|
|
4
4
|
import { convertFixedIcon, SELECT_ICON_H5 } from '../../utils/getFormLegacy';
|
|
5
5
|
import { safeObj, arrayToMap, getSelected } from '../../utils/tool';
|
|
6
6
|
import debounce from '../../utils/debounce';
|
|
7
|
+
import { isFormatNeedFetch } from '../wd-select/select/formats-util';
|
|
7
8
|
|
|
8
9
|
Component({
|
|
9
10
|
options: { virtualHost: true, styleIsolation: 'shared' },
|
|
@@ -83,7 +84,9 @@ Component({
|
|
|
83
84
|
this.setData({ _suffixType, _suffixIcon });
|
|
84
85
|
},
|
|
85
86
|
range: function (range) {
|
|
86
|
-
|
|
87
|
+
if (!isFormatNeedFetch(this.data.format)) {
|
|
88
|
+
this.updateSelect({ detail: { value: this.data.value, option: range } });
|
|
89
|
+
}
|
|
87
90
|
},
|
|
88
91
|
selectFieldLabel: function (selectFieldLabel) {
|
|
89
92
|
this.setData({
|