@jiangood/open-admin-flowable 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/package.json +38 -0
  2. package/src/layouts/index.jsx +13 -0
  3. package/src/pages/flowable/design/PropertiesPanel.jsx +167 -0
  4. package/src/pages/flowable/design/contextPad.js +50 -0
  5. package/src/pages/flowable/design/customTranslate/customTranslate.js +16 -0
  6. package/src/pages/flowable/design/customTranslate/translations-properties-panel.js +10 -0
  7. package/src/pages/flowable/design/customTranslate/translations.js +144 -0
  8. package/src/pages/flowable/design/descriptors/flowable.json +1109 -0
  9. package/src/pages/flowable/design/index.css +7 -0
  10. package/src/pages/flowable/design/index.jsx +163 -0
  11. package/src/pages/flowable/design/provider/properties/AssignmentSection.jsx +74 -0
  12. package/src/pages/flowable/design/provider/properties/ConditionDesign.jsx +292 -0
  13. package/src/pages/flowable/design/provider/properties/ConditionExpressionUtils.js +53 -0
  14. package/src/pages/flowable/design/provider/properties/ConditionProps.jsx +66 -0
  15. package/src/pages/flowable/design/provider/properties/DelegateExpressionProps.jsx +29 -0
  16. package/src/pages/flowable/design/provider/properties/FormProps.jsx +28 -0
  17. package/src/pages/flowable/design/provider/properties/GeneralSection.jsx +21 -0
  18. package/src/pages/flowable/design/provider/properties/MultiInstanceProps.jsx +37 -0
  19. package/src/pages/flowable/index.jsx +87 -0
  20. package/src/pages/flowable/monitor/definition.jsx +87 -0
  21. package/src/pages/flowable/monitor/instance/index.jsx +82 -0
  22. package/src/pages/flowable/monitor/instance/view.jsx +102 -0
  23. package/src/pages/flowable/monitor/task.jsx +98 -0
  24. package/src/pages/flowable/simulate/index.jsx +400 -0
  25. package/src/pages/flowable/user-task/form.jsx +183 -0
  26. package/src/pages/flowable/user-task/index.jsx +184 -0
  27. package/src/pages/flowable/user-task/instance/view.jsx +85 -0
