@jiangood/open-admin-flowable 2.2.1 → 2.2.3

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.
@@ -1,88 +0,0 @@
1
- import React from "react";
2
- import {HttpUtils, ProTable} from "@jiangood/open-admin";
3
- import {MONITOR_DEFINITION_PAGE} from "@/constants/api";
4
-
5
- export default class extends React.Component {
6
-
7
- columns = [
8
- {
9
- title: 'ID',
10
- dataIndex: 'id',
11
- },
12
- {
13
- title: '分类',
14
- dataIndex: 'category',
15
- },
16
- {
17
- title: '名称',
18
- dataIndex: 'name',
19
- },
20
- {
21
- title: '键',
22
- dataIndex: 'key',
23
- },
24
- {
25
- title: '描述',
26
- dataIndex: 'description',
27
- },
28
- {
29
- title: '版本',
30
- dataIndex: 'version',
31
- },
32
- {
33
- title: '资源名称',
34
- dataIndex: 'resourceName',
35
- },
36
- {
37
- title: '部署ID',
38
- dataIndex: 'deploymentId',
39
- },
40
- {
41
- title: '图表资源名称',
42
- dataIndex: 'diagramResourceName',
43
- },
44
- {
45
- title: '是否有开始表单键',
46
- dataIndex: 'hasStartFormKey',
47
- render: (value) => value ? '是' : '否',
48
- },
49
- {
50
- title: '是否有图形符号',
51
- dataIndex: 'hasGraphicalNotation',
52
- render: (value) => value ? '是' : '否',
53
- },
54
- {
55
- title: '是否挂起',
56
- dataIndex: 'suspended',
57
- render: (value) => value ? '是' : '否',
58
- },
59
- {
60
- title: '租户ID',
61
- dataIndex: 'tenantId',
62
- },
63
- {
64
- title: '派生自',
65
- dataIndex: 'derivedFrom',
66
- },
67
- {
68
- title: '根派生来源',
69
- dataIndex: 'derivedFromRoot',
70
- },
71
- {
72
- title: '派生版本',
73
- dataIndex: 'derivedVersion',
74
- },
75
-
76
-
77
- ]
78
-
79
- render() {
80
- return <ProTable
81
- search={false}
82
- columns={this.columns}
83
- request={(params) => HttpUtils.get(MONITOR_DEFINITION_PAGE, params)}
84
- >
85
-
86
- </ProTable>
87
- }
88
- }
@@ -1,86 +0,0 @@
1
- import {Button, message, Popconfirm, Space} from "antd";
2
- import {HttpUtils, PageUtils, ProTable} from "@jiangood/open-admin";
3
- import React from "react";
4
- import {MONITOR_PROCESS_INSTANCE_CLOSE, MONITOR_INSTANCE_PAGE} from "@/constants/api";
5
- import {ROUTE_MONITOR_INSTANCE_VIEW} from "@/constants/routes";
6
-
7
- export default class extends React.Component {
8
-
9
- columns = [
10
- {
11
- title: 'ID',
12
- dataIndex: 'id',
13
- key: 'id',
14
- },
15
- {
16
- title: '名称',
17
- dataIndex: 'name',
18
- key: 'name',
19
- },
20
- {
21
- title: '流程定义名称',
22
- dataIndex: 'processDefinitionName',
23
- key: 'processDefinitionName',
24
- },
25
- {
26
- title: '流程定义键',
27
- dataIndex: 'processDefinitionKey',
28
- key: 'processDefinitionKey',
29
- },
30
- {
31
- title: '版本',
32
- dataIndex: 'processDefinitionVersion',
33
- key: 'processDefinitionVersion',
34
- },
35
- {
36
- title: '业务键',
37
- dataIndex: 'businessKey',
38
- key: 'businessKey',
39
- },
40
- {
41
- title: '状态',
42
- dataIndex: 'suspended',
43
- key: 'suspended',
44
- render: (value) => value ? '已挂起' : '运行中',
45
- },
46
- {
47
- title: '开始时间',
48
- dataIndex: 'startTime',
49
- key: 'startTime',
50
- },
51
- {
52
- dataIndex: 'options',
53
- title: '操作',
54
- fixed: 'right',
55
- render: (_, r) => {
56
- return <Space>
57
- <Button size='small' onClick={() => PageUtils.open(ROUTE_MONITOR_INSTANCE_VIEW + '?id=' + r.id, '查看流程')}>查看</Button>
58
- <Popconfirm title={'关闭流程'}
59
- onConfirm={() => this.close(r.id)}>
60
- <Button size='small' >终止</Button>
61
- </Popconfirm></Space>
62
- }
63
- }
64
-
65
- ]
66
-
67
- close = (id) => {
68
- HttpUtils.get(MONITOR_PROCESS_INSTANCE_CLOSE, {id}).then((rs) => {
69
- this.tableRef.current.reload()
70
- }).catch(e => {
71
- message.error(e?.message || '关闭流程失败');
72
- })
73
- }
74
-
75
- tableRef = React.createRef()
76
-
77
- render() {
78
- return <ProTable
79
- actionRef={this.tableRef}
80
- columns={this.columns}
81
- request={(params) => HttpUtils.get(MONITOR_INSTANCE_PAGE, params)}
82
- >
83
-
84
- </ProTable>
85
- }
86
- }
@@ -1,5 +0,0 @@
1
- import InstanceView from "@/components/InstanceView";
2
-
3
- export default function MonitorInstanceView() {
4
- return <InstanceView showVariables />;
5
- }
@@ -1,101 +0,0 @@
1
- import {FieldUserSelect, HttpUtils, Page, ProTable} from "@jiangood/open-admin";
2
- import {Button, Form, message, Modal} from "antd";
3
- import React from "react";
4
- import {MONITOR_SET_ASSIGNEE, MONITOR_TASK} from "@/constants/api";
5
-
6
- export default class extends React.Component {
7
-
8
-
9
- state = {
10
- assigneeFormOpen:false,
11
- assigneeFormValues:{}
12
- }
13
-
14
- assigneeFormRef = React.createRef()
15
- taskTableRef = React.createRef()
16
-
17
- onClickSetAssignee = id => {
18
- this.setState({assigneeFormOpen:true,assigneeFormValues:{taskId:id}})
19
- };
20
-
21
- submitSetAssignee = values => {
22
- HttpUtils.post(MONITOR_SET_ASSIGNEE,values).then(()=>{
23
- this.setState({assigneeFormOpen:false})
24
- this.taskTableRef.current.reload()
25
- }).catch(e => {
26
- message.error(e?.message || '指定处理人失败');
27
- })
28
- };
29
- render() {
30
- return <Page padding>
31
- <ProTable
32
- actionRef={this.taskTableRef}
33
- columns={[
34
- {
35
- dataIndex: 'processInstanceName',
36
- title: '实例名称'
37
- },
38
- {
39
- dataIndex: 'name',
40
- title: '任务名称',
41
- },
42
- {
43
- dataIndex: 'assigneeLabel',
44
- title: '处理人'
45
- },
46
- {
47
- dataIndex: 'id',
48
- title: '任务标识',
49
- },
50
-
51
- {
52
- dataIndex: 'processDefinitionId',
53
- title: '定义'
54
- },
55
- {
56
- dataIndex: 'processInstanceId',
57
- title: '实例'
58
- },
59
-
60
-
61
-
62
- {
63
- dataIndex: 'startTime',
64
- title: '开始时间'
65
- },
66
- {
67
- dataIndex: 'tenantId',
68
- title: '租户'
69
- },
70
-
71
- {
72
- dataIndex:'id',
73
- render:(id)=>{
74
- return <Button size='small' onClick={()=>this.onClickSetAssignee(id)}>指定处理人</Button>
75
- }
76
- }
77
- ]}
78
- request={(params) => HttpUtils.get(MONITOR_TASK, params)}
79
- >
80
- <Form.Item label='受理人' name='assignee'>
81
- <FieldUserSelect />
82
- </Form.Item>
83
- </ProTable>
84
- <Modal title='指定处理人'
85
- open={this.state.assigneeFormOpen}
86
- onOk={()=>this.assigneeFormRef.current.submit()}
87
- onCancel={()=>this.setState({assigneeFormOpen:false})}
88
- destroyOnHidden
89
- >
90
- <Form ref={this.assigneeFormRef} onFinish={this.submitSetAssignee} initialValues={this.state.assigneeFormValues}>
91
- <Form.Item name='taskId' noStyle>
92
- </Form.Item>
93
- <Form.Item name='assignee' label='用户'>
94
- <FieldUserSelect />
95
- </Form.Item>
96
- </Form>
97
- </Modal>
98
- </Page>
99
- }
100
-
101
- }
@@ -1,159 +0,0 @@
1
- import React from "react";
2
- import {Button, Card, Empty, Form, Input, message, Radio, Spin, Splitter, Table, Typography} from "antd";
3
- import ProcessImageViewer from "@/components/ProcessImageViewer";
4
- import {FormRegistryUtils, Gap, HttpUtils, Page, PageUtils} from "@jiangood/open-admin";
5
- import {USER_TASK_GET_INSTANCE_INFO_BY_TASK_ID, USER_TASK_HANDLE_TASK} from "@/constants/api";
6
-
7
- export default class extends React.Component {
8
-
9
- state = {
10
- submitLoading: false,
11
-
12
-
13
- formData: {},
14
-
15
-
16
- instanceCommentList: [],
17
- vars: {},
18
-
19
-
20
- data: {
21
- taskId: null,
22
- commentList: [],
23
- img: null
24
- },
25
- loading: true,
26
-
27
- errorMsg: null
28
- }
29
-
30
- componentDidMount() {
31
- const {taskId} = PageUtils.currentParams()
32
-
33
-
34
- HttpUtils.get(USER_TASK_GET_INSTANCE_INFO_BY_TASK_ID, {taskId}).then(rs => {
35
- this.setState({data: rs})
36
- }).catch(e => {
37
- message.error(e?.message || '获取任务信息失败');
38
- this.setState({errorMsg: e})
39
- }).finally(() => {
40
- this.setState({loading: false})
41
- })
42
-
43
-
44
- }
45
-
46
-
47
- handleTask = async value => {
48
- this.setState({submitLoading: true});
49
- try {
50
- if (value.result === 'APPROVE') {
51
- value.formData = this.state.formData
52
- }
53
- value.taskId = this.state.data.taskId
54
- await HttpUtils.post(USER_TASK_HANDLE_TASK, value)
55
-
56
- PageUtils.closeCurrent()
57
- } catch (error) {
58
- message.error(error?.message || '操作失败')
59
- } finally {
60
- this.setState({submitLoading: false})
61
- }
62
-
63
- }
64
-
65
- render() {
66
- const {submitLoading} = this.state
67
-
68
- const {data, loading} = this.state
69
- const {commentList, img} = data
70
- if (loading) {
71
- return <Spin/>
72
- }
73
- return <Page padding>
74
-
75
- <Splitter>
76
- <Splitter.Panel>
77
- <Typography.Title level={4}>{data.name}</Typography.Title>
78
- <Typography.Text type="secondary">{data.starter} &nbsp;&nbsp; {data.startTime}</Typography.Text>
79
- <Gap></Gap>
80
- {this.renderForm()}
81
- </Splitter.Panel>
82
- <Splitter.Panel>
83
- <Card title='审批意见'>
84
- <Form
85
- layout='vertical'
86
- onFinish={this.handleTask}
87
- disabled={submitLoading}
88
- >
89
-
90
- <Form.Item label='审批结果' name='result' rules={[{required: true, message: '请选择'}]}
91
- initialValue={'APPROVE'}>
92
- <Radio.Group>
93
- <Radio value='APPROVE'>同意</Radio>
94
- <Radio value='REJECT'>不同意</Radio>
95
- </Radio.Group>
96
- </Form.Item>
97
- <Form.Item label='审批意见' name='comment'
98
- rules={[{required: true, message: '请输入审批意见'}]}>
99
- <Input.TextArea/>
100
- </Form.Item>
101
- <div>
102
- <Button type='primary' htmlType='submit' loading={submitLoading}
103
- size={"middle"}>提交</Button>
104
- </div>
105
- </Form>
106
- </Card>
107
- <Gap></Gap>
108
- {this.renderProcess(img, commentList)}
109
- </Splitter.Panel>
110
-
111
- </Splitter>
112
-
113
-
114
- </Page>
115
-
116
-
117
- }
118
-
119
- renderProcess = (img, commentList) => <Card title='处理记录'>
120
- <ProcessImageViewer imageUrl={img}/>
121
- <Gap></Gap>
122
- <Table dataSource={commentList}
123
-
124
- size='small'
125
- pagination={false}
126
- rowKey='id'
127
- columns={[
128
- {
129
- dataIndex: 'content',
130
- title: '操作'
131
- },
132
- {
133
- dataIndex: 'user',
134
- title: '处理人',
135
- },
136
- {
137
- dataIndex: 'time',
138
- title: '处理时间'
139
- },
140
- ]}
141
- />
142
- </Card>;
143
-
144
- renderForm = () => {
145
- const {data, formData} = this.state
146
- const {businessKey} = data
147
- const formKey = data.formKey;
148
- const formName = data.formKey + 'Form'
149
-
150
- let ExForm = FormRegistryUtils.get(formName);
151
- if (!ExForm) {
152
- console.error(" 表单不存在: " + formName + ",请检查表单源代码:src/forms/" + formName + ".jsx")
153
- return <Empty description={"表单不存在: " + formName}></Empty>
154
- }
155
-
156
- return <ExForm id={businessKey} formKey={formKey} value={formData}
157
- onChange={v => this.setState({formData: v})}></ExForm>
158
- }
159
- }
@@ -1,5 +0,0 @@
1
- import InstanceView from "@/components/InstanceView";
2
-
3
- export default function UserTaskInstanceView() {
4
- return <InstanceView />;
5
- }