Skip to content

表单中字段集下面紧跟input-text ,由于最后一个元素margin 0 导致渲染的表单样式连一起了 #21544

Done

Description

@minzhenyu

描述问题:

表单中字段集下面紧跟input-text ,由于最后一个元素margin 0 导致渲染的表单样式连一起了

截图或视频:

image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    线上demo 可以直接复现
    https://aisuda.github.io/amis-editor-demo

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在

  3. 粘贴有问题的完整 amis schema 代码:

{
  "type": "page",
  "body": [
    {
      "type": "form",
      "id": "ticket-data-e924cf3e47faeeff",
      "name": "dataEditForm",
      "mode": "horizontal",
      "labelAlign": "left",
      "title": "",
      "wrapWithPanel": true,
      "body": [
        {
          "type": "input-text",
          "id": "ticket-data-f6605caa28f512d2",
          "name": "合同编号",
          "label": "合同编号",
          "clearValueOnHidden": true,
          "onEvent": {
            "focus": {
              "actions": [
                {
                  "actionType": "custom",
                  "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['合同编号']);"
                }
              ]
            }
          }
        },
        {
          "type": "input-text",
          "id": "ticket-data-fd67edce3e648d29",
          "name": "借款人名称",
          "label": "借款人名称",
          "clearValueOnHidden": true,
          "onEvent": {
            "focus": {
              "actions": [
                {
                  "actionType": "custom",
                  "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['借款人名称']);"
                }
              ]
            }
          }
        },
        {
          "type": "input-text",
          "id": "ticket-data-898c37052f757583",
          "name": "借款金额",
          "label": "借款金额",
          "clearValueOnHidden": true,
          "onEvent": {
            "focus": {
              "actions": [
                {
                  "actionType": "custom",
                  "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['借款金额']);"
                }
              ]
            }
          }
        },
        {
          "type": "fieldSet",
          "id": "ticket-data-fcfb265cf6ea0c62",
          "title": "借款期限",
          "body": [
            {
              "type": "input-text",
              "id": "ticket-data-75e202f6eed9e60f",
              "name": "借款期限.期限月数",
              "label": "期限月数",
              "clearValueOnHidden": true,
              "onEvent": {
                "focus": {
                  "actions": [
                    {
                      "actionType": "custom",
                      "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['借款期限.期限月数']);"
                    }
                  ]
                }
              }
            },
            {
              "type": "input-text",
              "id": "ticket-data-f35b67ef46dc7bd8",
              "name": "借款期限.起始日",
              "label": "起始日",
              "clearValueOnHidden": true,
              "onEvent": {
                "focus": {
                  "actions": [
                    {
                      "actionType": "custom",
                      "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['借款期限.起始日']);"
                    }
                  ]
                }
              }
            },
            {
              "type": "input-text",
              "id": "ticket-data-f57cf31f022441c1",
              "name": "借款期限.截至日",
              "label": "截至日",
              "clearValueOnHidden": true,
              "onEvent": {
                "focus": {
                  "actions": [
                    {
                      "actionType": "custom",
                      "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['借款期限.截至日']);"
                    }
                  ]
                }
              }
            }
          ]
        },
        {
          "type": "input-text",
          "id": "ticket-data-bf86763cb501ce3f",
          "name": "借款利率",
          "label": "借款利率",
          "clearValueOnHidden": true,
          "onEvent": {
            "focus": {
              "actions": [
                {
                  "actionType": "custom",
                  "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['借款利率']);"
                }
              ]
            }
          }
        },
        {
          "type": "input-text",
          "id": "ticket-data-d621c3d3dda13d27",
          "name": "借款用途",
          "label": "借款用途",
          "clearValueOnHidden": true,
          "onEvent": {
            "focus": {
              "actions": [
                {
                  "actionType": "custom",
                  "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['借款用途']);"
                }
              ]
            }
          }
        },
        {
          "type": "select",
          "id": "ticket-data-5aa97eb01f71b1a8",
          "name": "还款方式",
          "label": "还款方式",
          "clearValueOnHidden": true,
          "options": [
            {
              "value": "按月付息到期还本",
              "label": "按月付息到期还本"
            },
            {
              "value": "等额本息",
              "label": "等额本息"
            },
            {
              "value": "分期还本",
              "label": "分期还本"
            }
          ],
          "onEvent": {
            "focus": {
              "actions": [
                {
                  "actionType": "custom",
                  "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['还款方式']);"
                }
              ]
            }
          }
        },
        {
          "type": "input-array",
          "id": "ticket-data-0a71bad537c557d4",
          "name": "提款条件",
          "label": "提款条件",
          "clearValueOnHidden": true,
          "items": {
            "type": "input-text",
            "clearable": false
          },
          "onEvent": {
            "focus": {
              "actions": [
                {
                  "actionType": "custom",
                  "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['提款条件']);"
                }
              ]
            }
          }
        },
        {
          "type": "fieldSet",
          "id": "ticket-data-d5b70e5480ac5156",
          "title": "担保条款",
          "collapsable": true,
          "collapsed": false,
          "body": [
            {
              "type": "input-table",
              "id": "ticket-data-035475f5bb7886ff",
              "name": "担保条款",
              "label": false,
              "addable": false,
              "editable": false,
              "removable": false,
              "clearValueOnHidden": true,
              "columnsTogglable": false,
              "needConfirm": false,
              "showTableAddBtn": false,
              "mode": "horizontal",
              "onEvent": {
                "rowClick": {
                  "actions": [
                    {
                      "actionType": "custom",
                      "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._rowPath);"
                    }
                  ],
                  "weight": 0
                }
              },
              "columns": [
                {
                  "type": "input-text",
                  "id": "ticket-data-f37bf3456e29e57d",
                  "name": "担保类型",
                  "label": "担保类型",
                  "clearValueOnHidden": true,
                  "onEvent": {
                    "focus": {
                      "actions": [
                        {
                          "actionType": "custom",
                          "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['担保类型']);"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "input-text",
                  "id": "ticket-data-20119607e476b473",
                  "name": "担保细则",
                  "label": "担保细则",
                  "clearValueOnHidden": true,
                  "onEvent": {
                    "focus": {
                      "actions": [
                        {
                          "actionType": "custom",
                          "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['担保细则']);"
                        }
                      ]
                    }
                  }
                }
              ]
            }
          ]
        },
        {
          "type": "input-text",
          "id": "ticket-data-10033110ef8d89e0",
          "name": "签订日期",
          "label": "签订日期",
          "clearValueOnHidden": true,
          "onEvent": {
            "focus": {
              "actions": [
                {
                  "actionType": "custom",
                  "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['签订日期']);"
                }
              ]
            }
          }
        },
        {
          "type": "fieldSet",
          "id": "ticket-data-8d6dc3f05f8a94e9",
          "title": "签章主体",
          "body": [
            {
              "type": "input-text",
              "id": "ticket-data-6ba9597a9b6b7ac2",
              "name": "签章主体.借款人签章",
              "label": "借款人签章",
              "clearValueOnHidden": true,
              "onEvent": {
                "focus": {
                  "actions": [
                    {
                      "actionType": "custom",
                      "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['签章主体.借款人签章']);"
                    }
                  ]
                }
              }
            },
            {
              "type": "select",
              "id": "ticket-data-ca26ca5b1cc0e941",
              "name": "签章主体.借款人签章与名称是否一致",
              "label": "借款人签章与名称是否一致",
              "clearValueOnHidden": true,
              "options": [
                {
                  "value": "是",
                  "label": "是"
                },
                {
                  "value": "否",
                  "label": "否"
                }
              ],
              "onEvent": {
                "focus": {
                  "actions": [
                    {
                      "actionType": "custom",
                      "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['签章主体.借款人签章与名称是否一致']);"
                    }
                  ]
                }
              }
            },
            {
              "type": "select",
              "id": "ticket-data-49d71a74c9e0bb52",
              "name": "签章主体.借款人签章位置是否合理",
              "label": "借款人签章位置是否合理",
              "clearValueOnHidden": true,
              "options": [
                {
                  "value": "是",
                  "label": "是"
                },
                {
                  "value": "否",
                  "label": "否"
                }
              ],
              "onEvent": {
                "focus": {
                  "actions": [
                    {
                      "actionType": "custom",
                      "script": "window.$gfui.runCmd('amis.highlight.click', event.data?._paths?.['签章主体.借款人签章位置是否合理']);"
                    }
                  ]
                }
              }
            }
          ]
        }
      ],
      "actions": [],
      "feat": "Insert",
      "dsType": "api"
    }
  ],
  "id": "ticket-data-fddb62ecda75e67c",
  "x-schemaHash": "c36e47c53b8ce1d7bf90c525cd26bb995f2026cc6fd7f90ee1eddc9298bccb10",
  "x-viewRole": "EDIT",
  "asideResizor": false,
  "pullRefresh": {
    "disabled": true
  }
}
  1. 操作步骤
    编辑展示正常,预览,渲染不对

Activity

  1. added
    spam
    on Nov 30, 2026
  2. github-actions commented on Nov 30, 2026

    @github-actions

    该 issue 被自动判定为可能的垃圾(包含 2 个链接,标题/正文中存在大量特殊括号 (269),包含电话号码模式且带有异常符号格式)。已自动关闭。如误判请联系维护者。

  3. github-actions commented on Nov 30, 2026

    @github-actions

    👍 Thanks for this!
    🏷 I have applied any labels matching special text in your issue.

    Please review the labels and make any necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featneed confirmspam

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions