Skip to content

Commit 00619af

Browse files
committed
add action
1 parent 0c691e3 commit 00619af

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • frontend/packages/flow-pc/flow-pc-approval/src/components/flow-approval/components/action

frontend/packages/flow-pc/flow-pc-approval/src/components/flow-approval/components/action/pass.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ export const PassAction: React.FC<FlowActionProps> = (props) => {
1313

1414
const [modalVisible, setModalVisible] = React.useState(false);
1515

16-
const [form] = Form.useForm();
16+
const isStartNode = state.flow?.nodeType === 'START';
1717

18+
const [form] = Form.useForm();
1819

1920
const handleSubmit = (params?:any) => {
2021
actionPresenter.action(action.id,params).then((res) => {
@@ -44,7 +45,11 @@ export const PassAction: React.FC<FlowActionProps> = (props) => {
4445
<>
4546
<Button
4647
onClick={() => {
47-
setModalVisible(true);
48+
if(isStartNode) {
49+
handleSubmit();
50+
}else {
51+
setModalVisible(true);
52+
}
4853
}}
4954
>
5055
{action.title}

0 commit comments

Comments
 (0)