szld-libs 0.2.94 → 0.2.96
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/dist/szld-components.es.js +130 -128
- package/dist/szld-components.umd.js +18 -18
- package/es/utils/method.js +7 -0
- package/lib/utils/method.js +7 -0
- package/package.json +1 -1
package/es/utils/method.js
CHANGED
|
@@ -313,6 +313,7 @@ const handleAttrListToObj = (attrList) => {
|
|
|
313
313
|
const { attrvalue = [], children = [] } = item || {};
|
|
314
314
|
if (Array.isArray(attrvalue) && (attrvalue == null ? void 0 : attrvalue.length)) {
|
|
315
315
|
item.children = attrvalue.map((v) => {
|
|
316
|
+
return handleObjDetailToSignleAttrList((children == null ? void 0 : children[0]) || [], v);
|
|
316
317
|
});
|
|
317
318
|
result[key] = {
|
|
318
319
|
asid: ((_e = (_d = (_c = item.children) == null ? void 0 : _c[0]) == null ? void 0 : _d[0]) == null ? void 0 : _e.asid) || "",
|
|
@@ -466,6 +467,12 @@ const handleSelectOptions = async ({
|
|
|
466
467
|
}
|
|
467
468
|
return options;
|
|
468
469
|
};
|
|
470
|
+
const handleObjDetailToSignleAttrList = (attrList, detail) => {
|
|
471
|
+
return attrList.map((item) => ({
|
|
472
|
+
...item,
|
|
473
|
+
attrvalue: detail[item.attrid] || ""
|
|
474
|
+
}));
|
|
475
|
+
};
|
|
469
476
|
export {
|
|
470
477
|
base64ToString,
|
|
471
478
|
getJson,
|
package/lib/utils/method.js
CHANGED
|
@@ -315,6 +315,7 @@ const handleAttrListToObj = (attrList) => {
|
|
|
315
315
|
const { attrvalue = [], children = [] } = item || {};
|
|
316
316
|
if (Array.isArray(attrvalue) && (attrvalue == null ? void 0 : attrvalue.length)) {
|
|
317
317
|
item.children = attrvalue.map((v) => {
|
|
318
|
+
return handleObjDetailToSignleAttrList((children == null ? void 0 : children[0]) || [], v);
|
|
318
319
|
});
|
|
319
320
|
result[key] = {
|
|
320
321
|
asid: ((_e = (_d = (_c = item.children) == null ? void 0 : _c[0]) == null ? void 0 : _d[0]) == null ? void 0 : _e.asid) || "",
|
|
@@ -468,6 +469,12 @@ const handleSelectOptions = async ({
|
|
|
468
469
|
}
|
|
469
470
|
return options;
|
|
470
471
|
};
|
|
472
|
+
const handleObjDetailToSignleAttrList = (attrList, detail) => {
|
|
473
|
+
return attrList.map((item) => ({
|
|
474
|
+
...item,
|
|
475
|
+
attrvalue: detail[item.attrid] || ""
|
|
476
|
+
}));
|
|
477
|
+
};
|
|
471
478
|
exports.base64ToString = base64ToString;
|
|
472
479
|
exports.getJson = getJson;
|
|
473
480
|
exports.handleAttrList = handleAttrList;
|