szld-libs 0.2.83 → 0.2.84
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 +903 -898
- package/dist/szld-components.umd.js +20 -20
- package/es/utils/method.d.ts +1 -1
- package/es/utils/method.js +20 -17
- package/lib/utils/method.d.ts +1 -1
- package/lib/utils/method.js +20 -17
- package/package.json +1 -1
package/es/utils/method.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ export declare const handleAttrListToObj: (attrList: any[]) => {
|
|
|
84
84
|
* @param param0
|
|
85
85
|
* @returns
|
|
86
86
|
*/
|
|
87
|
-
export declare const handleAttrListToObjDetail: ({ attrList, params, commonRequest, }: {
|
|
87
|
+
export declare const handleAttrListToObjDetail: ({ attrList, params, commonRequest, extra, }: {
|
|
88
88
|
attrList: any[];
|
|
89
89
|
params: any;
|
|
90
90
|
extra?: {
|
package/es/utils/method.js
CHANGED
|
@@ -333,26 +333,29 @@ const handleAttrListToObj = (attrList) => {
|
|
|
333
333
|
const handleAttrListToObjDetail = async ({
|
|
334
334
|
attrList,
|
|
335
335
|
params,
|
|
336
|
-
commonRequest
|
|
336
|
+
commonRequest,
|
|
337
|
+
extra = {}
|
|
337
338
|
}) => {
|
|
338
339
|
var _a, _b;
|
|
339
340
|
const res = await commonRequest("YLFWLRDataDetails", params);
|
|
340
|
-
const detail = (_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) == null ? void 0 : _b[0];
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
341
|
+
const detail = ((_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) == null ? void 0 : _b[0]) || {};
|
|
342
|
+
const processedAttrList = await Promise.all(
|
|
343
|
+
(attrList == null ? void 0 : attrList.map(async (v) => {
|
|
344
|
+
const currentItem = { ...v, ...extra };
|
|
345
|
+
currentItem.attrvalue = (detail == null ? void 0 : detail[v.attrid]) || "";
|
|
346
|
+
if (v.attrtype === 1 && Array.isArray(v.children) && v.children.length > 0) {
|
|
347
|
+
const childParams = (detail == null ? void 0 : detail[v.attrid]) || {};
|
|
348
|
+
currentItem.children = await handleAttrListToObjDetail({
|
|
349
|
+
attrList: v.children,
|
|
350
|
+
params: childParams,
|
|
351
|
+
extra,
|
|
352
|
+
commonRequest
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
return currentItem;
|
|
356
|
+
})) || []
|
|
357
|
+
);
|
|
358
|
+
return processedAttrList;
|
|
356
359
|
};
|
|
357
360
|
const handleUrlOptions = (val, delimiter, list) => {
|
|
358
361
|
let arr = [];
|
package/lib/utils/method.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ export declare const handleAttrListToObj: (attrList: any[]) => {
|
|
|
84
84
|
* @param param0
|
|
85
85
|
* @returns
|
|
86
86
|
*/
|
|
87
|
-
export declare const handleAttrListToObjDetail: ({ attrList, params, commonRequest, }: {
|
|
87
|
+
export declare const handleAttrListToObjDetail: ({ attrList, params, commonRequest, extra, }: {
|
|
88
88
|
attrList: any[];
|
|
89
89
|
params: any;
|
|
90
90
|
extra?: {
|
package/lib/utils/method.js
CHANGED
|
@@ -335,26 +335,29 @@ const handleAttrListToObj = (attrList) => {
|
|
|
335
335
|
const handleAttrListToObjDetail = async ({
|
|
336
336
|
attrList,
|
|
337
337
|
params,
|
|
338
|
-
commonRequest
|
|
338
|
+
commonRequest,
|
|
339
|
+
extra = {}
|
|
339
340
|
}) => {
|
|
340
341
|
var _a, _b;
|
|
341
342
|
const res = await commonRequest("YLFWLRDataDetails", params);
|
|
342
|
-
const detail = (_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) == null ? void 0 : _b[0];
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
343
|
+
const detail = ((_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) == null ? void 0 : _b[0]) || {};
|
|
344
|
+
const processedAttrList = await Promise.all(
|
|
345
|
+
(attrList == null ? void 0 : attrList.map(async (v) => {
|
|
346
|
+
const currentItem = { ...v, ...extra };
|
|
347
|
+
currentItem.attrvalue = (detail == null ? void 0 : detail[v.attrid]) || "";
|
|
348
|
+
if (v.attrtype === 1 && Array.isArray(v.children) && v.children.length > 0) {
|
|
349
|
+
const childParams = (detail == null ? void 0 : detail[v.attrid]) || {};
|
|
350
|
+
currentItem.children = await handleAttrListToObjDetail({
|
|
351
|
+
attrList: v.children,
|
|
352
|
+
params: childParams,
|
|
353
|
+
extra,
|
|
354
|
+
commonRequest
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
return currentItem;
|
|
358
|
+
})) || []
|
|
359
|
+
);
|
|
360
|
+
return processedAttrList;
|
|
358
361
|
};
|
|
359
362
|
const handleUrlOptions = (val, delimiter, list) => {
|
|
360
363
|
let arr = [];
|