szld-libs 0.2.92 → 0.2.93
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 +1762 -1762
- package/dist/szld-components.umd.js +33 -33
- package/es/utils/method.d.ts +3 -7
- package/es/utils/method.js +2 -2
- package/lib/utils/method.d.ts +3 -7
- package/lib/utils/method.js +2 -2
- package/package.json +1 -1
package/es/utils/method.d.ts
CHANGED
|
@@ -7,15 +7,11 @@ export declare function isBase64(str: string): boolean;
|
|
|
7
7
|
* 处理表单提交数据,将表单值合并到原始数据attrvalue中
|
|
8
8
|
* @param originalData 原始数据
|
|
9
9
|
* @param allValues 表单提交值
|
|
10
|
+
* @param isListToObj 是否将列表转换为提交数据格式对象,默认false
|
|
10
11
|
* @returns
|
|
11
12
|
*/
|
|
12
|
-
export declare const handleSubmitForm: (originalData: any, allValues: any) => {
|
|
13
|
-
updatedData:
|
|
14
|
-
data: {
|
|
15
|
-
asid: any;
|
|
16
|
-
data_list: any[];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
13
|
+
export declare const handleSubmitForm: (originalData: any, allValues: any, isListToObj?: boolean) => {
|
|
14
|
+
updatedData: any;
|
|
19
15
|
uploadedFiles: any[];
|
|
20
16
|
};
|
|
21
17
|
/**
|
package/es/utils/method.js
CHANGED
|
@@ -28,7 +28,7 @@ function isBase64(str) {
|
|
|
28
28
|
const base64Regex = /^[A-Za-z0-9+/]+(?:=?=?)$/;
|
|
29
29
|
return base64Regex.test(str);
|
|
30
30
|
}
|
|
31
|
-
const handleSubmitForm = (originalData, allValues) => {
|
|
31
|
+
const handleSubmitForm = (originalData, allValues, isListToObj) => {
|
|
32
32
|
let updatedData = _.cloneDeep(originalData);
|
|
33
33
|
let uploadedFiles = [];
|
|
34
34
|
const processAttrList = (attrList) => {
|
|
@@ -138,7 +138,7 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
138
138
|
processAttrList(updatedData.attr_list);
|
|
139
139
|
}
|
|
140
140
|
return {
|
|
141
|
-
updatedData: handleAttrListToObj(updatedData.attr_list || []),
|
|
141
|
+
updatedData: isListToObj ? handleAttrListToObj(updatedData.attr_list || []) : updatedData,
|
|
142
142
|
uploadedFiles
|
|
143
143
|
};
|
|
144
144
|
};
|
package/lib/utils/method.d.ts
CHANGED
|
@@ -7,15 +7,11 @@ export declare function isBase64(str: string): boolean;
|
|
|
7
7
|
* 处理表单提交数据,将表单值合并到原始数据attrvalue中
|
|
8
8
|
* @param originalData 原始数据
|
|
9
9
|
* @param allValues 表单提交值
|
|
10
|
+
* @param isListToObj 是否将列表转换为提交数据格式对象,默认false
|
|
10
11
|
* @returns
|
|
11
12
|
*/
|
|
12
|
-
export declare const handleSubmitForm: (originalData: any, allValues: any) => {
|
|
13
|
-
updatedData:
|
|
14
|
-
data: {
|
|
15
|
-
asid: any;
|
|
16
|
-
data_list: any[];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
13
|
+
export declare const handleSubmitForm: (originalData: any, allValues: any, isListToObj?: boolean) => {
|
|
14
|
+
updatedData: any;
|
|
19
15
|
uploadedFiles: any[];
|
|
20
16
|
};
|
|
21
17
|
/**
|
package/lib/utils/method.js
CHANGED
|
@@ -30,7 +30,7 @@ function isBase64(str) {
|
|
|
30
30
|
const base64Regex = /^[A-Za-z0-9+/]+(?:=?=?)$/;
|
|
31
31
|
return base64Regex.test(str);
|
|
32
32
|
}
|
|
33
|
-
const handleSubmitForm = (originalData, allValues) => {
|
|
33
|
+
const handleSubmitForm = (originalData, allValues, isListToObj) => {
|
|
34
34
|
let updatedData = _.cloneDeep(originalData);
|
|
35
35
|
let uploadedFiles = [];
|
|
36
36
|
const processAttrList = (attrList) => {
|
|
@@ -140,7 +140,7 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
140
140
|
processAttrList(updatedData.attr_list);
|
|
141
141
|
}
|
|
142
142
|
return {
|
|
143
|
-
updatedData: handleAttrListToObj(updatedData.attr_list || []),
|
|
143
|
+
updatedData: isListToObj ? handleAttrListToObj(updatedData.attr_list || []) : updatedData,
|
|
144
144
|
uploadedFiles
|
|
145
145
|
};
|
|
146
146
|
};
|