amis 官方用例(引用http请求返回的数据)在crud bulkActions中使用时功能失效

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

官方用例-引用http请求返回的数据 单独使用时没问题,但是在crud bulkActions中使用时功能失效,事件动作中追加的数据data也不会生效。

如何复现(请务必完整填写下面内容):
  1. 你是如何使用 amis 的?
    npm
  2. amis 版本是什么?
    amis版本
  3. 粘贴有问题的完整 amis schema 代码:
{
  "type": "page",
  "body": {
    "type": "crud",
    "syncLocation": false,
    "api": "/amis/api/mock2/sample",
    "headerToolbar": [
      "bulkActions"
    ],
    "bulkActions": [
      {
        "label": "批量删除",
        "actionType": "ajax",
        "api": "delete:/amis/api/mock2/sample/${ids|raw}",
        "confirmText": "确定要批量删除?"
      },
      {
        "label": "批量修改",
        "actionType": "dialog",
        "dialog": {
          "title": "批量编辑",
          "body": {
            "type": "form",
            "api": "/amis/api/mock2/sample/bulkUpdate2",
            "body": [
              {
                "type": "hidden",
                "name": "ids"
              },
              {
                "type": "input-text",
                "name": "engine",
                "label": "Engine"
              }
            ]
          }
        }
      },
      {
        "type": "button",
        "label": "发送Ajax请求,并把返回数据传给弹窗",
        "level": "primary",
        "onEvent": {
          "click": {
            "actions": [
              {
                "actionType": "ajax",
                "args": {
                  "api": "/amis/api/mock2/form/saveForm"
                }
              },
              {
                "actionType": "dialog",
                "data": {
                  "test_name": "123",
                  "id": "${event.data.responseResult.responseData.id}"
                },
                "dialog": {
                  "type": "dialog",
                  "id": "dialog_005",
                  "title": "弹框标题1",
                  "data": {
                    "id": "${id}",
                    "test_name": "${test_name}"
                  },
                  "body": [
                    {
                      "type": "form",
                      "body": [
                        {
                          "type": "tpl",
                          "tpl": "<p>${test_name}---请求返回的数据:id=${id}</p>",
                          "inline": false
                        }
                      ]
                    }
                  ]
                }
              }
            ]
          }
        }
      }
    ],
    "columns": [
      {
        "name": "id",
        "label": "ID"
      },
      {
        "name": "engine",
        "label": "Rendering engine"
      },
      {
        "name": "browser",
        "label": "Browser"
      },
      {
        "name": "platform",
        "label": "Platform(s)"
      },
      {
        "name": "version",
        "label": "Engine version"
      },
      {
        "name": "grade",
        "label": "CSS grade"
      },
      {
        "type": "operation",
        "buttons": [
          {
            "type": "button",
            "label": "发送Ajax请求",
            "level": "link",
            "onEvent": {
              "click": {
                "actions": [
                  {
                    "actionType": "ajax",
                    "args": {
                      "api": "/amis/api/mock2/form/saveForm"
                    }
                  },
                  {
                    "actionType": "dialog",
                    "data": {
                      "test_name": "123",
                      "id": "${event.data.responseResult.responseData.id}"
                    },
                    "dialog": {
                      "type": "dialog",
                      "id": "dialog_005",
                      "title": "弹框标题1",
                      "data": {
                        "id": "${id}",
                        "test_name": "${test_name}"
                      },
                      "body": [
                        {
                          "type": "form",
                          "body": [
                            {
                              "type": "tpl",
                              "tpl": "<p>${test_name}---请求返回的数据:id=${id}</p>",
                              "inline": false
                            }
                          ]
                        }
                      ]
                    }
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  }
}
  1. 操作步骤

q8l4jmvw

q8l4jmvw1#

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

Please review the labels and make any necessary changes.

相关问题