@zat-design/sisyphus-react 4.6.0-beta.4 → 4.6.0
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.
|
@@ -32,7 +32,7 @@ export declare const difference: <T extends Record<string, any>, U extends Recor
|
|
|
32
32
|
* @param rowName 行名称路径
|
|
33
33
|
* @returns 校验结果Promise
|
|
34
34
|
*/
|
|
35
|
-
export declare const customValidate: (validateKeys:
|
|
35
|
+
export declare const customValidate: (validateKeys: NamePath[], form: FormInstance, rowName: NamePath) => Promise<any>;
|
|
36
36
|
/**
|
|
37
37
|
* 拆解数组names
|
|
38
38
|
* @param names 名称数组
|
|
@@ -47,10 +47,11 @@ const difference = (object, base) => {
|
|
|
47
47
|
return changes(object, base);
|
|
48
48
|
};
|
|
49
49
|
const customValidate = (validateKeys, form, rowName) => {
|
|
50
|
-
const
|
|
51
|
-
validateKeys.
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
const rowNamePath = Array.isArray(rowName) ? rowName : [rowName];
|
|
51
|
+
const array = validateKeys.map((key) => [
|
|
52
|
+
...rowNamePath,
|
|
53
|
+
...Array.isArray(key) ? key : [key]
|
|
54
|
+
]);
|
|
54
55
|
return form.validateFields(array);
|
|
55
56
|
};
|
|
56
57
|
const splitNames = (names) => {
|