feat: add refreshOnCompleteAction for data refresh functionality

This commit is contained in:
Zeke Zhang 2025-06-19 08:43:18 +08:00
parent 0df2e5f275
commit 096857ee07

View File

@ -0,0 +1,22 @@
export const refreshOnCompleteAction = {
title: '执行后刷新数据',
uiSchema: {
enable: {
type: 'boolean',
title: 'Enable refresh',
'x-decorator': 'FormItem',
'x-component': 'Checkbox',
},
},
defaultParams(ctx) {
return {
enable: true,
};
},
async handler(ctx, params) {
if (params.enable) {
await ctx.extra.currentResource.refresh();
ctx.globals.message.success('Data refreshed successfully.');
}
},
}