@hzab/list-render 1.10.5 → 1.10.7
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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/common/utils.js +6 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/common/utils.js
CHANGED
|
@@ -70,11 +70,11 @@ export function getVal(field = {}, data = {}, opt = {}) {
|
|
|
70
70
|
Array.isArray(dataSource)
|
|
71
71
|
) {
|
|
72
72
|
if (!Array.isArray(val)) {
|
|
73
|
-
return
|
|
73
|
+
return getFieldOptItByVal(val, field, opt)?.label || val;
|
|
74
74
|
} else if (Array.isArray(val)) {
|
|
75
75
|
let _val = [];
|
|
76
76
|
val.forEach((valIt) => {
|
|
77
|
-
_val.push(
|
|
77
|
+
_val.push(getFieldOptItByVal(val, field, opt)?.label || valIt);
|
|
78
78
|
});
|
|
79
79
|
val = _val;
|
|
80
80
|
}
|
|
@@ -161,7 +161,10 @@ export const getFieldOptItByVal = function (val, field, opt) {
|
|
|
161
161
|
: Array.isArray(field.options)
|
|
162
162
|
? field.options
|
|
163
163
|
: field.dataSource || [];
|
|
164
|
-
return getOptItByVal(val, options, {
|
|
164
|
+
return getOptItByVal(val, options, {
|
|
165
|
+
fieldNames: field.fieldNames || field["x-component-props"]?.fieldNames,
|
|
166
|
+
...opt,
|
|
167
|
+
});
|
|
165
168
|
};
|
|
166
169
|
|
|
167
170
|
/**
|