@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.
package/package.json CHANGED
@@ -34,5 +34,5 @@
34
34
  "scripts": {
35
35
  "dev": "umi dev"
36
36
  },
37
- "version": "2.2.1"
37
+ "version": "2.2.3"
38
38
  }
@@ -10,8 +10,6 @@ import customTranslate from "./customTranslate/customTranslate";
10
10
  import contextPad from "./contextPad";
11
11
  import {CloudUploadOutlined, DownloadOutlined, SaveOutlined, UploadOutlined} from "@ant-design/icons";
12
12
  import {HttpUtils, PageLoading, PageUtils, ProTable} from "@jiangood/open-admin";
13
- import {MODEL_DETAIL, MODEL_SAVE_CONTENT, MODEL_DEPLOY, MODEL_GET_DEFINITION_CONTENT, MODEL_DEFINITION_PAGE} from "@/constants/api";
14
- import {ROUTE_SIMULATE} from "@/constants/routes";
15
13
  import 'bpmn-js/dist/assets/bpmn-js.css';
16
14
  import flowableJson from './descriptors/flowable';
17
15
  import PropertiesPanel from './PropertiesPanel';
@@ -32,7 +30,7 @@ export default class extends React.Component {
32
30
 
33
31
  async componentDidMount() {
34
32
  const params = PageUtils.currentParams()
35
- const rs = await HttpUtils.get(MODEL_DETAIL, {id: params.id})
33
+ const rs = await HttpUtils.get('admin/flowable/model/detail', {id: params.id})
36
34
  this.setState({model: rs, id: params.id}, this.initBpmn)
37
35
  }
38
36
 
@@ -91,7 +89,7 @@ export default class extends React.Component {
91
89
  const hide = message.loading('正在保存...', 0)
92
90
  try {
93
91
  const res = await this.bpmnModeler.saveXML();
94
- await HttpUtils.post(MODEL_SAVE_CONTENT, {id, content: res.xml});
92
+ await HttpUtils.post('admin/flowable/model/saveContent', {id, content: res.xml});
95
93
  } finally {
96
94
  hide()
97
95
  }
@@ -102,7 +100,7 @@ export default class extends React.Component {
102
100
  const hide = message.loading('正在部署...', 0)
103
101
  try {
104
102
  const res = await this.bpmnModeler.saveXML();
105
- await HttpUtils.post(MODEL_DEPLOY, {id, content: res.xml});
103
+ await HttpUtils.post('admin/flowable/model/deploy', {id, content: res.xml});
106
104
  } finally {
107
105
  hide()
108
106
  }
@@ -115,13 +113,13 @@ export default class extends React.Component {
115
113
  }
116
114
  return <Card title={'流程设计 ' + this.state.model?.name}
117
115
  extra={<Space>
118
- <Button type='primary' icon={<SaveOutlined/>} onClick={this.handleSave}>暂存</Button>
116
+ <Button type='primary' icon={<SaveOutlined/>} onClick={this.handleSave}>保存</Button>
119
117
  <Button type='primary' danger icon={<CloudUploadOutlined/>}
120
118
  onClick={this.handleDeploy}>部署</Button>
121
119
  <Button icon={<DownloadOutlined/>} onClick={this.handleExportXML}>导出XML</Button>
122
120
  <Button icon={<UploadOutlined/>} onClick={this.handleImportXML}>导入XML</Button>
123
121
  <Button
124
- onClick={() => PageUtils.open(ROUTE_SIMULATE + '?id=' + this.state.id, "流程仿真")}> 仿真 </Button>
122
+ onClick={() => PageUtils.open('/flowable/simulate' + '?id=' + this.state.id, "流程仿真")}> 仿真 </Button>
125
123
 
126
124
  <Button title='查看已部署的历史版本' onClick={() => {
127
125
  this.setState({deployedModal: true})
@@ -164,7 +162,7 @@ export default class extends React.Component {
164
162
  dataIndex:'id',
165
163
  render:(_, record)=> {
166
164
  return <Button type='primary' onClick={()=>{
167
- HttpUtils.get(MODEL_GET_DEFINITION_CONTENT,{id: record.id}).then(xml=>{
165
+ HttpUtils.get('admin/flowable/model/getDefinitionContent',{id: record.id}).then(xml=>{
168
166
  this.bpmnModeler.importXML(xml)
169
167
  this.setState({deployedModal:false})
170
168
  })
@@ -174,7 +172,7 @@ export default class extends React.Component {
174
172
  ]}
175
173
  request={params => {
176
174
  params.key = this.state.model.key
177
- return HttpUtils.get(MODEL_DEFINITION_PAGE, params)
175
+ return HttpUtils.get('admin/flowable/model/definitionPage', params)
178
176
  }}>
179
177
 
180
178
  </ProTable>
@@ -1,7 +1,6 @@
1
1
  import {Form, Radio} from "antd";
2
2
  import {FieldRemoteSelect, FieldRemoteSelectMultipleInline, StringUtils} from "@jiangood/open-admin";
3
3
  import React from "react";
4
- import {MODEL_ASSIGNEE_OPTIONS, MODEL_CANDIDATE_GROUPS_OPTIONS, MODEL_CANDIDATE_USERS_OPTIONS} from "@/constants/api";
5
4
 
6
5
  export default function AssignmentSection(props) {
7
6
  const {element, modeling} = props
@@ -57,17 +56,17 @@ export default function AssignmentSection(props) {
57
56
  }}>
58
57
  {mode === 'assignee' && (
59
58
  <Form.Item label="办理人" name='assignee'>
60
- <FieldRemoteSelect url={MODEL_ASSIGNEE_OPTIONS}/>
59
+ <FieldRemoteSelect url='admin/flowable/model/assigneeOptions'/>
61
60
  </Form.Item>
62
61
  )}
63
62
  {mode === 'candidateGroups' && (
64
63
  <Form.Item label="候选组" name='candidateGroups'>
65
- <FieldRemoteSelect url={MODEL_CANDIDATE_GROUPS_OPTIONS}/>
64
+ <FieldRemoteSelect url='admin/flowable/model/candidateGroupsOptions'/>
66
65
  </Form.Item>
67
66
  )}
68
67
  {mode === 'candidateUsers' && (
69
68
  <Form.Item label="候选人" name='candidateUsers'>
70
- <FieldRemoteSelectMultipleInline url={MODEL_CANDIDATE_USERS_OPTIONS}/>
69
+ <FieldRemoteSelectMultipleInline url='admin/flowable/model/candidateUsersOptions'/>
71
70
  </Form.Item>
72
71
  )}
73
72
  </Form>
@@ -1,7 +1,6 @@
1
1
  import {Button, Input, InputNumber, Modal, Select} from "antd";
2
2
  import {Component} from "react";
3
3
  import {FieldBoolean, FieldTable, HttpUtils, ObjectUtils, StringUtils, ThemeUtils} from "@jiangood/open-admin";
4
- import {MODEL_VAR_LIST} from "@/constants/api";
5
4
  import {ConditionExpressionUtils} from "./ConditionExpressionUtils";
6
5
 
7
6
 
@@ -133,7 +132,7 @@ export class ConditionDesignButton extends Component {
133
132
 
134
133
  componentDidMount() {
135
134
  const {processId} = this.props;
136
- HttpUtils.get(MODEL_VAR_LIST, {code: processId}).then(rs => {
135
+ HttpUtils.get('admin/flowable/model/varList', {code: processId}).then(rs => {
137
136
  const options = rs.map(r => {
138
137
  return {
139
138
  label: r.label,
@@ -1,13 +1,12 @@
1
1
  import {Select} from 'antd';
2
2
  import {useEffect, useState} from 'react';
3
3
  import {HttpUtils} from "@jiangood/open-admin";
4
- import {MODEL_JAVA_DELEGATE_OPTIONS} from "@/constants/api";
5
4
 
6
5
  export default function DelegateExpressionField({element, modeling}) {
7
6
  const [options, setOptions] = useState([]);
8
7
 
9
8
  useEffect(() => {
10
- HttpUtils.get(MODEL_JAVA_DELEGATE_OPTIONS).then(rs => {
9
+ HttpUtils.get('admin/flowable/model/javaDelegateOptions').then(rs => {
11
10
  setOptions((rs || []).map(o => typeof o === 'string' ? {label: o, value: o} : o));
12
11
  });
13
12
  }, []);
@@ -1,13 +1,12 @@
1
1
  import {Select} from 'antd';
2
2
  import {useEffect, useState} from 'react';
3
3
  import {HttpUtils} from "@jiangood/open-admin";
4
- import {MODEL_FORM_OPTIONS} from "@/constants/api";
5
4
 
6
5
  export default function FormField({element, modeling, processId}) {
7
6
  const [options, setOptions] = useState([]);
8
7
 
9
8
  useEffect(() => {
10
- HttpUtils.get(MODEL_FORM_OPTIONS, {code: processId}).then(rs => {
9
+ HttpUtils.get('admin/flowable/model/formOptions', {code: processId}).then(rs => {
11
10
  setOptions((rs || []).map(o => typeof o === 'string' ? {label: o, value: o} : o));
12
11
  });
13
12
  }, [processId]);
@@ -1,14 +1,98 @@
1
- import {Button, Popconfirm, Space} from 'antd';
1
+ import {Button, Card, Empty, Form, message, Modal, Popconfirm, Skeleton, Space, Table} from 'antd';
2
2
  import React from 'react';
3
- import {ButtonList, HttpUtils, Page, PageUtils, ProTable} from "@jiangood/open-admin";
4
- import {MODEL_PAGE, MODEL_DELETE} from "@/constants/api";
5
- import {ROUTE_DESIGN, ROUTE_MONITOR_TASK, ROUTE_MONITOR_INSTANCE, ROUTE_MONITOR_DEFINITION} from "@/constants/routes";
3
+ import {ButtonList, FieldUserSelect, Gap, HttpUtils, Page, PageUtils, ProTable} from "@jiangood/open-admin";
6
4
 
7
- export default class extends React.Component {
5
+ class InstanceViewModal extends React.Component {
6
+ state = {
7
+ commentList: [],
8
+ id: null,
9
+ img: null,
10
+ loading: true,
11
+ errorMsg: null,
12
+ }
13
+
14
+ componentDidMount() {
15
+ const {id, businessKey} = this.props;
16
+ const reqParams = {id};
17
+ if (businessKey) reqParams.businessKey = businessKey;
18
+ HttpUtils.get('admin/flowable/user-task/getInstanceInfo', reqParams).then(rs => {
19
+ this.setState({
20
+ ...rs,
21
+ commentList: rs.commentList,
22
+ img: rs.img,
23
+ id: rs.id,
24
+ })
25
+ }).catch(e => {
26
+ this.setState({errorMsg: e})
27
+ }).finally(() => {
28
+ this.setState({loading: false})
29
+ })
30
+ }
31
+
32
+ getCommentColumns() {
33
+ return [
34
+ {dataIndex: 'content', title: '操作'},
35
+ {dataIndex: 'user', title: '处理人'},
36
+ {dataIndex: 'time', title: '处理时间'},
37
+ ];
38
+ }
39
+
40
+ render() {
41
+ if (this.state.errorMsg) {
42
+ return <Empty description={this.state.errorMsg}/>
43
+ }
44
+
45
+ const {commentList, img, loading, id} = this.state
46
+ if (loading) {
47
+ return <Skeleton/>
48
+ }
49
+
50
+ return <>
51
+ <Card title='流程图'>
52
+ <img src={img} style={{maxWidth: '100%'}}/>
53
+ </Card>
54
+ <Gap/>
55
+ <Card title='审批记录'>
56
+ <Table dataSource={commentList}
57
+ size='small'
58
+ pagination={false}
59
+ rowKey='id'
60
+ columns={this.getCommentColumns()}
61
+ />
62
+ </Card>
63
+ <Gap/>
64
+ {this.props.showVariables && (
65
+ <Card title='流程变量'>
66
+ <ProTable columns={[
67
+ {dataIndex: 'key', title: '变量名'},
68
+ {dataIndex: 'value', title: '变量值'},
69
+ ]}
70
+ rowKey='key'
71
+ request={() => HttpUtils.get('admin/flowable/monitor/instance/vars', {id})}
72
+ />
73
+ </Card>
74
+ )}
75
+ </>;
76
+ }
77
+ }
8
78
 
79
+ export default class extends React.Component {
9
80
 
10
81
  actionRef = React.createRef();
82
+ taskTableRef = React.createRef();
83
+ instanceTableRef = React.createRef();
84
+ definitionTableRef = React.createRef();
85
+ assigneeFormRef = React.createRef();
11
86
 
87
+ state = {
88
+ taskModalOpen: false,
89
+ instanceModalOpen: false,
90
+ definitionModalOpen: false,
91
+ viewModalOpen: false,
92
+ viewInstanceId: null,
93
+ assigneeFormOpen: false,
94
+ assigneeFormValues: {},
95
+ }
12
96
 
13
97
  columns = [
14
98
  {
@@ -19,8 +103,6 @@ export default class extends React.Component {
19
103
  title: '代码',
20
104
  dataIndex: 'key'
21
105
  },
22
-
23
-
24
106
  {
25
107
  title: '版本',
26
108
  dataIndex: 'version',
@@ -29,15 +111,13 @@ export default class extends React.Component {
29
111
  title: '更新时间',
30
112
  dataIndex: 'lastUpdateTime',
31
113
  },
32
-
33
-
34
114
  {
35
115
  title: '操作',
36
116
  dataIndex: 'option',
37
117
  render: (_, record) => (
38
118
  <Space>
39
119
  <Button size='small' type='primary'
40
- onClick={() => PageUtils.open(ROUTE_DESIGN + '?id=' + record.id, '流程设计' + record.name)}> 设计 </Button>
120
+ onClick={() => PageUtils.open('/flowable/design' + '?id=' + record.id, '流程设计' + record.name)}> 设计 </Button>
41
121
  <Popconfirm perm='flowable/model:delete' title={'是否确定删除流程模型'}
42
122
  onConfirm={() => this.handleDelete(record)}>
43
123
  <Button size='small' danger>删除</Button>
@@ -47,42 +127,288 @@ export default class extends React.Component {
47
127
  },
48
128
  ];
49
129
 
50
-
51
130
  handleDelete = row => {
52
- HttpUtils.post(MODEL_DELETE, {id: row.id}).then(rs => {
131
+ HttpUtils.post('admin/flowable/model/delete', {id: row.id}).then(rs => {
53
132
  this.actionRef.current.reload();
54
133
  })
55
134
  }
56
135
 
136
+ onClickSetAssignee = id => {
137
+ this.setState({assigneeFormOpen: true, assigneeFormValues: {taskId: id}})
138
+ };
57
139
 
58
- render() {
140
+ submitSetAssignee = values => {
141
+ HttpUtils.post('admin/flowable/monitor/setAssignee', values).then(() => {
142
+ this.setState({assigneeFormOpen: false})
143
+ this.taskTableRef.current.reload()
144
+ }).catch(e => {
145
+ message.error(e?.message || '指定处理人失败');
146
+ })
147
+ };
148
+
149
+ instanceColumns = [
150
+ {
151
+ title: 'ID',
152
+ dataIndex: 'id',
153
+ key: 'id',
154
+ },
155
+ {
156
+ title: '名称',
157
+ dataIndex: 'name',
158
+ key: 'name',
159
+ },
160
+ {
161
+ title: '流程定义名称',
162
+ dataIndex: 'processDefinitionName',
163
+ key: 'processDefinitionName',
164
+ },
165
+ {
166
+ title: '流程定义键',
167
+ dataIndex: 'processDefinitionKey',
168
+ key: 'processDefinitionKey',
169
+ },
170
+ {
171
+ title: '版本',
172
+ dataIndex: 'processDefinitionVersion',
173
+ key: 'processDefinitionVersion',
174
+ },
175
+ {
176
+ title: '业务键',
177
+ dataIndex: 'businessKey',
178
+ key: 'businessKey',
179
+ },
180
+ {
181
+ title: '状态',
182
+ dataIndex: 'suspended',
183
+ key: 'suspended',
184
+ render: (value) => value ? '已挂起' : '运行中',
185
+ },
186
+ {
187
+ title: '开始时间',
188
+ dataIndex: 'startTime',
189
+ key: 'startTime',
190
+ },
191
+ {
192
+ dataIndex: 'options',
193
+ title: '操作',
194
+ fixed: 'right',
195
+ render: (_, r) => {
196
+ return <Space>
197
+ <Button size='small' onClick={() => this.setState({viewModalOpen: true, viewInstanceId: r.id})}>查看</Button>
198
+ <Popconfirm title={'关闭流程'}
199
+ onConfirm={() => this.closeInstance(r.id)}>
200
+ <Button size='small'>终止</Button>
201
+ </Popconfirm>
202
+ </Space>
203
+ }
204
+ }
205
+ ]
206
+
207
+ closeInstance = (id) => {
208
+ HttpUtils.get('admin/flowable/monitor/processInstance/close', {id}).then((rs) => {
209
+ this.instanceTableRef.current.reload()
210
+ }).catch(e => {
211
+ message.error(e?.message || '关闭流程失败');
212
+ })
213
+ }
59
214
 
215
+ definitionColumns = [
216
+ {
217
+ title: 'ID',
218
+ dataIndex: 'id',
219
+ },
220
+ {
221
+ title: '分类',
222
+ dataIndex: 'category',
223
+ },
224
+ {
225
+ title: '名称',
226
+ dataIndex: 'name',
227
+ },
228
+ {
229
+ title: '键',
230
+ dataIndex: 'key',
231
+ },
232
+ {
233
+ title: '描述',
234
+ dataIndex: 'description',
235
+ },
236
+ {
237
+ title: '版本',
238
+ dataIndex: 'version',
239
+ },
240
+ {
241
+ title: '资源名称',
242
+ dataIndex: 'resourceName',
243
+ },
244
+ {
245
+ title: '部署ID',
246
+ dataIndex: 'deploymentId',
247
+ },
248
+ {
249
+ title: '图表资源名称',
250
+ dataIndex: 'diagramResourceName',
251
+ },
252
+ {
253
+ title: '是否有开始表单键',
254
+ dataIndex: 'hasStartFormKey',
255
+ render: (value) => value ? '是' : '否',
256
+ },
257
+ {
258
+ title: '是否有图形符号',
259
+ dataIndex: 'hasGraphicalNotation',
260
+ render: (value) => value ? '是' : '否',
261
+ },
262
+ {
263
+ title: '是否挂起',
264
+ dataIndex: 'suspended',
265
+ render: (value) => value ? '是' : '否',
266
+ },
267
+ {
268
+ title: '租户ID',
269
+ dataIndex: 'tenantId',
270
+ },
271
+ {
272
+ title: '派生自',
273
+ dataIndex: 'derivedFrom',
274
+ },
275
+ {
276
+ title: '根派生来源',
277
+ dataIndex: 'derivedFromRoot',
278
+ },
279
+ {
280
+ title: '派生版本',
281
+ dataIndex: 'derivedVersion',
282
+ },
283
+ ]
284
+
285
+ render() {
60
286
  return <Page padding>
61
287
  <ProTable
62
288
  actionRef={this.actionRef}
63
- request={(params) => HttpUtils.get(MODEL_PAGE, params)}
289
+ request={(params) => HttpUtils.get('admin/flowable/model/page', params)}
64
290
  columns={this.columns}
65
291
  showToolbarSearch={true}
66
292
  toolBarRender={() => {
67
293
  return <ButtonList>
68
- <Button onClick={() => PageUtils.open(ROUTE_MONITOR_TASK, "运行中的任务")}>
294
+ <Button onClick={() => this.setState({taskModalOpen: true})}>
69
295
  运行中的任务
70
296
  </Button>
71
- <Button onClick={() => PageUtils.open(ROUTE_MONITOR_INSTANCE, "运行中的流程实例")}>
297
+ <Button onClick={() => this.setState({instanceModalOpen: true})}>
72
298
  运行中的流程实例
73
299
  </Button>
74
- <Button onClick={() => PageUtils.open(ROUTE_MONITOR_DEFINITION, "已部署的流程定义")}>
300
+ <Button onClick={() => this.setState({definitionModalOpen: true})}>
75
301
  已部署的流程定义
76
302
  </Button>
77
303
  </ButtonList>
78
304
  }}
79
305
  />
80
306
 
307
+ <Modal title='运行中的任务' width={1200}
308
+ open={this.state.taskModalOpen}
309
+ onCancel={() => this.setState({taskModalOpen: false})}
310
+ footer={null} destroyOnClose
311
+ >
312
+ <ProTable
313
+ actionRef={this.taskTableRef}
314
+ columns={[
315
+ {
316
+ dataIndex: 'processInstanceName',
317
+ title: '实例名称'
318
+ },
319
+ {
320
+ dataIndex: 'name',
321
+ title: '任务名称',
322
+ },
323
+ {
324
+ dataIndex: 'assigneeLabel',
325
+ title: '处理人'
326
+ },
327
+ {
328
+ dataIndex: 'id',
329
+ title: '任务标识',
330
+ },
331
+ {
332
+ dataIndex: 'processDefinitionId',
333
+ title: '定义'
334
+ },
335
+ {
336
+ dataIndex: 'processInstanceId',
337
+ title: '实例'
338
+ },
339
+ {
340
+ dataIndex: 'startTime',
341
+ title: '开始时间'
342
+ },
343
+ {
344
+ dataIndex: 'tenantId',
345
+ title: '租户'
346
+ },
347
+ {
348
+ dataIndex: 'id',
349
+ render: (id) => {
350
+ return <Button size='small' onClick={() => this.onClickSetAssignee(id)}>指定处理人</Button>
351
+ }
352
+ }
353
+ ]}
354
+ request={(params) => HttpUtils.get('admin/flowable/monitor/task', params)}
355
+ >
356
+ <Form.Item label='受理人' name='assignee'>
357
+ <FieldUserSelect/>
358
+ </Form.Item>
359
+ </ProTable>
360
+ </Modal>
81
361
 
82
- </Page>
83
- }
362
+ <Modal title='指定处理人'
363
+ open={this.state.assigneeFormOpen}
364
+ onOk={() => this.assigneeFormRef.current.submit()}
365
+ onCancel={() => this.setState({assigneeFormOpen: false})}
366
+ destroyOnClose
367
+ >
368
+ <Form ref={this.assigneeFormRef} onFinish={this.submitSetAssignee}
369
+ initialValues={this.state.assigneeFormValues}>
370
+ <Form.Item name='taskId' noStyle>
371
+ </Form.Item>
372
+ <Form.Item name='assignee' label='用户'>
373
+ <FieldUserSelect/>
374
+ </Form.Item>
375
+ </Form>
376
+ </Modal>
84
377
 
378
+ <Modal title='运行中的流程实例' width={1200}
379
+ open={this.state.instanceModalOpen}
380
+ onCancel={() => this.setState({instanceModalOpen: false})}
381
+ footer={null} destroyOnClose
382
+ >
383
+ <ProTable
384
+ actionRef={this.instanceTableRef}
385
+ columns={this.instanceColumns}
386
+ request={(params) => HttpUtils.get('admin/flowable/monitor/instancePage', params)}
387
+ />
388
+ </Modal>
85
389
 
86
- }
87
-
390
+ <Modal title='实例详情' width={1000}
391
+ open={this.state.viewModalOpen}
392
+ onCancel={() => this.setState({viewModalOpen: false})}
393
+ footer={null} destroyOnClose
394
+ >
395
+ {this.state.viewInstanceId && (
396
+ <InstanceViewModal id={this.state.viewInstanceId} showVariables/>
397
+ )}
398
+ </Modal>
88
399
 
400
+ <Modal title='已部署的流程定义' width={1200}
401
+ open={this.state.definitionModalOpen}
402
+ onCancel={() => this.setState({definitionModalOpen: false})}
403
+ footer={null} destroyOnClose
404
+ >
405
+ <ProTable
406
+ actionRef={this.definitionTableRef}
407
+ search={false}
408
+ columns={this.definitionColumns}
409
+ request={(params) => HttpUtils.get('admin/flowable/monitor/definitionPage', params)}
410
+ />
411
+ </Modal>
412
+ </Page>
413
+ }
414
+ }
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import {Button, Form, Input, Select, Splitter} from "antd";
3
3
  import {StringUtils} from "@jiangood/open-admin";
4
4
  import {PlayCircleOutlined} from "@ant-design/icons";
5
- import HistoryListPanel from "@/components/flowable/HistoryListPanel";
5
+ import HistoryListPanel from "../../../components/flowable/HistoryListPanel";
6
6
 
7
7
  export default class InitPhase extends React.Component {
8
8
  render() {
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import {Button, Card, Empty, Input, Select, Space, Splitter, Table, Tag, Typography} from "antd";
3
3
  import {CheckCircleOutlined, CloseCircleOutlined} from "@ant-design/icons";
4
- import ProcessImageViewer from "@/components/ProcessImageViewer";
4
+ import ProcessImageViewer from "../../../components/ProcessImageViewer";
5
5
 
6
6
  export default class RunningPhase extends React.Component {
7
7
  render() {
@@ -4,7 +4,6 @@ import {HttpUtils, PageLoading, PageUtils} from "@jiangood/open-admin";
4
4
  import InitPhase from "./InitPhase";
5
5
  import RunningPhase from "./RunningPhase";
6
6
  import FinishedPhase from "./FinishedPhase";
7
- import {SIMULATE_GET, SIMULATE_USERS, SIMULATE_LIST, SIMULATE_START, SIMULATE_STATUS, SIMULATE_TASK_HANDLE, SIMULATE_DELETE} from "@/constants/api";
8
7
 
9
8
  const PHASE_INIT = 'init';
10
9
  const PHASE_RUNNING = 'running';
@@ -32,7 +31,7 @@ export default class extends React.Component {
32
31
  const params = PageUtils.currentParams();
33
32
  const id = this.id = params.id;
34
33
 
35
- HttpUtils.get(SIMULATE_GET, {id}).then(rs => {
34
+ HttpUtils.get('admin/flowable/simulate/get', {id}).then(rs => {
36
35
  this.setState({model: rs}, this.loadHistory);
37
36
  });
38
37
 
@@ -40,7 +39,7 @@ export default class extends React.Component {
40
39
  }
41
40
 
42
41
  loadUsers = (searchText) => {
43
- HttpUtils.get(SIMULATE_USERS, {searchText}).then(rs => {
42
+ HttpUtils.get('admin/flowable/simulate/users', {searchText}).then(rs => {
44
43
  this.setState({users: rs || []});
45
44
  });
46
45
  }
@@ -49,7 +48,7 @@ export default class extends React.Component {
49
48
  const {model} = this.state;
50
49
  if (!model?.key) return;
51
50
  this.setState({historyLoading: true});
52
- HttpUtils.get(SIMULATE_LIST, {key: model.key}).then(rs => {
51
+ HttpUtils.get('admin/flowable/simulate/list', {key: model.key}).then(rs => {
53
52
  this.setState({historyList: rs || [], historyLoading: false});
54
53
  }).catch(e => {
55
54
  message.error(e?.message || '加载历史记录失败');
@@ -59,7 +58,7 @@ export default class extends React.Component {
59
58
 
60
59
  handleStart = values => {
61
60
  this.setState({submitting: true});
62
- HttpUtils.post(SIMULATE_START, values).then(rs => {
61
+ HttpUtils.post('admin/flowable/simulate/start', values).then(rs => {
63
62
  message.success('仿真流程已启动');
64
63
  this.loadStatus(rs.instanceId);
65
64
  }).catch(e => {
@@ -70,7 +69,7 @@ export default class extends React.Component {
70
69
 
71
70
  loadStatus = (instanceId) => {
72
71
  this.setState({loading: true, instanceId, phase: PHASE_RUNNING, taskFormValues: {}});
73
- HttpUtils.get(SIMULATE_STATUS, {instanceId}).then(rs => {
72
+ HttpUtils.get('admin/flowable/simulate/status', {instanceId}).then(rs => {
74
73
  const phase = rs.finished ? PHASE_FINISHED : PHASE_RUNNING;
75
74
  this.setState({status: rs, phase, loading: false, submitting: false});
76
75
  }).catch(e => {
@@ -109,7 +108,7 @@ export default class extends React.Component {
109
108
  }
110
109
 
111
110
  this.setState({submitting: true});
112
- HttpUtils.post(SIMULATE_TASK_HANDLE, {
111
+ HttpUtils.post('admin/flowable/simulate/task/handle', {
113
112
  taskId,
114
113
  action,
115
114
  comment: formValue.comment || '',
@@ -146,7 +145,7 @@ export default class extends React.Component {
146
145
  okType: 'danger',
147
146
  cancelText: '取消',
148
147
  onOk: () => {
149
- HttpUtils.post(SIMULATE_DELETE, {instanceId}).then(() => {
148
+ HttpUtils.post('admin/flowable/simulate/delete', {instanceId}).then(() => {
150
149
  message.success('仿真记录已删除');
151
150
  this.loadHistory();
152
151
  });