Skip to content

Commit 3ee2eb4

Browse files
committed
fix types
1 parent 22e65d2 commit 3ee2eb4

18 files changed

Lines changed: 155 additions & 126 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {ViewPlugin} from "@flow-engine/flow-types";
1+
import {ViewBindPlugin} from "@flow-engine/flow-types";
22
import {LeaveView} from "@/views/leave.tsx";
33

4-
ViewPlugin.getInstance().register('default',LeaveView);
4+
ViewBindPlugin.getInstance().register('default',LeaveView);

frontend/packages/flow-pcs/flow-design/src/api/record.ts

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

frontend/packages/flow-pcs/flow-form/src/components/form/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const FlowFormView: React.FC<ViewComponentProps> = (props) => {
1111

1212
return (
1313
<Form
14-
form={form}
14+
form={form as any}
1515
layout={"vertical"}
1616
onBlur={()=>{
1717
const latestValues = form.getFieldsValue();

frontend/packages/flow-pcs/flow-pc-approval/src/components/flow-approval/components/flow-node-history.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from "react";
22
import {useApprovalContext} from "@/components/flow-approval/hooks/use-approval-context";
3-
import {ProcessNode} from "@/components/flow-approval/typings";
3+
import {ProcessNode} from "@flow-engine/flow-types";
44
import {Timeline, Tag, Empty, Typography} from "antd";
5-
import {CheckCircleFilled, ClockCircleOutlined, LoadingOutlined, SyncOutlined} from "@ant-design/icons";
5+
import {CheckCircleFilled, ClockCircleOutlined, SyncOutlined} from "@ant-design/icons";
66

77
const {Text} = Typography;
88

frontend/packages/flow-pcs/flow-pc-approval/src/components/flow-approval/components/form-view-component.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import {useApprovalContext} from "@/components/flow-approval/hooks/use-approval-context";
3-
import {ViewPlugin} from "@flow-engine/flow-types";
3+
import {ViewBindPlugin} from "@flow-engine/flow-types";
44
import { Form } from "antd";
55

66
interface FormViewComponentProps{
@@ -9,7 +9,7 @@ interface FormViewComponentProps{
99

1010
export const FormViewComponent: React.FC<FormViewComponentProps> = (props) => {
1111
const {state, context} = useApprovalContext();
12-
const ViewComponent = ViewPlugin.getInstance().get(state.flow?.view || 'default');
12+
const ViewComponent = ViewBindPlugin.getInstance().get(state.flow?.view || 'default');
1313
// 是否可合并审批
1414
const mergeable = state.flow?.mergeable || false;
1515
const todos = state.flow?.todos || [];
@@ -54,7 +54,7 @@ export const FormViewComponent: React.FC<FormViewComponentProps> = (props) => {
5454
{viewForms.map((item, index) => (
5555
<ViewComponent
5656
key={index}
57-
form={item.instance}
57+
form={item.instance as any}
5858
onValuesChange={props.onValuesChange}
5959
/>
6060
))}

frontend/packages/flow-pcs/flow-pc-approval/src/components/flow-approval/context/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import {ApprovalLayoutProps, State} from "../typings";
2+
import {State,ApprovalLayoutProps} from "../typings";
33
import {Presenter} from "../presenters";
44

55
export class ApprovalContextScope {

frontend/packages/flow-pcs/flow-pc-approval/src/components/flow-approval/hooks/use-approval-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {ApprovalContext, ApprovalContextScope} from "../context";
44
import {ApprovalReduxState, updateState} from "../store";
55
import {Presenter} from "../presenters";
66
import {FlowApprovalApiImpl} from "../model";
7-
import {ApprovalLayoutProps} from "@/components/flow-approval/typings";
7+
import {ApprovalLayoutProps} from "../typings";
88

99
export const useApprovalContext = () => {
1010
const context = React.useContext(ApprovalContext);

frontend/packages/flow-pcs/flow-pc-approval/src/components/flow-approval/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import {Drawer} from "@flow-engine/flow-pc-ui";
33
import {detail} from "@/api/record";
4-
import {FlowContent} from "@/components/flow-approval/typings";
4+
import {FlowContent} from "@flow-engine/flow-types";
55
import {ApprovalLayout} from "@/components/flow-approval/layout";
66

77
interface ApprovalPanelProps {

frontend/packages/flow-pcs/flow-pc-approval/src/components/flow-approval/layout/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import {ApprovalLayoutProps} from "@/components/flow-approval/typings";
2+
import {ApprovalLayoutProps} from "../typings";
33
import {Provider} from "react-redux";
44
import {approvalStore} from "@/components/flow-approval/store";
55
import {ApprovalContext} from "@/components/flow-approval/context";

frontend/packages/flow-pcs/flow-pc-approval/src/components/flow-approval/typings/index.ts

Lines changed: 4 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,8 @@
1-
export interface FormFieldMeta{
2-
id:string;
3-
name:string;
4-
code:string;
5-
type:string;
6-
require:boolean;
7-
defaultValue:string;
8-
}
9-
10-
export interface FlowMeta {
11-
name:string;
12-
code:string;
13-
fields:FormFieldMeta[];
14-
subForms:FlowMeta[];
15-
}
16-
17-
18-
export interface Body{
19-
recordId:number;
20-
title:string;
21-
data:Record<string,any>;
22-
recordState:number;
23-
flowState:number;
24-
}
25-
26-
export interface ActionDisplay{
27-
title:string;
28-
style:string;
29-
icon:string;
30-
}
31-
32-
export interface FlowAction{
33-
id:string;
34-
title:string;
35-
type:string;
36-
display:ActionDisplay;
37-
enable:boolean;
38-
}
39-
40-
export interface FlowOperator {
41-
id:number;
42-
name:string;
43-
}
44-
45-
export interface History{
46-
recordId:number;
47-
title:string;
48-
advice:string;
49-
signKey:string;
50-
nodeName:string;
51-
nodeId:string;
52-
nodeType:string
53-
updateTime:number;
54-
}
55-
56-
export interface FlowOperatorBody{
57-
advice:string;
58-
signKey:string;
59-
approveTime:number;
60-
flowOperator:FlowOperator;
61-
}
62-
63-
export interface ProcessNode{
64-
nodeId:string;
65-
nodeName:string;
66-
nodeType:string;
67-
state:number;
68-
operators:FlowOperatorBody[]
69-
}
70-
71-
72-
export interface FlowContent {
73-
recordId:number;
74-
workId:string;
75-
workCode:string;
76-
view:string;
77-
adviceNullable:boolean;
78-
signable:boolean;
79-
form:FlowMeta;
80-
todos:Body[];
81-
actions:FlowAction[];
82-
mergeable:boolean;
83-
createOperator:FlowOperator;
84-
currentOperator:FlowOperator;
85-
flowState:number;
86-
recordState:number;
87-
histories:History[];
88-
}
1+
import {FlowContent,ProcessNode} from "@flow-engine/flow-types";
892

3+
/**
4+
* 流程审批布局组件属性
5+
*/
906
export interface ApprovalLayoutProps {
917
content:FlowContent;
928
onClose?:() => void;

0 commit comments

Comments
 (0)