@cloudbase/weda-ui-mp 3.20.5 → 3.21.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.
|
@@ -6,6 +6,7 @@ import deepEqual from '../../../utils/deepEqual';
|
|
|
6
6
|
import { getDefaultQuery } from '../../../utils/getModelParams';
|
|
7
7
|
import { isFormatNeedFetch, isFormatWithFilterable } from './formats-util';
|
|
8
8
|
import { textToString } from '../../../utils/platform';
|
|
9
|
+
import { errorHandler } from '../../../utils/error';
|
|
9
10
|
|
|
10
11
|
const STATUS_CLOSED = 0;
|
|
11
12
|
const STATUS_LOADING = 1;
|
|
@@ -346,28 +347,43 @@ Component({
|
|
|
346
347
|
},
|
|
347
348
|
// 获取通用选项集列表
|
|
348
349
|
_fetchEnumData: async function () {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
350
|
+
try {
|
|
351
|
+
let data = await callWedaApi({
|
|
352
|
+
action: 'DescribeGeneralOptionsDetailList',
|
|
353
|
+
data: {
|
|
354
|
+
OptNameList: [this.properties.enumName],
|
|
355
|
+
PageIndex: 1,
|
|
356
|
+
PageSize: 10,
|
|
357
|
+
},
|
|
358
|
+
});
|
|
357
359
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
360
|
+
const config = destr(data?.Items?.[0]?.Config) ?? [];
|
|
361
|
+
const option = config.map((item) => {
|
|
362
|
+
return {
|
|
363
|
+
label: item.value,
|
|
364
|
+
value: item.key,
|
|
365
|
+
name: item.value,
|
|
366
|
+
};
|
|
367
|
+
});
|
|
368
|
+
const label = this.getLabels(this.data.value, option);
|
|
369
|
+
this.setData({
|
|
370
|
+
selectRange: option.map((item) => item.label),
|
|
371
|
+
option,
|
|
372
|
+
loadStatus: option.length > 0 ? 0 : STATUS_EMPTY,
|
|
373
|
+
displayValue: label,
|
|
374
|
+
});
|
|
375
|
+
} catch (error) {
|
|
376
|
+
errorHandler({
|
|
377
|
+
code: 'wdSelect.GetEnumDataError',
|
|
378
|
+
error: error,
|
|
379
|
+
});
|
|
380
|
+
this.setData({
|
|
381
|
+
loadStatus: STATUS_FAILED,
|
|
382
|
+
selectRange: [],
|
|
383
|
+
option: [],
|
|
384
|
+
displayValue: '',
|
|
385
|
+
});
|
|
386
|
+
}
|
|
371
387
|
},
|
|
372
388
|
getUniqueOption: function (option) {
|
|
373
389
|
const optionMap = option.reduce((acc, item) => {
|