szld-libs 0.2.83 → 0.2.85
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 +1599 -1598
- package/dist/szld-components.umd.js +20 -20
- package/es/utils/method.d.ts +1 -1
- package/es/utils/method.js +20 -21
- package/lib/utils/method.d.ts +1 -1
- package/lib/utils/method.js +20 -21
- 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
|
@@ -32,10 +32,6 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
32
32
|
let uploadedFiles = [];
|
|
33
33
|
const processAttrList = (attrList, item) => {
|
|
34
34
|
var _a;
|
|
35
|
-
if (!(item == null ? void 0 : item.json)) {
|
|
36
|
-
message.error("item?.json不能为空,请使用handleAttrList方法处理初始化渲染表单数据");
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
35
|
try {
|
|
40
36
|
if ((_a = item == null ? void 0 : item.json) == null ? void 0 : _a["properties-multiple"]) {
|
|
41
37
|
const attrValue = allValues[item.attrid];
|
|
@@ -333,26 +329,29 @@ const handleAttrListToObj = (attrList) => {
|
|
|
333
329
|
const handleAttrListToObjDetail = async ({
|
|
334
330
|
attrList,
|
|
335
331
|
params,
|
|
336
|
-
commonRequest
|
|
332
|
+
commonRequest,
|
|
333
|
+
extra = {}
|
|
337
334
|
}) => {
|
|
338
335
|
var _a, _b;
|
|
339
336
|
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
|
-
|
|
337
|
+
const detail = ((_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) == null ? void 0 : _b[0]) || {};
|
|
338
|
+
const processedAttrList = await Promise.all(
|
|
339
|
+
(attrList == null ? void 0 : attrList.map(async (v) => {
|
|
340
|
+
const currentItem = { ...v, ...extra };
|
|
341
|
+
currentItem.attrvalue = (detail == null ? void 0 : detail[v.attrid]) || "";
|
|
342
|
+
if (v.attrtype === 1 && Array.isArray(v.children) && v.children.length > 0) {
|
|
343
|
+
const childParams = (detail == null ? void 0 : detail[v.attrid]) || {};
|
|
344
|
+
currentItem.children = await handleAttrListToObjDetail({
|
|
345
|
+
attrList: v.children,
|
|
346
|
+
params: childParams,
|
|
347
|
+
extra,
|
|
348
|
+
commonRequest
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
return currentItem;
|
|
352
|
+
})) || []
|
|
353
|
+
);
|
|
354
|
+
return processedAttrList;
|
|
356
355
|
};
|
|
357
356
|
const handleUrlOptions = (val, delimiter, list) => {
|
|
358
357
|
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
|
@@ -34,10 +34,6 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
34
34
|
let uploadedFiles = [];
|
|
35
35
|
const processAttrList = (attrList, item) => {
|
|
36
36
|
var _a;
|
|
37
|
-
if (!(item == null ? void 0 : item.json)) {
|
|
38
|
-
antd.message.error("item?.json不能为空,请使用handleAttrList方法处理初始化渲染表单数据");
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
37
|
try {
|
|
42
38
|
if ((_a = item == null ? void 0 : item.json) == null ? void 0 : _a["properties-multiple"]) {
|
|
43
39
|
const attrValue = allValues[item.attrid];
|
|
@@ -335,26 +331,29 @@ const handleAttrListToObj = (attrList) => {
|
|
|
335
331
|
const handleAttrListToObjDetail = async ({
|
|
336
332
|
attrList,
|
|
337
333
|
params,
|
|
338
|
-
commonRequest
|
|
334
|
+
commonRequest,
|
|
335
|
+
extra = {}
|
|
339
336
|
}) => {
|
|
340
337
|
var _a, _b;
|
|
341
338
|
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
|
-
|
|
339
|
+
const detail = ((_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) == null ? void 0 : _b[0]) || {};
|
|
340
|
+
const processedAttrList = await Promise.all(
|
|
341
|
+
(attrList == null ? void 0 : attrList.map(async (v) => {
|
|
342
|
+
const currentItem = { ...v, ...extra };
|
|
343
|
+
currentItem.attrvalue = (detail == null ? void 0 : detail[v.attrid]) || "";
|
|
344
|
+
if (v.attrtype === 1 && Array.isArray(v.children) && v.children.length > 0) {
|
|
345
|
+
const childParams = (detail == null ? void 0 : detail[v.attrid]) || {};
|
|
346
|
+
currentItem.children = await handleAttrListToObjDetail({
|
|
347
|
+
attrList: v.children,
|
|
348
|
+
params: childParams,
|
|
349
|
+
extra,
|
|
350
|
+
commonRequest
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
return currentItem;
|
|
354
|
+
})) || []
|
|
355
|
+
);
|
|
356
|
+
return processedAttrList;
|
|
358
357
|
};
|
|
359
358
|
const handleUrlOptions = (val, delimiter, list) => {
|
|
360
359
|
let arr = [];
|