amis 增删改查的表单在点击搜索后点击新增的面板中的控件默认值有问题

ekqde3dh  于 3个月前  发布在  其他
关注(0)|答案(1)|浏览(61)
描述问题:

我在使用增删改查的控件,我拖拽完一个表单后的操作步骤如下:
1.在搜索表单改变下搜索条件,如下图

2.在新增时控件的默认值被搜索条件里字段名相同的控件覆盖了

截图或视频:

上面有截图

如何复现(请务必完整填写下面内容):
  1. 你是如何使用 amis 的?
    sdknpm其他 ...
  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    6.2.2
  3. 粘贴有问题的完整 amis schema 代码:
{
  "type": "page",
  "title": "测试bug",
  "body": [
    {
      "type": "tpl",
      "tpl": "这是你刚刚新增的页面。",
      "wrapperComponent": "",
      "inline": false,
      "id": "u:29435ee2ea88"
    },
    {
      "type": "crud",
      "syncLocation": false,
      "api": {
        "method": "get",
        "url": ""
      },
      "columns": [
        {
          "name": "id",
          "label": "ID",
          "type": "text",
          "id": "u:85c9db485959"
        },
        {
          "name": "name",
          "label": "name",
          "type": "text",
          "id": "u:8a3d9b207c1f"
        },
        {
          "type": "text",
          "label": "type",
          "id": "u:90b992365927"
        },
        {
          "type": "operation",
          "label": "操作",
          "buttons": [
            {
              "label": "编辑",
              "type": "button",
              "actionType": "dialog",
              "level": "link",
              "editorSetting": {
                "behavior": "update"
              },
              "dialog": {
                "title": "编辑",
                "body": {
                  "type": "form",
                  "api": "xxx/update",
                  "body": [
                    {
                      "name": "id",
                      "label": "ID",
                      "type": "input-text"
                    },
                    {
                      "name": "name",
                      "label": "name",
                      "type": "input-text"
                    },
                    {
                      "label": "type",
                      "type": "input-text"
                    }
                  ]
                }
              },
              "id": "u:bcccfc4ba484"
            },
            {
              "type": "button",
              "label": "删除",
              "actionType": "ajax",
              "level": "link",
              "className": "text-danger",
              "confirmText": "确定要删除?",
              "api": {
                "method": "post",
                "url": ""
              },
              "editorSetting": {
                "behavior": "delete"
              },
              "id": "u:4f59d8f44ae4"
            }
          ],
          "id": "u:3aa1b5b15602"
        }
      ],
      "bulkActions": [],
      "itemActions": [],
      "headerToolbar": [
        {
          "label": "新增",
          "type": "button",
          "actionType": "dialog",
          "level": "primary",
          "editorSetting": {
            "behavior": "create"
          },
          "dialog": {
            "title": "新增",
            "body": [
              {
                "type": "form",
                "api": {
                  "method": "post",
                  "url": ""
                },
                "body": [
                  {
                    "type": "input-text",
                    "name": "id",
                    "label": "ID",
                    "id": "u:babfaa357394"
                  },
                  {
                    "type": "input-text",
                    "name": "name",
                    "label": "name",
                    "id": "u:0a3e91b1359f"
                  },
                  {
                    "type": "select",
                    "label": "type",
                    "name": "type",
                    "options": [
                      {
                        "label": "选项A",
                        "value": "A"
                      },
                      {
                        "label": "选项B",
                        "value": "B"
                      }
                    ],
                    "id": "u:3d16a479516f",
                    "multiple": false
                  }
                ],
                "id": "u:ca628f6de271",
                "actions": [
                  {
                    "type": "submit",
                    "label": "提交",
                    "primary": true
                  }
                ],
                "feat": "Insert"
              }
            ],
            "type": "dialog",
            "id": "u:cafd9f3935d5",
            "actions": [
              {
                "type": "button",
                "actionType": "cancel",
                "label": "取消",
                "id": "u:eb0d56a7e55d"
              },
              {
                "type": "button",
                "actionType": "confirm",
                "label": "确定",
                "primary": true,
                "id": "u:c777ba947aba"
              }
            ]
          },
          "id": "u:a7a1d746e8d4"
        },
        "bulkActions"
      ],
      "id": "u:ac3ff871d351",
      "filter": {
        "id": "u:85f40b2a204c",
        "actions": [
          {
            "type": "submit",
            "label": "搜索",
            "primary": true,
            "id": "u:7e32626e224a"
          }
        ],
        "feat": "Insert",
        "body": [
          {
            "type": "input-text",
            "label": "id",
            "name": "id",
            "id": "u:a838b90fce7a"
          },
          {
            "type": "select",
            "label": "type",
            "name": "type",
            "options": [
              {
                "label": "选项A",
                "value": "A"
              },
              {
                "label": "选项B",
                "value": "B"
              }
            ],
            "id": "u:b10eba68c978",
            "multiple": false
          }
        ]
      }
    }
  ],
  "id": "u:0de5b230f6e6"
}
  1. 操作步骤
    1.改变搜索条件
    2.点击新增,相同的字段名控件默认值改变了
emeijp43

emeijp431#

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

Please review the labels and make any necessary changes.

相关问题