diff --git a/__tests__/__snapshots__/factory.test.tsx.snap b/__tests__/__snapshots__/factory.test.tsx.snap index 5277efc52..36df8f08c 100644 --- a/__tests__/__snapshots__/factory.test.tsx.snap +++ b/__tests__/__snapshots__/factory.test.tsx.snap @@ -195,123 +195,65 @@ exports[`factory:definitions 1`] = ` class="cxd-Combo-itemInner" >
- -
- -
-
- -
-
-
-
- -
-
- -
-
-
- - - -
-
-
- -
- - - -
-
+

+ Error: 不允许在表单及表单按钮组中直接嵌套表单 +

+

+ Path: + page/body/0/form/1/combo/multiple/0/form +

+
+                                
+                                  {
+  "type": "form",
+  "body": [
+    {
+      "label": "combo 1",
+      "type": "input-text",
+      "name": "key"
+    },
+    {
+      "type": "input-text",
+      "name": "value",
+      "value": "ref value",
+      "remark": "通过<code>\\\\$ref</code>引入的组件",
+      "label": "combo 2"
+    },
+    {
+      "type": "combo",
+      "multiple": true,
+      "multiLine": true,
+      "remark": "<code>combo</code>中的子项引入自身,实现嵌套的效果",
+      "controls": [
+        {
+          "label": "combo 1",
+          "type": "text",
+          "name": "key"
+        },
+        {
+          "label": "combo 2",
+          "name": "value",
+          "$ref": "aa"
+        },
+        {
+          "name": "children",
+          "label": "children",
+          "$ref": "bb"
+        }
+      ],
+      "name": "children",
+      "label": "children"
+    }
+  ],
+  "wrapperComponent": "div",
+  "wrapWithPanel": false,
+  "mode": "normal",
+  "className": "cxd-Combo-form"
+}
+                                
+                              
{ render() { const { + $path, + $schema, wrapWithPanel, render, title, @@ -1507,7 +1510,8 @@ export default class Form extends React.Component { affixFooter, lazyLoad, translate: __, - footer + footer, + formStore } = this.props; // trace(true); @@ -1515,7 +1519,20 @@ export default class Form extends React.Component { let body: JSX.Element = this.renderBody(); - if (wrapWithPanel) { + // 表单组件限制 + const isFormInFormActions: boolean = /panel\/action\/form$/.test($path); + // props有formStore 说明是嵌套表单 || 不允许在表单的按钮组中再直接套表单 + if (formStore || isFormInFormActions) { + body = ( + +

Error: 不允许在表单及表单按钮组中直接嵌套表单

+

Path: {$path}

+
+            {JSON.stringify($schema, null, 2)}
+          
+
+ ); + } else if (wrapWithPanel) { body = render( 'body', {