@jiangood/springboot-admin-starter 0.0.1

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 (213) hide show
  1. package/config/config.js +10 -0
  2. package/config/config.local.js +10 -0
  3. package/config/defaultConfig.js +35 -0
  4. package/config/plugins/forms.js +44 -0
  5. package/config/plugins/routes.js +82 -0
  6. package/package.json +41 -0
  7. package/src/.npmignore +6 -0
  8. package/src/app.js +0 -0
  9. package/src/asserts/login_bg.jpg +0 -0
  10. package/src/asserts/welcome.png +0 -0
  11. package/src/components/InstanceInfo.jsx +138 -0
  12. package/src/components/InstanceStatusInfo.jsx +79 -0
  13. package/src/components/StreamLog.jsx +27 -0
  14. package/src/components/flow/BpmnUtils.js +85 -0
  15. package/src/components/flow/customTranslate/customTranslate.js +19 -0
  16. package/src/components/flow/customTranslate/translations.js +79 -0
  17. package/src/components/flow/design/contextPad.js +50 -0
  18. package/src/components/flow/design/form/ConditionForm.jsx +316 -0
  19. package/src/components/flow/design/form/ServiceTaskForm.jsx +55 -0
  20. package/src/components/flow/design/form/TimerEventDefinitionForm.jsx +62 -0
  21. package/src/components/flow/design/form/UserTaskForm.jsx +211 -0
  22. package/src/components/flow/design/palette.js +39 -0
  23. package/src/components/monitor/AllDefinition.jsx +46 -0
  24. package/src/components/monitor/AllInstance.jsx +76 -0
  25. package/src/forms/demoForm.jsx +16 -0
  26. package/src/framework/components/ButtonList.d.ts +9 -0
  27. package/src/framework/components/ButtonList.jsx +91 -0
  28. package/src/framework/components/DownloadFileButton.d.ts +11 -0
  29. package/src/framework/components/DownloadFileButton.jsx +33 -0
  30. package/src/framework/components/Echarts/index.d.ts +10 -0
  31. package/src/framework/components/Echarts/index.jsx +49 -0
  32. package/src/framework/components/EditTable/index.d.ts +11 -0
  33. package/src/framework/components/EditTable/index.jsx +85 -0
  34. package/src/framework/components/EditTable/index.less +29 -0
  35. package/src/framework/components/Ellipsis.jsx +39 -0
  36. package/src/framework/components/Ellipsis.less +8 -0
  37. package/src/framework/components/FieldRemoteTree.jsx +20 -0
  38. package/src/framework/components/Gap/index.d.ts +10 -0
  39. package/src/framework/components/Gap/index.jsx +15 -0
  40. package/src/framework/components/Gap/index.less +3 -0
  41. package/src/framework/components/HasPerm.jsx +18 -0
  42. package/src/framework/components/ImageView.d.ts +12 -0
  43. package/src/framework/components/ImageView.jsx +64 -0
  44. package/src/framework/components/LinkButton.d.ts +14 -0
  45. package/src/framework/components/LinkButton.jsx +13 -0
  46. package/src/framework/components/MsgBox.jsx +180 -0
  47. package/src/framework/components/NamedIcon.tsx +15 -0
  48. package/src/framework/components/OrgTree.jsx +60 -0
  49. package/src/framework/components/Page/index.d.ts +10 -0
  50. package/src/framework/components/Page/index.jsx +30 -0
  51. package/src/framework/components/Page/index.less +10 -0
  52. package/src/framework/components/PageLoading.jsx +31 -0
  53. package/src/framework/components/Panel/index.d.ts +11 -0
  54. package/src/framework/components/Panel/index.jsx +24 -0
  55. package/src/framework/components/Panel/index.less +0 -0
  56. package/src/framework/components/ProModal/index.tsx +66 -0
  57. package/src/framework/components/ProTable/components/ToolBar/index.jsx +124 -0
  58. package/src/framework/components/ProTable/components/ToolBar/index.less +53 -0
  59. package/src/framework/components/ProTable/index.d.ts +38 -0
  60. package/src/framework/components/ProTable/index.jsx +258 -0
  61. package/src/framework/components/ProTable/index.less +3 -0
  62. package/src/framework/components/ProTable/utils/index.js +43 -0
  63. package/src/framework/components/RoleTree.jsx +53 -0
  64. package/src/framework/components/ValueType/index.jsx +34 -0
  65. package/src/framework/components/ValueType/registry.jsx +38 -0
  66. package/src/framework/components/field/FieldAutoTime/index.tsx +46 -0
  67. package/src/framework/components/field/FieldBoolean/index.tsx +92 -0
  68. package/src/framework/components/field/FieldEditTable/index.d.ts +13 -0
  69. package/src/framework/components/field/FieldEditTable/index.jsx +103 -0
  70. package/src/framework/components/field/FieldEditTable/index.less +29 -0
  71. package/src/framework/components/field/FieldEditor.jsx +48 -0
  72. package/src/framework/components/field/FieldFileBase64/index.d.ts +15 -0
  73. package/src/framework/components/field/FieldFileBase64/index.jsx +23 -0
  74. package/src/framework/components/field/FieldImageBase64/index.d.ts +15 -0
  75. package/src/framework/components/field/FieldImageBase64/index.jsx +22 -0
  76. package/src/framework/components/field/FieldInput.jsx +13 -0
  77. package/src/framework/components/field/FieldOrgTree/index.tsx +45 -0
  78. package/src/framework/components/field/FieldPassword.jsx +11 -0
  79. package/src/framework/components/field/FieldProps.ts +19 -0
  80. package/src/framework/components/field/FieldRemoteTreeCascader.jsx +75 -0
  81. package/src/framework/components/field/FieldRemoteTreeCheckable.jsx +81 -0
  82. package/src/framework/components/field/FieldRemoteTreeMultipleSelect.jsx +100 -0
  83. package/src/framework/components/field/FieldRemoteTreeSelect.jsx +82 -0
  84. package/src/framework/components/field/FieldSelectPosition/index.tsx +85 -0
  85. package/src/framework/components/field/FieldTree.jsx +45 -0
  86. package/src/framework/components/field/dict/index.tsx +110 -0
  87. package/src/framework/components/field/flat-multiple-select/index.d.ts +4 -0
  88. package/src/framework/components/field/flat-multiple-select/index.jsx +116 -0
  89. package/src/framework/components/field/flat-multiple-select/index.less +12 -0
  90. package/src/framework/components/field/flat-select/index.d.ts +4 -0
  91. package/src/framework/components/field/flat-select/index.jsx +107 -0
  92. package/src/framework/components/field/flat-select/index.less +12 -0
  93. package/src/framework/components/field/index.js +33 -0
  94. package/src/framework/components/field/input-number-percent/index.d.ts +11 -0
  95. package/src/framework/components/field/input-number-percent/index.jsx +28 -0
  96. package/src/framework/components/field/select/FieldSelect/index.d.ts +39 -0
  97. package/src/framework/components/field/select/FieldSelect/index.jsx +156 -0
  98. package/src/framework/components/field/select/FieldTableSelect/index.d.ts +29 -0
  99. package/src/framework/components/field/select/FieldTableSelect/index.jsx +155 -0
  100. package/src/framework/components/field/select/index.jsx +2 -0
  101. package/src/framework/components/field/switch-y-n/index.d.ts +11 -0
  102. package/src/framework/components/field/switch-y-n/index.jsx +31 -0
  103. package/src/framework/components/field/text/index.tsx +7 -0
  104. package/src/framework/components/field/time/DatePickerString.tsx +37 -0
  105. package/src/framework/components/field/time/DateTimePickerString.tsx +42 -0
  106. package/src/framework/components/field/time/FieldDateRange.d.ts +9 -0
  107. package/src/framework/components/field/time/FieldDateRange.jsx +49 -0
  108. package/src/framework/components/field/time/HHmmPickerString.tsx +42 -0
  109. package/src/framework/components/field/time/MonthPickerString.tsx +45 -0
  110. package/src/framework/components/field/time/TimePickerTool.ts +14 -0
  111. package/src/framework/components/field/time/YearPickerString.tsx +41 -0
  112. package/src/framework/components/field/time/YearQuarterString.tsx +38 -0
  113. package/src/framework/components/field/time/index.tsx +7 -0
  114. package/src/framework/components/field/upload/FieldUploadCropImage/index.d.ts +22 -0
  115. package/src/framework/components/field/upload/FieldUploadCropImage/index.jsx +11 -0
  116. package/src/framework/components/field/upload/FieldUploadFile.d.ts +35 -0
  117. package/src/framework/components/field/upload/FieldUploadFile.jsx +145 -0
  118. package/src/framework/components/field/upload/FieldUploadImage.d.ts +7 -0
  119. package/src/framework/components/field/upload/FieldUploadImage.jsx +16 -0
  120. package/src/framework/components/field/upload/index.jsx +3 -0
  121. package/src/framework/components/index.js +25 -0
  122. package/src/framework/components/system.jsx +29 -0
  123. package/src/framework/components/view/ViewBoolean.jsx +15 -0
  124. package/src/framework/components/view/ViewBooleanEnableDisable.jsx +16 -0
  125. package/src/framework/components/view/ViewEllipsis.d.ts +11 -0
  126. package/src/framework/components/view/ViewEllipsis.jsx +30 -0
  127. package/src/framework/components/view/ViewFile.d.ts +10 -0
  128. package/src/framework/components/view/ViewFile.jsx +50 -0
  129. package/src/framework/components/view/ViewFileButton.d.ts +10 -0
  130. package/src/framework/components/view/ViewFileButton.jsx +0 -0
  131. package/src/framework/components/view/ViewImage.d.ts +9 -0
  132. package/src/framework/components/view/ViewImage.jsx +61 -0
  133. package/src/framework/components/view/ViewPassword.jsx +24 -0
  134. package/src/framework/components/view/ViewRange/index.d.ts +16 -0
  135. package/src/framework/components/view/ViewRange/index.jsx +20 -0
  136. package/src/framework/components/view/ViewText.jsx +9 -0
  137. package/src/framework/components/view/index.js +12 -0
  138. package/src/framework/index.js +3 -0
  139. package/src/framework/system/FormRegistry.js +58 -0
  140. package/src/framework/system/dict.js +88 -0
  141. package/src/framework/system/http.jsx +290 -0
  142. package/src/framework/system/index.js +13 -0
  143. package/src/framework/system/page.js +109 -0
  144. package/src/framework/system/permission.js +44 -0
  145. package/src/framework/system/sys.js +60 -0
  146. package/src/framework/system/theme.js +17 -0
  147. package/src/framework/utils/arr.js +118 -0
  148. package/src/framework/utils/browser.js +24 -0
  149. package/src/framework/utils/color.js +269 -0
  150. package/src/framework/utils/date.js +173 -0
  151. package/src/framework/utils/debounce.js +33 -0
  152. package/src/framework/utils/dom.js +16 -0
  153. package/src/framework/utils/eventBus.js +70 -0
  154. package/src/framework/utils/html.js +13 -0
  155. package/src/framework/utils/index.js +17 -0
  156. package/src/framework/utils/obj.js +72 -0
  157. package/src/framework/utils/storage.js +37 -0
  158. package/src/framework/utils/str.js +297 -0
  159. package/src/framework/utils/tree.js +175 -0
  160. package/src/framework/utils/uid.js +76 -0
  161. package/src/framework/utils/url.js +84 -0
  162. package/src/framework/utils/validate.js +9 -0
  163. package/src/index.js +2 -0
  164. package/src/layouts/PageRender.d.ts +22 -0
  165. package/src/layouts/PageRender.jsx +90 -0
  166. package/src/layouts/admin/HeaderRight.jsx +104 -0
  167. package/src/layouts/admin/TabPageRender.jsx +158 -0
  168. package/src/layouts/admin/index.jsx +174 -0
  169. package/src/layouts/admin/index.less +64 -0
  170. package/src/layouts/index.jsx +163 -0
  171. package/src/layouts/index.less +45 -0
  172. package/src/loading.jsx +18 -0
  173. package/src/pages/404.jsx +13 -0
  174. package/src/pages/about.jsx +14 -0
  175. package/src/pages/api/accessLog/index.jsx +108 -0
  176. package/src/pages/api/accountResource/index.jsx +149 -0
  177. package/src/pages/api/doc.jsx +135 -0
  178. package/src/pages/api/index.jsx +163 -0
  179. package/src/pages/api/resource.jsx +18 -0
  180. package/src/pages/flowable/design/index.css +7 -0
  181. package/src/pages/flowable/design/index.jsx +297 -0
  182. package/src/pages/flowable/index.jsx +128 -0
  183. package/src/pages/flowable/instance/view.jsx +13 -0
  184. package/src/pages/flowable/monitor.jsx +106 -0
  185. package/src/pages/flowable/task/form.jsx +99 -0
  186. package/src/pages/flowable/task/index.jsx +200 -0
  187. package/src/pages/flowable/test/form.jsx +31 -0
  188. package/src/pages/flowable/test/index.jsx +54 -0
  189. package/src/pages/index.jsx +25 -0
  190. package/src/pages/job/index.jsx +239 -0
  191. package/src/pages/job/logList.jsx +100 -0
  192. package/src/pages/job/status.jsx +84 -0
  193. package/src/pages/login.jsx +144 -0
  194. package/src/pages/login.less +53 -0
  195. package/src/pages/system/config/index.jsx +136 -0
  196. package/src/pages/system/dict/Dict.jsx +73 -0
  197. package/src/pages/system/dict/DictItem.jsx +177 -0
  198. package/src/pages/system/dict/index.jsx +25 -0
  199. package/src/pages/system/file/index.jsx +152 -0
  200. package/src/pages/system/log/index.jsx +78 -0
  201. package/src/pages/system/org/index.jsx +263 -0
  202. package/src/pages/system/role/index.jsx +314 -0
  203. package/src/pages/system/role/perm.jsx +111 -0
  204. package/src/pages/system/sysManual/index.jsx +127 -0
  205. package/src/pages/system/user/UserPerm.jsx +132 -0
  206. package/src/pages/system/user/index.jsx +261 -0
  207. package/src/pages/test.jsx +16 -0
  208. package/src/pages/ureport/index.jsx +43 -0
  209. package/src/pages/userCenter/ChangePassword.jsx +64 -0
  210. package/src/pages/userCenter/index.jsx +90 -0
  211. package/src/pages/userCenter/manual.jsx +63 -0
  212. package/src/pages/userCenter/message.jsx +105 -0
  213. package/src/style/global.less +51 -0
