Skip to content

Commit 6af1b94

Browse files
committed
FlowSession support flow operator
1 parent bff148c commit 6af1b94

File tree

17 files changed

+144
-59
lines changed

17 files changed

+144
-59
lines changed

admin-ui/src/components/Flow/flow/data.ts

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,36 @@ export class FlowWorkData {
2828
}
2929

3030

31-
export class FlowSubmitResultBuilder {
31+
export class FlowSubmitResultBuilder extends FlowWorkData {
32+
33+
constructor(data: any) {
34+
super(data);
35+
}
36+
37+
builder() {
38+
const records = this.data.records;
39+
const resultItems = [];
40+
for (const record of records) {
41+
const node = this.getNode(record.nodeCode);
42+
resultItems.push({
43+
label: '下级审批节点',
44+
value: node.name
45+
});
46+
47+
resultItems.push({
48+
label: '下级审批人',
49+
value: record.currentOperator.name
50+
});
51+
}
52+
return {
53+
title: '流程审批完成',
54+
items: resultItems
55+
} as FlowResultMessage;
56+
}
57+
}
58+
59+
60+
export class FlowTrySubmitResultBuilder {
3261

3362
private readonly data: any;
3463

@@ -60,36 +89,6 @@ export class FlowSubmitResultBuilder {
6089

6190
}
6291

63-
64-
export class FlowTrySubmitResultBuilder extends FlowWorkData {
65-
66-
constructor(data: any) {
67-
super(data);
68-
}
69-
70-
builder() {
71-
const records = this.data.records;
72-
const resultItems = [];
73-
for (const record of records) {
74-
const node = this.getNode(record.nodeCode);
75-
resultItems.push({
76-
label: '下级审批节点',
77-
value: node.name
78-
});
79-
80-
resultItems.push({
81-
label: '下级审批人',
82-
value: record.currentOperator.name
83-
});
84-
}
85-
return {
86-
title: '流程审批完成',
87-
items: resultItems
88-
} as FlowResultMessage;
89-
}
90-
91-
}
92-
9392
export class FlowData extends FlowWorkData {
9493
private readonly formParams?: FlowFormParams;
9594

admin-ui/src/components/Flow/flow/events.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {useEffect} from "react";
22
import {FormInstance} from "antd/es/form/hooks/useForm";
3-
import {FlowData, FlowSubmitResultBuilder} from "@/components/Flow/flow/data";
3+
import {FlowData, FlowSubmitResultBuilder, FlowTrySubmitResultBuilder} from "@/components/Flow/flow/data";
44
import {custom, postponed, recall, saveFlow, startFlow, submitFlow, transfer, trySubmitFlow, urge} from "@/api/flow";
55
import {message} from "antd";
66
import {useDispatch, useSelector} from "react-redux";
@@ -360,7 +360,7 @@ export const registerEvents = (id: string,
360360
}
361361
case 'TRY_SUBMIT': {
362362
handleTrySubmitFlow((res) => {
363-
const flowSubmitResultBuilder = new FlowSubmitResultBuilder(res.data);
363+
const flowSubmitResultBuilder = new FlowTrySubmitResultBuilder(res.data);
364364
dispatch(showResult({
365365
closeFlow: false,
366366
result: flowSubmitResultBuilder.builder()

admin-ui/src/components/Flow/panel/ScriptModal.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from "react";
22
import {ModalForm, ProFormText} from "@ant-design/pro-components";
33
import ProFormCode from "@/components/Form/ProFormCode";
4-
import "./ScriptModal.scss";
54
import {EyeOutlined} from "@ant-design/icons";
5+
import "./ScriptModal.scss";
66

77
interface ScriptModalProps {
88
form: any;
@@ -104,7 +104,7 @@ def run(content){
104104
// 自定义返回标题并且关闭流程
105105
// return content.createMessageResult('我是自定义标题', true);
106106
// 自定义返回标题并添加现实内容
107-
return content.createMessageResult('我是自定义标题', true).addMessage('我是标题1','我是内容2').addMessage('我是标题2','我是内容2');
107+
return content.createMessageResult('我是自定义标题', true).addItem('我是标题1','我是内容2').addItem('我是标题2','我是内容2');
108108
}
109109
`
110110
}
@@ -121,14 +121,18 @@ def run(content){
121121
// return content.createMessageResult('我是自定义标题', true);
122122
// 提交流程
123123
// content.submitFlow();
124+
// 驳回流程
125+
// content.rejectFlow();
124126
// 催办流程
125127
// content.urgeFlow();
126128
// 保存流程
127129
// content.saveFlow();
128130
// 撤回流程
129131
// content.recallFlow();
132+
// 预提交流程
133+
// content.trySubmitFlow();
130134
// 自定义返回标题并添加现实内容
131-
return content.createMessageResult('我是自定义标题', true).addMessage('我是标题1','我是内容2').addMessage('我是标题2','我是内容2');
135+
return content.createMessageResult('我是自定义标题', true).addMessage('我是标题1','我是内容2').addMessage('我是标题2','我是内容2').closeable(false);
132136
}
133137
`
134138
}

example/example-application/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.20</version>
8+
<version>3.3.21</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-application/src/main/java/com/codingapi/example/pojo/cmd/FlowCmd.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public static class CustomFlow {
3636
private long recordId;
3737
private String buttonId;
3838
private String advice;
39-
private boolean success;
4039
private JSONObject formData;
4140

4241
@SneakyThrows
@@ -50,7 +49,7 @@ public String getUserName() {
5049
}
5150

5251
public Opinion getOpinion() {
53-
return new Opinion(advice, success ? Opinion.RESULT_PASS : Opinion.RESULT_REJECT, Opinion.TYPE_DEFAULT);
52+
return new Opinion(advice, Opinion.RESULT_SAVE, Opinion.TYPE_DEFAULT);
5453
}
5554
}
5655

example/example-domain/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.20</version>
8+
<version>3.3.21</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-flow/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.20</version>
8+
<version>3.3.21</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-jpa/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.20</version>
8+
<version>3.3.21</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.20</version>
8+
<version>3.3.21</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</parent>
1818

1919
<artifactId>springboot-example</artifactId>
20-
<version>3.3.20</version>
20+
<version>3.3.21</version>
2121

2222
<name>springboot-example</name>
2323
<description>springboot-example project for Spring Boot</description>

0 commit comments

Comments
 (0)