@@ -0,0 +1,28 @@
1
+ import {Select} from 'antd';
2
+ import {useEffect, useState} from 'react';
3
+ import {HttpUtils} from "@jiangood/open-admin";
4
+
5
+ export default function FormField({element, modeling, processId}) {
6
+ const [options, setOptions] = useState([]);
7
+
8
+ useEffect(() => {
9
+ HttpUtils.get('admin/flowable/model/formOptions', {code: processId}).then(rs => {
10
+ setOptions((rs || []).map(o => typeof o === 'string' ? {label: o, value: o} : o));
11
+ });
12
+ }, [processId]);
13
+
14
+ const value = element.businessObject?.formKey || '';
15
+
16
+ return (
17
+ <div style={{padding: 8}}>
18
+ <div style={{marginBottom: 4, fontSize: 12, color: '#666'}}>选择表单</div>
19
+ <Select
20
+ style={{width: '100%'}}
21
+ value={value || undefined}
22
+ options={[{value: '', label: '<留空>'}, ...options]}
23
+ onChange={(val) => modeling.updateProperties(element, {formKey: val || ''})}
24
+ allowClear
25
+ />
26
+ </div>
27
+ );
28
+ }
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import {Form, Input} from 'antd';
3
+
4
+ export default function GeneralSection({element, modeling}) {
5
+ return (
6
+ <Form
7
+ layout="vertical"
8
+ initialValues={{name: element.businessObject?.name || ''}}
9
+ onValuesChange={(changedValues) => {
10
+ modeling.updateProperties(element, changedValues);
11
+ }}
12
+ >
13
+ <Form.Item label="ID">
14
+ <Input value={element.id} disabled variant="borderless"/>
15
+ </Form.Item>
16
+ <Form.Item label="名称" name="name">
17
+ <Input placeholder="元素名称"/>
18
+ </Form.Item>
19
+ </Form>
20
+ );
21
+ }
@@ -0,0 +1,37 @@
1
+ import {getBusinessObject, is} from 'bpmn-js/lib/util/ModelUtil';
2
+ import {Form, Input} from 'antd';
3
+
4
+ function getLoopCharacteristics(element) {
5
+ const bo = getBusinessObject(element);
6
+ return bo.loopCharacteristics;
7
+ }
8
+
9
+ export default function MultiInstanceSection({element, modeling}) {
10
+ const loopCharacteristics = getLoopCharacteristics(element);
11
+
12
+ if (!loopCharacteristics || !is(loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics')) {
13
+ return [];
14
+ }
15
+
16
+ const initialValues = {
17
+ collection: loopCharacteristics.get('collection') || '',
18
+ elementVariable: loopCharacteristics.get('elementVariable') || '',
19
+ };
20
+
21
+ return (
22
+ <Form
23
+ layout="vertical"
24
+ initialValues={initialValues}
25
+ onValuesChange={(changedValues) => {
26
+ modeling.updateModdleProperties(element, loopCharacteristics, changedValues);
27
+ }}
28
+ >
29
+ <Form.Item label="集合" name="collection">
30
+ <Input placeholder="如 userList"/>
31
+ </Form.Item>
32
+ <Form.Item label="元素变量" name="elementVariable">
33
+ <Input placeholder="如 user"/>
34
+ </Form.Item>
35
+ </Form>
36
+ );
37
+ }
@@ -0,0 +1,87 @@
1
+ import {Button, Popconfirm, Space} from 'antd';
2
+ import React from 'react';
3
+ import {ButtonList, HttpUtils, Page, PageUtils, ProTable} from "@jiangood/open-admin";
4
+
5
+ export default class extends React.Component {
6
+
7
+
8
+ actionRef = React.createRef();
9
+
10
+
11
+ columns = [
12
+ {
13
+ title: '名称',
14
+ dataIndex: 'name',
15
+ },
16
+ {
17
+ title: '代码',
18
+ dataIndex: 'key'
19
+ },
20
+
21
+
22
+ {
23
+ title: '版本',
24
+ dataIndex: 'version',
25
+ },
26
+ {
27
+ title: '更新时间',
28
+ dataIndex: 'lastUpdateTime',
29
+ },
30
+
31
+
32
+ {
33
+ title: '操作',
34
+ dataIndex: 'option',
35
+ render: (_, record) => (
36
+ <Space>
37
+ <Button size='small' type='primary'
38
+ onClick={() => PageUtils.open('/flowable/design?id=' + record.id, '流程设计' + record.name)}> 设计 </Button>
39
+ <Popconfirm perm='flowable/model:delete' title={'是否确定删除流程模型'}
40
+ onConfirm={() => this.handleDelete(record)}>
41
+ <Button size='small' danger>删除</Button>
42
+ </Popconfirm>
43
+ </Space>
44
+ ),
45
+ },
46
+ ];
47
+
48
+
49
+ handleDelete = row => {
50
+ HttpUtils.post('admin/flowable/model/delete', {id: row.id}).then(rs => {
51
+ this.actionRef.current.reload();
52
+ })
53
+ }
54
+
55
+
56
+ render() {
57
+
58
+ return <Page padding>
59
+ <ProTable
60
+ actionRef={this.actionRef}
61
+ request={(params) => HttpUtils.get('admin/flowable/model/page', params)}
62
+ columns={this.columns}
63
+ showToolbarSearch={true}
64
+ toolBarRender={() => {
65
+ return <ButtonList>
66
+ <Button onClick={() => PageUtils.open('/flowable/monitor/task', "运行中的任务")}>
67
+ 运行中的任务
68
+ </Button>
69
+ <Button onClick={() => PageUtils.open('/flowable/monitor/instance', "运行中的流程实例")}>
70
+ 运行中的流程实例
71
+ </Button>
72
+ <Button onClick={() => PageUtils.open('/flowable/monitor/definition', "已部署的流程定义")}>
73
+ 已部署的流程定义
74
+ </Button>
75
+ </ButtonList>
76
+ }}
77
+ />
78
+
79
+
80
+ </Page>
81
+ }
82
+
83
+
84
+ }
85
+
86
+
87
+
@@ -0,0 +1,87 @@
1
+ import React from "react";
2
+ import {HttpUtils, ProTable} from "@jiangood/open-admin";
3
+
4
+ export default class extends React.Component {
5
+
6
+ columns = [
7
+ {
8
+ title: 'ID',
9
+ dataIndex: 'id',
10
+ },
11
+ {
12
+ title: '分类',
13
+ dataIndex: 'category',
14
+ },
15
+ {
16
+ title: '名称',
17
+ dataIndex: 'name',
18
+ },
19
+ {
20
+ title: '键',
21
+ dataIndex: 'key',
22
+ },
23
+ {
24
+ title: '描述',
25
+ dataIndex: 'description',
26
+ },
27
+ {
28
+ title: '版本',
29
+ dataIndex: 'version',
30
+ },
31
+ {
32
+ title: '资源名称',
33
+ dataIndex: 'resourceName',
34
+ },
35
+ {
36
+ title: '部署ID',
37
+ dataIndex: 'deploymentId',
38
+ },
39
+ {
40
+ title: '图表资源名称',
41
+ dataIndex: 'diagramResourceName',
42
+ },
43
+ {
44
+ title: '是否有开始表单键',
45
+ dataIndex: 'hasStartFormKey',
46
+ render: (value) => value ? '是' : '否',
47
+ },
48
+ {
49
+ title: '是否有图形符号',
50
+ dataIndex: 'hasGraphicalNotation',
51
+ render: (value) => value ? '是' : '否',
52
+ },
53
+ {
54
+ title: '是否挂起',
55
+ dataIndex: 'suspended',
56
+ render: (value) => value ? '是' : '否',
57
+ },
58
+ {
59
+ title: '租户ID',
60
+ dataIndex: 'tenantId',
61
+ },
62
+ {
63
+ title: '派生自',
64
+ dataIndex: 'derivedFrom',
65
+ },
66
+ {
67
+ title: '根派生来源',
68
+ dataIndex: 'derivedFromRoot',
69
+ },
70
+ {
71
+ title: '派生版本',
72
+ dataIndex: 'derivedVersion',
73
+ },
74
+
75
+
76
+ ]
77
+
78
+ render() {
79
+ return <ProTable
80
+ search={false}
81
+ columns={this.columns}
82
+ request={(params) => HttpUtils.get('admin/flowable/monitor/definitionPage', params)}
83
+ >
84
+
85
+ </ProTable>
86
+ }
87
+ }
@@ -0,0 +1,82 @@
1
+ import {Button, Popconfirm, Space} from "antd";
2
+ import {HttpUtils, PageUtils, ProTable} from "@jiangood/open-admin";
3
+ import React from "react";
4
+
5
+ export default class extends React.Component {
6
+
7
+ columns = [
8
+ {
9
+ title: 'ID',
10
+ dataIndex: 'id',
11
+ key: 'id',
12
+ },
13
+ {
14
+ title: '名称',
15
+ dataIndex: 'name',
16
+ key: 'name',
17
+ },
18
+ {
19
+ title: '流程定义名称',
20
+ dataIndex: 'processDefinitionName',
21
+ key: 'processDefinitionName',
22
+ },
23
+ {
24
+ title: '流程定义键',
25
+ dataIndex: 'processDefinitionKey',
26
+ key: 'processDefinitionKey',
27
+ },
28
+ {
29
+ title: '版本',
30
+ dataIndex: 'processDefinitionVersion',
31
+ key: 'processDefinitionVersion',
32
+ },
33
+ {
34
+ title: '业务键',
35
+ dataIndex: 'businessKey',
36
+ key: 'businessKey',
37
+ },
38
+ {
39
+ title: '状态',
40
+ dataIndex: 'suspended',
41
+ key: 'suspended',
42
+ render: (value) => value ? '已挂起' : '运行中',
43
+ },
44
+ {
45
+ title: '开始时间',
46
+ dataIndex: 'startTime',
47
+ key: 'startTime',
48
+ },
49
+ {
50
+ dataIndex: 'options',
51
+ title: '操作',
52
+ fixed: 'right',
53
+ render: (_, r) => {
54
+ return <Space>
55
+ <Button size='small' onClick={() => PageUtils.open('/flowable/monitor/instance/view?id=', '查看流程')}>查看</Button>
56
+ <Popconfirm title={'关闭流程'}
57
+ onConfirm={() => this.close(r.id)}>
58
+ <Button size='small' >终止</Button>
59
+ </Popconfirm></Space>
60
+ }
61
+ }
62
+
63
+ ]
64
+
65
+ close = (id) => {
66
+ HttpUtils.get('admin/flowable/monitor/processInstance/close', {id}).then((rs) => {
67
+ this.tableRef.current.reload()
68
+ })
69
+ }
70
+
71
+ tableRef = React.createRef()
72
+
73
+ render() {
74
+ return <ProTable
75
+ actionRef={this.tableRef}
76
+ columns={this.columns}
77
+ request={(params) => HttpUtils.get('admin/flowable/monitor/instancePage', params)}
78
+ >
79
+
80
+ </ProTable>
81
+ }
82
+ }
@@ -0,0 +1,102 @@
1
+ import React from "react";
2
+ import {Gap, HttpUtils, Page, PageUtils, ProTable} from "@jiangood/open-admin";
3
+ import {Card, Empty, Skeleton, Table} from "antd";
4
+
5
+ export default class extends React.Component {
6
+ state = {
7
+ instanceCommentList: [],
8
+ vars: {},
9
+
10
+ id: null,
11
+ starter: null,
12
+ startTime: null,
13
+ name: null,
14
+
15
+ data: {
16
+ commentList: [],
17
+ img: null
18
+ },
19
+ loading: true,
20
+
21
+ errorMsg: null
22
+ }
23
+
24
+
25
+ componentDidMount() {
26
+ const {businessKey, id} = PageUtils.currentParams()
27
+
28
+ HttpUtils.get("admin/flowable/user-task/getInstanceInfo", {id, businessKey}).then(rs => {
29
+ this.setState(rs)
30
+ this.setState({data: rs})
31
+ }).catch(e => {
32
+ this.setState({errorMsg: e})
33
+ }).finally(() => {
34
+ this.setState({loading: false})
35
+ })
36
+
37
+ }
38
+
39
+
40
+ render() {
41
+
42
+ if (this.state.errorMsg) {
43
+ return <Empty description={this.state.errorMsg}></Empty>
44
+ }
45
+ const {id} = PageUtils.currentParams()
46
+
47
+ const {data, loading} = this.state
48
+ const {commentList, img} = data
49
+ if (loading) {
50
+ return <Skeleton/>
51
+ }
52
+
53
+
54
+ return <Page padding>
55
+ <Card title='流程图'>
56
+ <img src={img} style={{maxWidth: '100%'}}/>
57
+ </Card>
58
+ <Gap/>
59
+ <Card title='审批记录'>
60
+ <Table dataSource={commentList}
61
+ size='small'
62
+ pagination={false}
63
+ rowKey='id'
64
+ columns={[
65
+ {
66
+ dataIndex: 'content',
67
+ title: '操作'
68
+ },
69
+ {
70
+ dataIndex: 'user',
71
+ title: '处理人'
72
+ },
73
+ {
74
+ dataIndex: 'time',
75
+ title: '处理时间'
76
+ },
77
+ ]}
78
+ />
79
+ </Card>
80
+
81
+ <Gap/>
82
+ <Card title='流程变量'>
83
+ <ProTable columns={[
84
+ {
85
+ dataIndex: 'key',
86
+ title: '变量名'
87
+ },
88
+ {
89
+ dataIndex: 'value',
90
+ title: '变量值'
91
+ },
92
+ ]}
93
+ rowKey='key'
94
+ request={() => HttpUtils.get('admin/flowable/monitor/instance/vars', {id})}
95
+ ></ProTable>
96
+
97
+ </Card>
98
+ </Page>
99
+ }
100
+
101
+
102
+ }
@@ -0,0 +1,98 @@
1
+ import {FieldUserSelect, HttpUtils, Page, ProTable} from "@jiangood/open-admin";
2
+ import {Button, Form, Modal} from "antd";
3
+ import React from "react";
4
+
5
+ export default class extends React.Component {
6
+
7
+
8
+ state = {
9
+ assigneeFormOpen:false,
10
+ assigneeFormValues:{}
11
+ }
12
+
13
+ assigneeFormRef = React.createRef()
14
+ taskTableRef = React.createRef()
15
+
16
+ onClickSetAssignee = id => {
17
+ this.setState({assigneeFormOpen:true,assigneeFormValues:{taskId:id}})
18
+ };
19
+
20
+ submitSetAssignee = values => {
21
+ HttpUtils.post('admin/flowable/monitor/setAssignee',values).then(()=>{
22
+ this.setState({assigneeFormOpen:false})
23
+ this.taskTableRef.current.reload()
24
+ })
25
+ };
26
+ render() {
27
+ return <Page padding>
28
+ <ProTable
29
+ actionRef={this.taskTableRef}
30
+ columns={[
31
+ {
32
+ dataIndex: 'processInstanceName',
33
+ title: '实例名称'
34
+ },
35
+ {
36
+ dataIndex: 'name',
37
+ title: '任务名称',
38
+ },
39
+ {
40
+ dataIndex: 'assigneeLabel',
41
+ title: '处理人'
42
+ },
43
+ {
44
+ dataIndex: 'id',
45
+ title: '任务标识',
46
+ },
47
+
48
+ {
49
+ dataIndex: 'processDefinitionId',
50
+ title: '定义'
51
+ },
52
+ {
53
+ dataIndex: 'processInstanceId',
54
+ title: '实例'
55
+ },
56
+
57
+
58
+
59
+ {
60
+ dataIndex: 'startTime',
61
+ title: '开始时间'
62
+ },
63
+ {
64
+ dataIndex: 'tenantId',
65
+ title: '租户'
66
+ },
67
+
68
+ {
69
+ dataIndex:'id',
70
+ render:(id)=>{
71
+ return <Button size='small' onClick={()=>this.onClickSetAssignee(id)}>指定处理人</Button>
72
+ }
73
+ }
74
+ ]}
75
+ request={(params) => HttpUtils.get('admin/flowable/monitor/task', params)}
76
+ >
77
+ <Form.Item label='受理人' name='assignee'>
78
+ <FieldUserSelect />
79
+ </Form.Item>
80
+ </ProTable>
81
+ <Modal title='指定处理人'
82
+ open={this.state.assigneeFormOpen}
83
+ onOk={()=>this.assigneeFormRef.current.submit()}
84
+ onCancel={()=>this.setState({assigneeFormOpen:false})}
85
+ destroyOnHidden
86
+ >
87
+ <Form ref={this.assigneeFormRef} onFinish={this.submitSetAssignee} initialValues={this.state.assigneeFormValues}>
88
+ <Form.Item name='taskId' noStyle>
89
+ </Form.Item>
90
+ <Form.Item name='assignee' label='用户'>
91
+ <FieldUserSelect />
92
+ </Form.Item>
93
+ </Form>
94
+ </Modal>
95
+ </Page>
96
+ }
97
+
98
+ }