mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
feat: dispatch quick save submitted event
This commit is contained in:
parent
99e40693f7
commit
250503a205
@ -3558,6 +3558,7 @@ order: 67
|
||||
"body": {
|
||||
"type": "service",
|
||||
"api": "/api/sample?perPage=5",
|
||||
"id": "service-container",
|
||||
"body": [
|
||||
{
|
||||
"type": "table2",
|
||||
@ -3566,6 +3567,25 @@ order: 67
|
||||
"url": "/api/mock2/sample/bulkUpdate",
|
||||
"method": "put"
|
||||
},
|
||||
"draggable": true,
|
||||
"onEvent": {
|
||||
"quickSaveSubmitted": {
|
||||
"actions": [
|
||||
{
|
||||
"actionType": "reload",
|
||||
"componentId": "service-container"
|
||||
}
|
||||
]
|
||||
},
|
||||
"orderChange": {
|
||||
"actions": [
|
||||
{
|
||||
"actionType": "reload",
|
||||
"componentId": "service-container"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"columns": [
|
||||
{
|
||||
"title": "Engine",
|
||||
|
@ -1424,7 +1424,8 @@ export default class Table2 extends React.Component<Table2Props, object> {
|
||||
keyField,
|
||||
env,
|
||||
messages,
|
||||
reload
|
||||
reload,
|
||||
dispatchEvent
|
||||
} = this.props;
|
||||
|
||||
if (Array.isArray(rows)) {
|
||||
@ -1454,6 +1455,7 @@ export default class Table2 extends React.Component<Table2Props, object> {
|
||||
errorMessage: messages && messages.saveSuccess
|
||||
})
|
||||
.then(() => {
|
||||
dispatchEvent('quickSaveSubmitted', data);
|
||||
reload && this.reloadTarget(filterTarget(reload, data), data);
|
||||
})
|
||||
.catch(() => {});
|
||||
@ -1473,6 +1475,7 @@ export default class Table2 extends React.Component<Table2Props, object> {
|
||||
store
|
||||
.saveRemote(quickSaveItemApi, sendData)
|
||||
.then(() => {
|
||||
dispatchEvent('quickSaveSubmitted', sendData);
|
||||
reload && this.reloadTarget(filterTarget(reload, data), data);
|
||||
})
|
||||
.catch(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user