mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
feat: add MultiRecordResource support in FilterActionModel for handleSubmit flow
This commit is contained in:
parent
575380191b
commit
1a9b8d13bb
@ -17,7 +17,7 @@ import { Trans, useTranslation } from 'react-i18next';
|
||||
import { Cascader, Select, Space } from 'antd';
|
||||
import { css } from '@emotion/css';
|
||||
import { observer } from '@formily/reactive-react';
|
||||
import { useFlowModel, useStepSettingContext } from '@nocobase/flow-engine';
|
||||
import { MultiRecordResource, useFlowModel, useStepSettingContext } from '@nocobase/flow-engine';
|
||||
|
||||
// TODO: 需要重构,使用新的方式获取组件实例
|
||||
const AppContext = React.createContext(null);
|
||||
@ -537,3 +537,23 @@ FilterActionModel.registerFlow({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
FilterActionModel.registerFlow({
|
||||
key: 'handleSubmit',
|
||||
title: '提交',
|
||||
on: {
|
||||
eventName: 'submit',
|
||||
},
|
||||
steps: {
|
||||
submit: {
|
||||
handler(ctx, params) {
|
||||
const resource = ctx.shared?.currentBlockModel?.resource as MultiRecordResource;
|
||||
if (!resource) {
|
||||
return;
|
||||
}
|
||||
resource.addFilterGroup(ctx.model.uid, ctx.model.props.filterValue);
|
||||
resource.refresh();
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user