@@ -0,0 +1,297 @@
1
+ import React from "react";
2
+ import {Button, Card, Col, Empty, Form, Input, message, Modal, Row, Space} from "antd";
3
+
4
+ import 'bpmn-js/dist/assets/diagram-js.css'
5
+ import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
6
+ import {getBusinessObject} from "bpmn-js/lib/util/ModelUtil";
7
+ import BpmnModeler from 'bpmn-js/lib/Modeler'
8
+
9
+ import './index.css'
10
+ import customTranslate from "../../../components/flow/customTranslate/customTranslate";
11
+ import TimerEventDefinitionForm from "../../../components/flow/design/form/TimerEventDefinitionForm";
12
+ import ServiceTaskForm from "../../../components/flow/design/form/ServiceTaskForm";
13
+ import ConditionForm from "../../../components/flow/design/form/ConditionForm";
14
+ import UserTaskForm from "../../../components/flow/design/form/UserTaskForm";
15
+ import palette from "../../../components/flow/design/palette";
16
+ import contextPad from "../../../components/flow/design/contextPad";
17
+ import {CloudUploadOutlined, SaveOutlined} from "@ant-design/icons";
18
+ import {HttpUtil, PageUtil} from "../../../framework";
19
+
20
+ export default class extends React.Component {
21
+
22
+
23
+ state = {
24
+ id: null,
25
+ model: null,
26
+ conditionVariable: null,
27
+
28
+ elementType: null,
29
+ elementName: '',
30
+
31
+ showForm: false, // 表单切换过渡使用
32
+
33
+
34
+ openXmlModal: false,
35
+ xml: null
36
+
37
+ }
38
+ curBo = null
39
+ curNode = null
40
+
41
+ bpmRef = React.createRef()
42
+
43
+ preXmlRef = React.createRef()
44
+
45
+ componentDidMount() {
46
+ let params = PageUtil.currentParams()
47
+ this.state.id = params.id
48
+ this.bpmnModeler = new BpmnModeler({
49
+ additionalModules: [
50
+ // 汉化翻译
51
+ {
52
+ translate: ['value', customTranslate]
53
+ },
54
+ palette,
55
+ contextPad,
56
+ ]
57
+ });
58
+
59
+ this.modeling = this.bpmnModeler.get('modeling'); // 建模, 包含很多方法
60
+ this.moddle = this.bpmnModeler.get('moddle'); // 数据模型, 主要存储元数据
61
+
62
+
63
+ HttpUtil.get('admin/flowable/model/detail', {id: this.state.id}).then(rs => {
64
+ let {conditionVariable, model} = rs;
65
+ this.setState({model, conditionVariable}, () => this.initBpmn(model.content))
66
+ })
67
+
68
+
69
+ window.bpmnModeler = this.bpmnModeler
70
+ window.moddle = this.moddle;
71
+ window.modeling = this.modeling;
72
+ }
73
+
74
+ initBpmn = xml => {
75
+ let parentNode = this.bpmRef.current;
76
+ this.bpmnModeler.attachTo(parentNode);
77
+ this.bpmnModeler.importXML(xml)
78
+
79
+ this.bpmnModeler.on('element.contextmenu', e => e.preventDefault()) // 关闭右键,影响操作
80
+ this.bpmnModeler.on('selection.changed', this.onSelectionChanged);
81
+ //this.bpmnModeler.on('element.changed', this.refreshForm);
82
+ };
83
+
84
+
85
+ showXML = () => {
86
+ this.bpmnModeler.saveXML({format: true}).then(res => {
87
+ this.setState({
88
+ openXmlModal: true,
89
+ xml: res.xml
90
+ })
91
+ })
92
+ }
93
+
94
+
95
+ handleChangeXml = () => {
96
+ const xml = this.preXmlRef.current.innerText;
97
+
98
+ const root = this.bpmnModeler.getDefinitions().rootElements[0]
99
+ const {id, name} = root;
100
+
101
+
102
+ this.bpmnModeler.importXML(xml)
103
+ root.set('id', id)
104
+ root.set('name', name)
105
+
106
+ message.success('编辑完成');
107
+ this.setState({openXmlModal: false})
108
+ }
109
+
110
+ onSelectionChanged = e => {
111
+ const {newSelection} = e;
112
+ if (newSelection.length !== 1) {
113
+ this.setState({showForm: false})
114
+ return null
115
+ }
116
+ const curNode = newSelection[0]
117
+ const curBo = getBusinessObject(curNode)
118
+
119
+ this.curBo = curBo;
120
+ this.curNode = curNode;
121
+
122
+ let elementType = curBo.$type.replace("bpmn:", "");
123
+ let elementName = curBo.get('name');
124
+
125
+ console.log('选择元素', elementType, curBo)
126
+
127
+ this.setState({
128
+ elementType,
129
+ elementName,
130
+ })
131
+ // 给一个过渡期
132
+ this.refreshForm()
133
+ }
134
+
135
+
136
+ handleSubmit = () => {
137
+ let id = this.state.id;
138
+
139
+ return new Promise((resolve, reject) => {
140
+ const hide = message.loading('保存中...', 0)
141
+ this.bpmnModeler.saveXML().then(res => {
142
+ HttpUtil.post('admin//flowable/model/saveContent', {id: id, content: res.xml}).then(rs => {
143
+ hide()
144
+ message.success('服务端保存成功')
145
+ resolve()
146
+ }).catch(e => {
147
+ hide()
148
+ reject()
149
+ })
150
+ })
151
+ })
152
+ }
153
+ handleDeploy = () => {
154
+ let id = this.state.id;
155
+
156
+ this.bpmnModeler.saveXML().then(res => {
157
+ HttpUtil.post('admin//flowable/model/deploy', {id: id, content: res.xml})
158
+ })
159
+ }
160
+
161
+
162
+ refreshForm = () => {
163
+ this.setState({showForm: false}, () => this.setState({showForm: true}))
164
+ }
165
+
166
+
167
+ render() {
168
+ console.log('this.bpmRef', this.bpmRef)
169
+
170
+ return <Card title={'流程设计 - ' + this.state.model?.name}
171
+ extra={<Space>
172
+ <Button type='primary' icon={<SaveOutlined/>} onClick={this.handleSubmit}>暂存</Button>
173
+ <Button type='primary' danger icon={<CloudUploadOutlined/>}
174
+ onClick={this.handleDeploy}>部署</Button>
175
+ <Button onClick={this.showXML}>XML</Button>
176
+ <Button
177
+ onClick={() => PageUtil.open('/flowable/test?id=' + this.state.id, "流程测试")}> 测试 </Button>
178
+
179
+ </Space>}>
180
+
181
+
182
+ <Row gutter={16} wrap={false} style={{height: '90vh'}}>
183
+ <Col flex='auto'>
184
+ <div ref={this.bpmRef} style={{width: '100%', height: '100%'}}></div>
185
+ </Col>
186
+
187
+ <Col flex='300px'>
188
+ <Card title='属性面板'>
189
+ {this.renderForm()}
190
+ </Card>
191
+
192
+ {this.renderMultiInstanceLoopCharacteristics()}
193
+ </Col>
194
+ </Row>
195
+
196
+
197
+ <Modal title='流程定义XML文本内容' open={this.state.openXmlModal}
198
+ okText='确定'
199
+ width='70vw'
200
+ onOk={this.handleChangeXml}
201
+ onCancel={() => this.setState({openXmlModal: false})}>
202
+ <div style={{maxHeight: '70vh', overflow: 'auto'}}>
203
+ {this.state.xml && <pre ref={this.preXmlRef} contentEditable>
204
+ {this.state.xml}
205
+ </pre>}
206
+
207
+ </div>
208
+ </Modal>
209
+ </Card>
210
+ }
211
+
212
+
213
+ renderForm = () => {
214
+ if (!this.state.showForm) {
215
+ return <Empty description='请选择节点'/>
216
+ }
217
+ const {elementType, conditionVariable} = this.state;
218
+ const {curBo} = this
219
+
220
+ switch (elementType) {
221
+ case 'SequenceFlow':
222
+ return <ConditionForm conditionVariable={conditionVariable}
223
+ moddle={this.moddle}
224
+ bo={curBo}
225
+ node={this.curNode}
226
+ modeling={this.modeling}
227
+ />
228
+ case 'UserTask':
229
+ return <UserTaskForm bo={curBo} node={this.curNode} modeling={this.modeling} model={this.state.model}/>
230
+ case 'ServiceTask':
231
+ return <ServiceTaskForm bo={curBo}/>
232
+ case 'StartEvent':
233
+ if (curBo.eventDefinitions != null) {
234
+ return <TimerEventDefinitionForm bo={curBo}/>
235
+ }
236
+ }
237
+ return <></>
238
+ };
239
+
240
+ // 多实例,支持任务和子流程
241
+ renderMultiInstanceLoopCharacteristics = () => {
242
+ if (!this.state.showForm) {
243
+ return
244
+ }
245
+
246
+ const {elementType, conditionVariable} = this.state;
247
+ const {curBo} = this
248
+
249
+
250
+ if (elementType !== 'SubProcess') {
251
+ return
252
+ }
253
+ let bo = curBo.loopCharacteristics;
254
+ if (!bo) {
255
+ return
256
+ }
257
+
258
+ const initialValues = Object.assign({}, bo.$attrs)
259
+
260
+ if (bo.loopCardinality) {
261
+ initialValues.loopCardinality = bo.loopCardinality.body
262
+ }
263
+
264
+ return <Card title='多实例配置'>
265
+ <Form layout='vertical' onValuesChange={this.onMultiInstanceLoopCharacteristicsChange}
266
+ initialValues={initialValues}>
267
+ <Form.Item label='循环基数' name='loopCardinality'>
268
+ <Input placeholder='数字或表达式,如 ${userCount}'/>
269
+ </Form.Item>
270
+
271
+ <Form.Item label='集合' name='flowable:collection'>
272
+ <Input placeholder='如 userList'/>
273
+ </Form.Item>
274
+ <Form.Item label='元素变量' name='flowable:elementVariable'>
275
+ <Input placeholder='如 user'/>
276
+ </Form.Item>
277
+
278
+ </Form>
279
+ </Card>
280
+
281
+
282
+ };
283
+
284
+ onMultiInstanceLoopCharacteristicsChange = (changedValue, values) => {
285
+ let bo = this.curBo.loopCharacteristics;
286
+ if (changedValue.loopCardinality != null) {
287
+ const expression = this.moddle.create('bpmn:FormalExpression', {body: changedValue.loopCardinality});
288
+ bo.loopCardinality = expression;
289
+ return
290
+ }
291
+
292
+ for (let key in changedValue) {
293
+ bo.set(key, changedValue[key])
294
+ }
295
+ }
296
+
297
+ }
@@ -0,0 +1,128 @@
1
+ import {Button, Modal, Popconfirm, Space} from 'antd';
2
+ import React from 'react';
3
+ import {PlusOutlined} from "@ant-design/icons";
4
+ import {HttpUtil, PageUtil, ProTable} from "../../framework";
5
+
6
+ export default class extends React.Component {
7
+
8
+
9
+ state = {
10
+ formValues: {},
11
+ formOpen: false
12
+ }
13
+
14
+ actionRef = React.createRef();
15
+ formRef = React.createRef();
16
+
17
+
18
+ columns = [
19
+ {
20
+ title: '模型名称',
21
+ dataIndex: 'name',
22
+ sorter: true
23
+ },
24
+ {
25
+ title: '唯一编码',
26
+ dataIndex: 'code'
27
+ },
28
+ {
29
+ title: '表单链接',
30
+ dataIndex: 'formUrl'
31
+ },
32
+ {
33
+ title: '更新时间',
34
+ dataIndex: 'updateTime',
35
+ },
36
+
37
+
38
+ {
39
+ title: '操作',
40
+ dataIndex: 'option',
41
+ render: (_, record) => (
42
+ <Space>
43
+ <Button size='small' type='primary'
44
+ onClick={() => PageUtil.open('/flowable/design?id=' + record.id, '流程设计' + record.name)}> 设计 </Button>
45
+ <Button size='small' onClick={() => this.handleEdit(record)}> 编辑 </Button>
46
+ <Popconfirm perm='flowable/model:delete' title={'是否确定删除流程模型' }
47
+ onConfirm={() => this.handleDelete(record)}>
48
+ <Button size='small' danger>删除</Button>
49
+ </Popconfirm>
50
+ </Space>
51
+ ),
52
+ },
53
+ ];
54
+
55
+
56
+ handleAdd = () => {
57
+ this.setState({
58
+ formOpen: true,
59
+ formValues: {}
60
+ })
61
+ }
62
+
63
+ handleEdit = record => {
64
+ this.setState({
65
+ formOpen: true,
66
+ formValues: record
67
+ })
68
+ }
69
+ onFinish = values => {
70
+ HttpUtil.post('admin/flowable/model/save', values).then(rs => {
71
+ this.actionRef.current.reload()
72
+ this.setState({formOpen: false})
73
+ })
74
+ }
75
+
76
+ handleDelete = row => {
77
+ HttpUtil.get('admin/flowable/model/delete', {id: row.id}).then(rs => {
78
+ this.actionRef.current.reload();
79
+ })
80
+ }
81
+
82
+
83
+ render() {
84
+ const demo = `@Component
85
+ @ProcessDefinitionDescription(key = "demo",name = "demo-派车流程", formKeys = @FormKeyDescription(value = "driverForm",label = "司机表单"))
86
+ public class DemoProcess implements ProcessDefinition {
87
+
88
+ @Override
89
+ public void onProcessEvent(FlowableEventType type, String initiator, String businessKey, Map<String, Object> variables) {
90
+
91
+ }
92
+ }
93
+ `
94
+
95
+ return <>
96
+ <ProTable
97
+ search={false}
98
+ actionRef={this.actionRef}
99
+ toolBarRender={() => <Button icon={<PlusOutlined/>} type='primary'
100
+ onClick={this.handleAdd}> 新增</Button>}
101
+ request={(params) => HttpUtil.pageData('admin/flowable/model/page', params)}
102
+ columns={this.columns}
103
+ rowSelection={false}
104
+ rowKey="id"
105
+ options={{search: true}}
106
+ />
107
+
108
+ <Modal title='模型基本信息'
109
+ open={this.state.formOpen}
110
+ onCancel={() => this.setState({formOpen: false})}
111
+ width={1024}
112
+ footer={null}
113
+ >
114
+
115
+ 不支持页面创建, 请参考Java代码
116
+ <pre>
117
+ {demo}
118
+ </pre>
119
+
120
+ </Modal>
121
+ </>
122
+ }
123
+
124
+
125
+ }
126
+
127
+
128
+
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import InstanceStatusInfo from "../../../components/InstanceStatusInfo";
3
+ import {PageUtil} from "../../../framework";
4
+
5
+ export default class extends React.Component {
6
+
7
+
8
+ render() {
9
+ const {businessKey, id} = PageUtil.currentParams()
10
+ return <InstanceStatusInfo businessKey={businessKey} id={id}/>
11
+ }
12
+
13
+ }
@@ -0,0 +1,106 @@
1
+ import React from "react";
2
+ import {Button, Form, Modal, Tabs} from "antd";
3
+ import AllDefinition from "../../components/monitor/AllDefinition";
4
+ import AllInstance from "../../components/monitor/AllInstance";
5
+ import {FieldUserSelect, HttpUtil, Page, ProTable} from "../../framework";
6
+
7
+ export default class extends React.Component {
8
+
9
+ state = {
10
+ assigneeFormOpen:false,
11
+ assigneeFormValues:{}
12
+ }
13
+
14
+ assigneeFormRef = React.createRef()
15
+ taskTableRef = React.createRef()
16
+ render() {
17
+ const items = [
18
+ {label: '运行中的任务', key: 'AllTask', children: this.renderTask()},
19
+ {label: '运行中的流程', key: 'AllInstance', children: <AllInstance/>},
20
+
21
+ {label: '所有定义', key: 'AllDefinition', children: <AllDefinition/>},
22
+ ];
23
+ return <Page padding> <Tabs items={items} destroyOnHidden /></Page>
24
+
25
+ }
26
+
27
+ renderTask = () => {
28
+ return<> <ProTable
29
+ actionRef={this.taskTableRef}
30
+ columns={[
31
+ {
32
+ dataIndex: 'id',
33
+ title: '任务标识',
34
+ },
35
+ {
36
+ dataIndex: 'name',
37
+ title: '名称',
38
+ },
39
+
40
+ {
41
+ dataIndex: 'processDefinitionId',
42
+ title: '定义'
43
+ },
44
+ {
45
+ dataIndex: 'processInstanceId',
46
+ title: '实例'
47
+ },
48
+
49
+ {
50
+ dataIndex: 'assignee',
51
+ title: '处理人'
52
+ },
53
+ {
54
+ dataIndex: 'assigneeLabel',
55
+ title: '处理人显示名'
56
+ },
57
+ {
58
+ dataIndex: 'startTime',
59
+ title: '开始时间'
60
+ },
61
+ {
62
+ dataIndex: 'tenantId',
63
+ title: '租户'
64
+ },
65
+
66
+ {
67
+ dataIndex:'id',
68
+ render:(id)=>{
69
+ return <Button size='small' onClick={()=>this.onClickSetAssignee(id)}>指定处理人</Button>
70
+ }
71
+ }
72
+ ]}
73
+ request={(params) => HttpUtil.pageData('admin/flowable/monitor/task', params)}
74
+ >
75
+ <Form.Item label='受理人' name='assignee'>
76
+ <FieldUserSelect />
77
+ </Form.Item>
78
+ </ProTable>
79
+ <Modal title='指定处理人'
80
+ open={this.state.assigneeFormOpen}
81
+ onOk={()=>this.assigneeFormRef.current.submit()}
82
+ onCancel={()=>this.setState({assigneeFormOpen:false})}
83
+ destroyOnHidden
84
+ >
85
+ <Form ref={this.assigneeFormRef} onFinish={this.submitSetAssignee} initialValues={this.state.assigneeFormValues}>
86
+ <Form.Item name='taskId' noStyle>
87
+ </Form.Item>
88
+ <Form.Item name='assignee' label='用户'>
89
+ <FieldUserSelect />
90
+ </Form.Item>
91
+ </Form>
92
+ </Modal>
93
+ </>
94
+ };
95
+
96
+ onClickSetAssignee = id => {
97
+ this.setState({assigneeFormOpen:true,assigneeFormValues:{taskId:id}})
98
+ };
99
+
100
+ submitSetAssignee = values => {
101
+ HttpUtil.post('admin/flowable/monitor/setAssignee',values).then(()=>{
102
+ this.setState({assigneeFormOpen:false})
103
+ this.taskTableRef.current.reload()
104
+ })
105
+ };
106
+ }
@@ -0,0 +1,99 @@
1
+ import React from "react";
2
+ import {Button, Card, Form, Input, message, Radio, Spin, Splitter,} from "antd";
3
+ import InstanceInfo from "../../../components/InstanceInfo";
4
+ import {history} from "umi";
5
+ import {HttpUtil, Page} from "../../../framework";
6
+
7
+ export default class extends React.Component {
8
+
9
+ state = {
10
+ submitLoading: false,
11
+ taskId: null,
12
+ instanceId: null,
13
+ formKey: null,
14
+
15
+ taskInfo: null
16
+ }
17
+
18
+
19
+
20
+ externalFormRef = React.createRef()
21
+
22
+ componentDidMount() {
23
+ const {taskId, instanceId, formKey} = PageUtil.currentParams()
24
+ this.setState({taskId, instanceId, formKey})
25
+
26
+ HttpUtil.get('admin/flowable/my/taskInfo', {id: taskId}).then(rs=>{
27
+ console.log('任务信息',rs)
28
+ this.setState({taskInfo:rs})
29
+ })
30
+
31
+ }
32
+
33
+ handleTask = async value => {
34
+ this.setState({submitLoading: true});
35
+ try {
36
+ if (value.result === 'APPROVE') {
37
+ const fn = this.externalFormRef.current?.submit
38
+ if (fn) {
39
+ await fn()
40
+ }
41
+ }
42
+
43
+ value.taskId = this.state.taskId
44
+ await HttpUtil.post("admin//flowable/my/handleTask", value)
45
+ history.replace('/flowable/task')
46
+ } catch (error) {
47
+ message.error(error)
48
+ } finally {
49
+ this.setState({submitLoading: false})
50
+ }
51
+
52
+ }
53
+
54
+ render() {
55
+ const {submitLoading,taskInfo} = this.state
56
+ const instanceId = this.state.instanceId
57
+ if (!instanceId || !taskInfo) {
58
+ return <Spin/>
59
+ }
60
+ return <Page padding>
61
+
62
+ <Splitter>
63
+ <Splitter.Panel>
64
+ <InstanceInfo id={instanceId} formKey={this.state.formKey} externalFormRef={this.externalFormRef} taskInfo={taskInfo}/>
65
+ </Splitter.Panel>
66
+ <Splitter.Panel defaultSize={400}>
67
+ <Card title='审批意见'>
68
+ <Form
69
+ layout='vertical'
70
+ onFinish={this.handleTask}
71
+ disabled={submitLoading}
72
+ >
73
+ <Form.Item label='审批结果' name='result' rules={[{required: true, message: '请选择'}]}
74
+ initialValue={'APPROVE'}>
75
+ <Radio.Group>
76
+ <Radio value='APPROVE'>同意</Radio>
77
+ <Radio value='REJECT'>不同意</Radio>
78
+ </Radio.Group>
79
+ </Form.Item>
80
+ <Form.Item label='审批意见' name='comment'
81
+ rules={[{required: true, message: '请输入审批意见'}]}>
82
+ <Input.TextArea/>
83
+ </Form.Item>
84
+ <div>
85
+ <Button type='primary' htmlType='submit' loading={submitLoading}
86
+ size={"middle"}>提&nbsp;交</Button>
87
+ </div>
88
+ </Form>
89
+ </Card>
90
+ </Splitter.Panel>
91
+
92
+ </Splitter>
93
+
94
+
95
+ </Page>
96
+
97
+
98
+ }
99
+ }