@jiangood/open-admin-flowable 2.2.2 → 2.2.4

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