Skip to content

Commit 7de5c94

Browse files
committed
fix flow
1 parent c43d296 commit 7de5c94

File tree

18 files changed

+1316
-275
lines changed

18 files changed

+1316
-275
lines changed

admin-pro-ui/src/components/flow/components/PostponedFormView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import {ModalForm, ProFormDigit} from "@ant-design/pro-components";
3-
import {PostponedFormProps} from "@/components/flow/flow/types";
3+
import {PostponedFormProps} from "@/components/flow/types";
44

55

66
const PostponedFormView:React.FC<PostponedFormProps> = (props)=>{
@@ -19,7 +19,7 @@ const PostponedFormView:React.FC<PostponedFormProps> = (props)=>{
1919
destroyOnClose:true,
2020
}}
2121
onFinish={async (values) => {
22-
props.onFinish(values);
22+
props.onFinish(values.hours);
2323
}}
2424
>
2525
<ProFormDigit

admin-pro-ui/src/components/flow/components/ResultFormView.tsx

Lines changed: 0 additions & 76 deletions
This file was deleted.

admin-pro-ui/src/components/flow/components/UserSelectView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, {useEffect} from "react";
2-
import {UserSelectProps} from "@/components/flow/flow/types";
2+
import {UserSelectFormProps} from "@/components/flow/types";
33
import {ModalForm, ProForm, ProFormSelect} from "@ant-design/pro-components";
44
import {users} from "@/api/user";
55

66

7-
const UserSelectView: React.FC<UserSelectProps> = (props) => {
7+
const UserSelectView: React.FC<UserSelectFormProps> = (props) => {
88

99
const [form] = ProForm.useForm();
1010

admin-pro-ui/src/components/flow/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Over from "@/components/flow/nodes/Over";
99
import Circulate from "@/components/flow/nodes/Circulate";
1010
import ControlPanel from "@/components/flow/panel/ControlPanel";
1111
import NodePanel from "@/components/flow/panel/NodePanel";
12-
import {EdgeType} from "@/components/flow/flow/types";
12+
import {EdgeType} from "@/components/flow/types";
1313

1414
import "./index.scss";
1515
import FlowPanelContext from "@/components/flow/domain/FlowPanelContext";
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import {registerComponent} from "@/framework/ComponentBus";
22
import PostponedFormView from "@/components/flow/components/PostponedFormView";
3-
import ResultFormView from "@/components/flow/components/ResultFormView";
4-
import {PostponedFormViewKey, ResultFormViewKey, UserSelectViewKey} from "@/components/flow/flow/types";
3+
import {
4+
PostponedFormViewKey,
5+
UserSelectFormViewKey,
6+
} from "@/components/flow/types";
57
import UserSelectView from "@/components/flow/components/UserSelectView";
68

79
registerComponent(PostponedFormViewKey, PostponedFormView);
8-
registerComponent(ResultFormViewKey, ResultFormView);
9-
registerComponent(UserSelectViewKey, UserSelectView);
10+
registerComponent(UserSelectFormViewKey, UserSelectView);

admin-pro-ui/src/components/flow/types.ts

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
// 节点状态
2+
import {FormAction} from "@/components/form";
3+
24
export type NodeState = "done" | "wait" | "undone" | "current";
35

46
// 节点类型
57
export type NodeType = 'start-node' | 'node-node' | 'over-node' | 'circulate-node';
68

9+
// 流程图中线的类型
10+
export type EdgeType = 'line' | 'polyline' | 'bezier';
11+
12+
713
// 延期表单视图Key
814
export const PostponedFormViewKey = 'PostponedFormView';
915
// 选人表单视图Key
1016
export const UserSelectFormViewKey = 'UserSelectFormViewKey';
1117

12-
// 选人表单 【拓展视图】
1318

19+
// 延期表单 【拓展视图】
20+
export interface PostponedFormProps {
21+
visible: boolean;
22+
setVisible: (visible: boolean) => void;
23+
onFinish: (timeout: number) => void;
24+
}
25+
26+
27+
// 选人表单 【拓展视图】
1428
export type UserSelectFormType =
1529
// 选择下级流程节点的人员,约定人员id范围
1630
'nextNodeUser'
@@ -96,3 +110,39 @@ export interface SettingPanelProps {
96110
onSettingChange: (values: any) => void;
97111
}
98112

113+
// 表单参数
114+
export interface FlowFormParams {
115+
clazzName: string;
116+
117+
[key: string]: any;
118+
}
119+
120+
// 流程表单数据
121+
export interface FlowFormViewProps {
122+
// 表单数据
123+
data: FlowFormParams;
124+
// 表单控制对象
125+
formAction: React.RefObject<FormAction>;
126+
// 数据版本
127+
dataVersion?: number;
128+
}
129+
130+
// 表单视图
131+
export interface FlowFormView {
132+
[key: string]: React.ComponentType<FlowFormViewProps>;
133+
}
134+
135+
export interface FlowViewProps {
136+
// 流程编号
137+
id?: string;
138+
// 是否展示
139+
visible: boolean;
140+
// 设置展示
141+
setVisible:(visible:boolean)=>void;
142+
// 流程的设计编号
143+
workCode?: string;
144+
// 流程的视图数据
145+
view: React.ComponentType<FlowFormViewProps> | FlowFormView;
146+
// 表单参数,参数仅当在发起节点时才会传递
147+
formParams?: FlowFormParams;
148+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
import {FlowViewProps} from "@/components/flow/types";
3+
4+
5+
const FlowView:React.FC<FlowViewProps> = (props)=>{
6+
return (
7+
<></>
8+
)
9+
}
10+
11+
export default FlowView;

admin-pro-ui/src/config/menus.tsx

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,39 @@ export const menus = [
1515
icon: "SmileOutlined",
1616
page: 'welcome',
1717
},
18-
{
19-
path: '/flow',
20-
name: '流程',
21-
icon: "CiOutlined",
22-
page: 'flow',
23-
},
2418
{
2519
path: '/form',
2620
name: '表单',
2721
icon: "FormOutlined",
2822
page: 'form',
29-
}
23+
},
24+
{
25+
path: '/flow',
26+
name: '流程',
27+
icon: "CiOutlined",
28+
routes: [
29+
{
30+
path: '/flow/work',
31+
name: '流程管理',
32+
page: 'flow/work',
33+
},
34+
{
35+
path: '/flow/record',
36+
name: '办理中心',
37+
page: 'flow/record',
38+
},
39+
{
40+
path: '/flow/leave',
41+
name: '请假管理',
42+
page: 'flow/leave',
43+
},
44+
{
45+
path: '/flow/user',
46+
name: '流程用户',
47+
page: 'flow/user',
48+
},
49+
]
50+
},
3051
]
3152

3253

0 commit comments

Comments
 (0)