szld-libs 0.2.82 → 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 +2730 -2722
- package/dist/szld-components.umd.js +28 -28
- package/es/utils/method.d.ts +1 -1
- package/es/utils/method.js +22 -18
- package/lib/utils/method.d.ts +1 -1
- package/lib/utils/method.js +22 -18
- 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
|
@@ -33,7 +33,8 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
33
33
|
const processAttrList = (attrList, item) => {
|
|
34
34
|
var _a;
|
|
35
35
|
if (!(item == null ? void 0 : item.json)) {
|
|
36
|
-
|
|
36
|
+
message.error("item?.json不能为空,请使用handleAttrList方法处理初始化渲染表单数据");
|
|
37
|
+
return;
|
|
37
38
|
}
|
|
38
39
|
try {
|
|
39
40
|
if ((_a = item == null ? void 0 : item.json) == null ? void 0 : _a["properties-multiple"]) {
|
|
@@ -332,26 +333,29 @@ const handleAttrListToObj = (attrList) => {
|
|
|
332
333
|
const handleAttrListToObjDetail = async ({
|
|
333
334
|
attrList,
|
|
334
335
|
params,
|
|
335
|
-
commonRequest
|
|
336
|
+
commonRequest,
|
|
337
|
+
extra = {}
|
|
336
338
|
}) => {
|
|
337
339
|
var _a, _b;
|
|
338
340
|
const res = await commonRequest("YLFWLRDataDetails", params);
|
|
339
|
-
const detail = (_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) == null ? void 0 : _b[0];
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
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;
|
|
355
359
|
};
|
|
356
360
|
const handleUrlOptions = (val, delimiter, list) => {
|
|
357
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
|
@@ -35,7 +35,8 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
35
35
|
const processAttrList = (attrList, item) => {
|
|
36
36
|
var _a;
|
|
37
37
|
if (!(item == null ? void 0 : item.json)) {
|
|
38
|
-
|
|
38
|
+
antd.message.error("item?.json不能为空,请使用handleAttrList方法处理初始化渲染表单数据");
|
|
39
|
+
return;
|
|
39
40
|
}
|
|
40
41
|
try {
|
|
41
42
|
if ((_a = item == null ? void 0 : item.json) == null ? void 0 : _a["properties-multiple"]) {
|
|
@@ -334,26 +335,29 @@ const handleAttrListToObj = (attrList) => {
|
|
|
334
335
|
const handleAttrListToObjDetail = async ({
|
|
335
336
|
attrList,
|
|
336
337
|
params,
|
|
337
|
-
commonRequest
|
|
338
|
+
commonRequest,
|
|
339
|
+
extra = {}
|
|
338
340
|
}) => {
|
|
339
341
|
var _a, _b;
|
|
340
342
|
const res = await commonRequest("YLFWLRDataDetails", params);
|
|
341
|
-
const detail = (_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) == null ? void 0 : _b[0];
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
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;
|
|
357
361
|
};
|
|
358
362
|
const handleUrlOptions = (val, delimiter, list) => {
|
|
359
363
|
let arr = [];
|