Skip to content

Dev #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Dec 5, 2024
Merged

Dev #80

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9810e4e
add SQLBuilder
xlorne Nov 13, 2024
84b5b20
add SQLBuilder
xlorne Nov 13, 2024
d982b17
add FlowRecord workCode
xlorne Nov 15, 2024
0c14609
fix script & title reader
xlorne Nov 21, 2024
55f1637
add FlowNodeService
xlorne Nov 21, 2024
8bfad98
finish over node
xlorne Nov 21, 2024
10b24d7
finish over node
xlorne Nov 22, 2024
f3c2617
add Flow Circulate Node
xlorne Nov 22, 2024
ed710cb
fix handleVisibilityChange
xlorne Nov 22, 2024
7f9d1c6
add form
xlorne Nov 23, 2024
e449538
add form
xlorne Nov 23, 2024
0d7d978
add buttons
xlorne Nov 25, 2024
0a5fd5b
add buttons
xlorne Nov 25, 2024
02eee10
add buttons
xlorne Nov 25, 2024
1494325
add buttons
xlorne Nov 25, 2024
b14693c
add 新功能:2022-11-25
xlorne Nov 25, 2024
cd4db2f
split flow service
xlorne Nov 26, 2024
8687d71
add start node try submit
xlorne Nov 26, 2024
0645a4d
add start node try submit
xlorne Nov 26, 2024
f6e8254
add start node try submit
xlorne Nov 27, 2024
757acce
update 3.3.19
xlorne Nov 27, 2024
aa6c1a9
update 3.3.20
xlorne Nov 27, 2024
bff148c
update 3.3.20
xlorne Nov 27, 2024
6af1b94
FlowSession support flow operator
xlorne Nov 27, 2024
253e294
新功能支持:2024-11-27
xlorne Nov 28, 2024
ed1dece
新功能支持:2024-11-27
xlorne Nov 28, 2024
eebafb6
fix chart show
xlorne Nov 28, 2024
103db2a
fix chart show
xlorne Nov 28, 2024
6c98c4f
fix chart show
xlorne Nov 28, 2024
f35d17e
add UserSelectView
xlorne Nov 28, 2024
f5edc8f
fix showOpinion bug
xlorne Nov 28, 2024
a43f4eb
fix 3.3.24
xlorne Nov 29, 2024
19241ad
fix 3.3.25
xlorne Nov 29, 2024
438e82f
add custom event
xlorne Nov 29, 2024
613645a
fix groovy json bug
xlorne Dec 4, 2024
420ee51
fix reload order
xlorne Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions admin-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"@ant-design/icons": "^5.4.0",
"@ant-design/pro-components": "^2.7.19",
"@babel/standalone": "^7.25.6",
"@dnd-kit/core": "^6.2.0",
"@dnd-kit/sortable": "^9.0.0",
"@logicflow/core": "^2.0.5",
"@logicflow/extension": "^2.0.9",
"@reduxjs/toolkit": "^2.2.7",
Expand Down
16 changes: 14 additions & 2 deletions admin-ui/src/api/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ export async function schema(body: any) {

// 流程控制

export async function detail(id:any) {
return get('/api/query/flowRecord/detail', {id});
export async function startFlow(body:any) {
return post('/api/cmd/flowRecord/startFlow', body);
}

export async function detail(id?:any,workCode?:any) {
return get('/api/query/flowRecord/detail', {id,workCode});
}

export async function saveFlow(body:any) {
Expand All @@ -50,6 +54,14 @@ export async function submitFlow(body:any) {
return post('/api/cmd/flowRecord/submitFlow', body);
}

export async function trySubmitFlow(body:any) {
return post('/api/cmd/flowRecord/trySubmitFlow', body);
}

export async function custom(body:any) {
return post('/api/cmd/flowRecord/custom', body);
}

export async function recall(body:any) {
return post('/api/cmd/flowRecord/recall', body);
}
Expand Down
6 changes: 5 additions & 1 deletion admin-ui/src/api/user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {page, post} from "@/api/index";
import {page, post,get} from "@/api/index";

export async function list(
params: any,
Expand All @@ -12,6 +12,10 @@ export async function list(
return page('/api/query/user/list', params, sort, filter, match);
}

export async function users() {
return get('/api/query/user/list', {current:1,pageSize:999999});
}


export async function save(body: any) {
return post('/api/cmd/user/save', body);
Expand Down
41 changes: 41 additions & 0 deletions admin-ui/src/components/Flow/components/PostponedFormView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from "react";
import {ModalForm, ProFormDigit} from "@ant-design/pro-components";
import {PostponedFormProps} from "@/components/Flow/flow/types";


const PostponedFormView:React.FC<PostponedFormProps> = (props)=>{

return (
<ModalForm
title={"延期调整"}
open={props.visible}
modalProps={{
onCancel: () => {
props.setVisible(false);
},
onClose: () => {
props.setVisible(false);
},
destroyOnClose:true,
}}
onFinish={async (values) => {
props.onFinish(values);
}}
>
<ProFormDigit
name={"hours"}
label={"延期时间"}
tooltip={"以当前时间开始延期,延期单位为小时"}
addonAfter={"小时"}
rules={[
{
required: true,
message: "请输入延期时间"
}
]}
/>
</ModalForm>
)
}

export default PostponedFormView;
76 changes: 76 additions & 0 deletions admin-ui/src/components/Flow/components/ResultFormView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import React from 'react';
import {Modal, Result} from "antd";
import {ProDescriptions} from "@ant-design/pro-components";
import {FlowResultItem, ResultFormProps} from "@/components/Flow/flow/types";


const ResultFormView: React.FC<ResultFormProps> = (props) => {
const {result} = props;

if (!result) {
return null;
}

const resultStateTag = ()=>{
const resultState = result.resultState;
if(resultState === "SUCCESS") {
return "success"
}
if(resultState === "WARNING") {
return "warning"
}
return "info";
};


return (
<Modal
width={"40%"}
height={"60%"}
open={props.visible}
onCancel={() => {
props.setVisible(false);
if (props.flowCloseable) {
props.closeFlow();
}
}}
onClose={() => {
props.setVisible(false);
if (props.flowCloseable) {
props.closeFlow();
}
}}
onOk={() => {
props.setVisible(false);
if (props.flowCloseable) {
props.closeFlow();
}
}}
destroyOnClose={true}
>

<Result
status={resultStateTag()}
title={result.title}
>
{result.items && result.items.map((item: FlowResultItem, index: number) => {
return (
<ProDescriptions
column={2}
>
<ProDescriptions.Item
span={2}
label={item.label}
valueType="text"
>
{item.value}
</ProDescriptions.Item>
</ProDescriptions>
)
})}
</Result>
</Modal>
)
}

export default ResultFormView;
66 changes: 66 additions & 0 deletions admin-ui/src/components/Flow/components/UserSelectView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import React, {useEffect} from "react";
import {UserSelectProps} from "@/components/Flow/flow/types";
import {ModalForm, ProForm, ProFormSelect} from "@ant-design/pro-components";
import {users} from "@/api/user";


const UserSelectView: React.FC<UserSelectProps> = (props) => {

const [form] = ProForm.useForm();

const [userList, setUserList] = React.useState<any[]>([]);

useEffect(() => {
users().then((res) => {
if (res.success) {
const list = res.data.list.filter((item:any)=>{
const specifyUserIds = props.specifyUserIds;
if(specifyUserIds && specifyUserIds.length > 0){
return specifyUserIds.includes(item.id);
}
});
setUserList(list);
// 默认选中当前用户
form.setFieldValue("users", props.currentUserIds);
}
})
}, []);

return (
<ModalForm
form={form}
open={props.visible}
title={"用户选择(模拟测试)"}
modalProps={{
onCancel: () => {
props.setVisible(false);
},
onClose: () => {
props.setVisible(false);
}
}}
onFinish={async (values) => {
const users = values.users;
const selectedUsers = userList.filter((item: any) => {
return users.includes(item.id);
});
props.onFinish(selectedUsers);
props.setVisible(false);
}}
>
<ProFormSelect
mode={"tags"}
name={"users"}
label={"用户"}
options={userList.map((item: any) => {
return {
label: item.name,
value: item.id
}
})}
/>
</ModalForm>
)
}

export default UserSelectView;
52 changes: 52 additions & 0 deletions admin-ui/src/components/Flow/flow/FlowButtons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from "react";
import {FlowData} from "@/components/Flow/flow/data";
import {Button, Space} from "antd";


interface FlowButtonsProps {
flowData: FlowData;
requestLoading: boolean;
setRequestLoading: (loading: boolean) => void;
handlerClick: (item: any) => void;
}

const FlowButtons: React.FC<FlowButtonsProps> = (props) => {
const flowData = props.flowData;

if (!flowData ) {
return null;
}

if(flowData.hasData() && flowData.isDone()){
return null;
}

const buttons = flowData.getNodeButtons();

return (
<Space>
{buttons && buttons.map((item: any) => {
const style = item.style && {
...JSON.parse(item.style),
color: "white",
} || {};
return (
<Button
key={item.id}
onClick={() => {
props.handlerClick(item);
}}
loading={props.requestLoading}
style={{
...style
}}
>
{item.name}
</Button>
)
})}
</Space>
)
}

export default FlowButtons;
19 changes: 19 additions & 0 deletions admin-ui/src/components/Flow/flow/FlowChart.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.flow-chart-content {
border: 1px solid #ebeef5;
transition: 0.3s;
padding: 15px 16px;
border-radius: 12px;
position: relative;

.flow-view {
width: 100%;
height: 85vh;
}
}



.lf-mini-map {
border: none !important;
box-shadow: 3px 0 10px 1px rgb(228, 224, 219);
}
69 changes: 69 additions & 0 deletions admin-ui/src/components/Flow/flow/FlowChart.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React, {useEffect, useRef} from "react";
import {FlowData} from "@/components/Flow/flow/data";
import {LogicFlow} from "@logicflow/core";
import {DndPanel, Menu, MiniMap, Snapshot} from "@logicflow/extension";
import Start from "@/components/Flow/nodes/Start";
import Node from "@/components/Flow/nodes/Node";
import Over from "@/components/Flow/nodes/Over";
import Circulate from "@/components/Flow/nodes/Circulate";
import '@logicflow/core/es/index.css';
import '@logicflow/extension/lib/style/index.css';
import "./FlowChart.scss";

interface FlowChartProps {
flowData: FlowData
}

const FlowChart: React.FC<FlowChartProps> = (props) => {

const flowData = props.flowData;

const container = useRef<HTMLDivElement>(null);
const lfRef = useRef<LogicFlow>(null);

useEffect(() => {
const SilentConfig = {
isSilentMode: true,
stopScrollGraph: false,
stopMoveGraph: false,
stopZoomGraph: false,
edgeTextEdit: false,
};

//@ts-ignore
lfRef.current = new LogicFlow({
//@ts-ignore
container: container.current,
...SilentConfig,
background: {
backgroundColor: '#f3f5f8'
},
plugins: [Menu, DndPanel, MiniMap, Snapshot],
grid: false,
edgeType: 'bezier',
});

lfRef.current.setTheme({
bezier: {
stroke: '#8f94e3',
strokeWidth: 1,
},
});
lfRef.current.register(Start);
lfRef.current.register(Node);
lfRef.current.register(Over);
lfRef.current.register(Circulate);

lfRef.current.render(flowData.getFlowSchema());
}, []);

return (
<>
<div className="flow-chart-content">
<div className={"flow-view"} ref={container}/>
</div>
</>
)
}

export default FlowChart;
Loading