描述问题:
官方用例-引用http请求返回的数据 单独使用时没问题,但是在crud bulkActions中使用时功能失效,事件动作中追加的数据data也不会生效。
如何复现(请务必完整填写下面内容):
- 你是如何使用 amis 的?
npm
- amis 版本是什么?
amis版本 - 粘贴有问题的完整
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条答案
按热度按时间q8l4jmvw1#
👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.
Please review the labels and make any necessary changes.