补充 table2 事件文档 (#10878)

* doc: quick-save-submitted event

* fix: rm redundant words
This commit is contained in:
quirrel 2024-09-10 17:59:22 +08:00 committed by GitHub
parent ee2ed97598
commit 1b5d6a8328
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4180,6 +4180,7 @@ order: 67
| rowDbClick | `item: object` 行点击数据<br/>`index: number` 行索引 | 双击整行时触发 | | rowDbClick | `item: object` 行点击数据<br/>`index: number` 行索引 | 双击整行时触发 |
| rowMouseEnter | `item: object` 行移入数据<br/>`index: number` 行索引 | 移入整行时触发 | | rowMouseEnter | `item: object` 行移入数据<br/>`index: number` 行索引 | 移入整行时触发 |
| rowMouseLeave | `item: object` 行移出数据<br/>`index: number` 行索引 | 移出整行时触发 | | rowMouseLeave | `item: object` 行移出数据<br/>`index: number` 行索引 | 移出整行时触发 |
| quickSaveSubmitted | `item: object` 快速编辑相关数据,包括源数据、修改后的数据、修改的行数索引、没有变动的数据 | 成功调用 `quickSaveApi` 之后触发 |
### selectedChange ### selectedChange
@ -4815,6 +4816,63 @@ order: 67
} }
``` ```
### quickSaveSubmitted
快速编辑点击 `submit` , 成功调用 `quickSaveSubmitted`之后触发
```schema: scope="body"
{
"type": "page",
"body": {
"type": "page",
"body": {
"type": "service",
"api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample?perPage=5",
"id": "service-container",
"body": [
{
"type": "table2",
"source": "$rows",
"quickSaveApi": {
"url": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample/bulkUpdate",
"method": "put"
},
"onEvent": {
"quickSaveSubmitted": {
"actions": [
{
"actionType": "reload",
"componentId": "service-container"
}
]
},
},
"columns": [
{
"title": "Engine",
"name": "engine",
"quickEdit": true
},
{
"title": "Version",
"name": "version"
},
{
"title": "Browser",
"name": "browser"
},
{
"title": "Badge",
"name": "badgeText"
}
]
}
]
}
}
}
```
### 列的事件表 ### 列的事件表
表格的默认列定义的事件如下,即 click、mouseenter、mouseleave。如果列定义是其他组件则事件表就是这个组件对应的事件表例如列定义是 Switch 组件,则可以监听 [Switch 的 change 事件](./form/switch#%E4%BA%8B%E4%BB%B6%E8%A1%A8)。 表格的默认列定义的事件如下,即 click、mouseenter、mouseleave。如果列定义是其他组件则事件表就是这个组件对应的事件表例如列定义是 Switch 组件,则可以监听 [Switch 的 change 事件](./form/switch#%E4%BA%8B%E4%BB%B6%E8%A1%A8)。