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.
@@ -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,
@@ -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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.94",
4
+ "version": "0.2.96",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",