@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,10 @@
1
+ import {defineConfig} from 'umi';
2
+ import {defaultConfig} from "./defaultConfig";
3
+
4
+
5
+
6
+
7
+
8
+ export default defineConfig({
9
+ ...defaultConfig,
10
+ });
@@ -0,0 +1,10 @@
1
+ // .umirc.local.ts 仅在 umi dev 时有效。umi build 时不会被加载
2
+ // 这份配置会和 .umirc.ts 做 deep merge 后形成最终配置。
3
+
4
+
5
+ import {defineConfig} from 'umi';
6
+ import { defaultConfigLocal} from "./defaultConfig";
7
+
8
+
9
+
10
+ export default defineConfig(defaultConfigLocal);
@@ -0,0 +1,35 @@
1
+ const defaultConfig = {
2
+ npmClient: 'pnpm',
3
+
4
+ // 配置是否让生成的文件包含 hash 后缀,通常用于增量发布和避免浏览器加载缓存。
5
+ hash: true,
6
+ history: {type: 'hash'},
7
+ // monorepo 复杂,还得设置忽略、编译等,先关掉
8
+ mfsu: false,
9
+ };
10
+
11
+
12
+ const defaultConfigLocal = {
13
+
14
+ proxy: {
15
+ '/admin': {
16
+ target: 'http://127.0.0.1:8002',
17
+ changeOrigin: true,
18
+ },
19
+ '/ureport': {
20
+ target: 'http://127.0.0.1:8002',
21
+ changeOrigin: true,
22
+ pathRewrite: {'^/ureport': '/ureport'},
23
+ },
24
+ '/ws-log-view': {
25
+ target: 'http://127.0.0.1:8002',
26
+ changeOrigin: true,
27
+ ws: true,
28
+ },
29
+ }
30
+ };
31
+
32
+
33
+ module.exports = {
34
+ defaultConfig, defaultConfigLocal
35
+ }
@@ -0,0 +1,44 @@
1
+ const IApi = require( 'umi').IApi;
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+
6
+
7
+
8
+
9
+ module.exports = (api) => {
10
+ api.describe({
11
+ key: 'registryForms',
12
+ });
13
+
14
+ const dir = api.cwd + "/src/forms"
15
+ const files = fs.readdirSync(dir)
16
+ api.register({
17
+ key: 'addEntryImports',
18
+ fn: ()=>{
19
+ return 'import { formRegistry } from "./framework/system/FormRegistry";'
20
+ }
21
+ })
22
+ api.addEntryImports(()=>{
23
+ return {
24
+ source: "./framework/system/FormRegistry",
25
+ specifier: 'formRegistry'
26
+ }
27
+ })
28
+
29
+ files.forEach(fileName=>{
30
+ const fullPath = path.join(dir, fileName)
31
+ const stats = fs.statSync(fullPath)
32
+ if (stats.isFile() && fileName.endsWith(".jsx")) {
33
+ api.register({
34
+ key: 'addEntryCode',
35
+ fn: () => {
36
+ return 'formRegistry.register("' + fileName + '", ' + fileName.substring(0, fileName.length - 4) + ');
37
+ }
38
+ })
39
+ }
40
+ })
41
+
42
+
43
+ };
44
+
@@ -0,0 +1,82 @@
1
+ const IApi = require( 'umi').IApi;
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+
6
+ // 扫描依赖模块的路由
7
+
8
+ function addRoute(file, fileRoutes) {
9
+ let routePath = file.substring(file.indexOf('pages') + 6, file.length - 4)
10
+ routePath = routePath.replaceAll('\\', '/')
11
+
12
+ let parentId = "@@/global-layout";
13
+
14
+ // 文件$开头的会替换为路径变量 如$id 变为 :id
15
+ routePath = routePath.replaceAll("\$", ":")
16
+
17
+ fileRoutes.push({
18
+ absPath: file,
19
+ id: routePath,
20
+ path: routePath,
21
+ file,
22
+ parentId
23
+ })
24
+ if (routePath.endsWith("/index")) {
25
+ routePath = routePath.substring(0, routePath.length - 6)
26
+ fileRoutes.push({
27
+ absPath: file,
28
+ id: routePath,
29
+ path: routePath,
30
+ file,
31
+ parentId: parentId
32
+ })
33
+ }
34
+ }
35
+
36
+
37
+
38
+ module.exports = (api) => {
39
+ api.describe({
40
+ key: 'addDependenceRoutes',
41
+ });
42
+
43
+ const content = fs.readFileSync(api.cwd + "/package.json", "utf-8")
44
+ const pkg = JSON.parse(content)
45
+ const deps = Object.assign({}, pkg.devDependencies, pkg.dependencies, pkg.peerDependencies)
46
+ const pagePkg = [];
47
+ for (let k in deps) {
48
+ if (k.startsWith("@jiangood/springboot-admin-starter")) {
49
+ pagePkg.push(k)
50
+ }
51
+ }
52
+
53
+ const fileRoutes = []
54
+ for (let pkg of pagePkg) {
55
+ const pageDir = api.cwd + "/node_modules/" + pkg + "/src/pages"
56
+ parseDir(pageDir, fileRoutes)
57
+ }
58
+ api.modifyRoutes((routes) => {
59
+ for (let fileRoute of fileRoutes) {
60
+ if(routes[fileRoute.id] == null){
61
+ routes[fileRoute.id] = fileRoute
62
+ }
63
+ }
64
+ return routes;
65
+ })
66
+ };
67
+ function parseDir(pageDir, fileRoutes) {
68
+ const list = fs.readdirSync(pageDir)
69
+
70
+ for (let fileName of list) {
71
+ const fullPath = path.join(pageDir, fileName)
72
+ const stats = fs.statSync(fullPath)
73
+ if (stats.isFile()) {
74
+ if (fileName.endsWith(".jsx")) {
75
+ addRoute(fullPath, fileRoutes)
76
+ }
77
+ } else if (stats.isDirectory()) {
78
+ parseDir(fullPath, fileRoutes)
79
+ }
80
+
81
+ }
82
+ }
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "devDependencies": {
3
+ "@types/react": "^19.2.2",
4
+ "@types/react-dom": "^19.0.0",
5
+ "@types/react-lazylog": "^4.5.1",
6
+ "@umijs/plugins": "^4.3.17",
7
+ "typescript": "^5.0.0"
8
+ },
9
+ "peerDependencies": {
10
+ "@ant-design/icons": "^5.4.0",
11
+ "@ant-design/v5-patch-for-react-19": "^1.0.3",
12
+ "@tinymce/tinymce-react": "^6.0.0",
13
+ "@umijs/types": "^3.5.43",
14
+ "antd": "^5.26.1",
15
+ "antd-img-crop": "^4.23.0",
16
+ "bpmn-js": "^18.7.0",
17
+ "dagre-d3": "^0.6.0",
18
+ "dayjs": "^1.11.13",
19
+ "echarts": "^5.6.0",
20
+ "jsencrypt": "^3.5.4",
21
+ "qs": "^6.14.0",
22
+ "react": "^19.0.0",
23
+ "react-amap": "^1.2.8",
24
+ "react-dom": "^19.0.0",
25
+ "react-lazylog": "^4.5.3",
26
+ "umi": "^4.0.0",
27
+ "axios": "^1.13.2"
28
+ },
29
+ "name": "@jiangood/springboot-admin-starter",
30
+ "description": "springboot-admin-starter",
31
+ "files": [
32
+ "src/*",
33
+ "config/*"
34
+ ],
35
+ "main": "src/index.js",
36
+ "version": "0.0.1",
37
+ "scripts": {
38
+ "dev": "umi dev",
39
+ "build": "umi build"
40
+ }
41
+ }
package/src/.npmignore ADDED
@@ -0,0 +1,6 @@
1
+ node_modules/
2
+
3
+ .umi/
4
+
5
+ .umi-production/
6
+ .umi/
package/src/app.js ADDED
File without changes
Binary file
Binary file
@@ -0,0 +1,138 @@
1
+ import React from "react";
2
+ import {Card, Empty, Modal, Skeleton, Table, Tabs, Typography} from "antd";
3
+
4
+ import {FormOutlined, ShareAltOutlined} from "@ant-design/icons";
5
+ import {formRegistry, Gap, HttpUtil} from "../framework";
6
+
7
+ export default class InstanceInfo extends React.Component {
8
+
9
+ state = {
10
+ instanceCommentList: [],
11
+ vars: {},
12
+
13
+ id: null,
14
+ starter: null,
15
+ startTime: null,
16
+ name: null,
17
+
18
+ data: {
19
+ commentList: [],
20
+ img: null
21
+ },
22
+ loading: true,
23
+
24
+ errorMsg: null
25
+ }
26
+
27
+
28
+ componentDidMount() {
29
+ const {id, businessKey} = this.props;
30
+ HttpUtil.get("admin/flowable/my/getInstanceInfo", {id, businessKey}).then(rs => {
31
+ this.setState(rs)
32
+ this.setState({data: rs})
33
+ }).catch(e => {
34
+ this.setState({errorMsg: e})
35
+ }).finally(() => {
36
+ this.setState({loading: false})
37
+ })
38
+
39
+ }
40
+
41
+ onImgClick = () => {
42
+ const {data} = this.state
43
+
44
+ const {img} = data
45
+ Modal.info({
46
+ title: '流程图',
47
+ width: '70vw',
48
+ content: <div style={{width: '100%', overflow: 'auto', maxHeight: '80vh'}}><img src={img}/></div>
49
+ })
50
+ };
51
+
52
+ render() {
53
+ if (this.state.errorMsg) {
54
+ return <Empty description={this.state.errorMsg}></Empty>
55
+ }
56
+
57
+ const {data, loading} = this.state
58
+ const {commentList, img} = data
59
+ if (loading) {
60
+ return <Skeleton/>
61
+ }
62
+
63
+
64
+ return <>
65
+ <Typography.Title level={4}>{data.name}</Typography.Title>
66
+ <Typography.Text type="secondary">{data.starter} &nbsp;&nbsp; {data.startTime}</Typography.Text>
67
+ <Gap></Gap>
68
+ <Tabs
69
+ items={[
70
+ {
71
+ key: '1',
72
+ label: '表单',
73
+ icon: <FormOutlined/>,
74
+ children: this.renderForm()
75
+ },
76
+ {
77
+ key: '2',
78
+ label: '流程',
79
+ icon: <ShareAltOutlined/>,
80
+ children: this.renderProcess(img, commentList)
81
+ }
82
+ ]}>
83
+
84
+ </Tabs>
85
+
86
+
87
+ </>
88
+
89
+ }
90
+
91
+ renderProcess = (img, commentList) => <Card title='处理记录'>
92
+ {img && <img src={img} style={{maxWidth: '100%'}}
93
+ onClick={this.onImgClick}/>}
94
+ <Table dataSource={commentList}
95
+ bordered
96
+ size='small'
97
+ pagination={false}
98
+ rowKey='id'
99
+ columns={[
100
+ {
101
+ dataIndex: 'content',
102
+ title: '操作'
103
+ },
104
+ {
105
+ dataIndex: 'user',
106
+ title: '处理人'
107
+ },
108
+ {
109
+ dataIndex: 'time',
110
+ title: '处理时间'
111
+ },
112
+ ]}
113
+ />
114
+ </Card>;
115
+
116
+ renderForm = () => {
117
+ const {data} = this.state
118
+ const {processDefinitionKey, businessKey} = data
119
+
120
+ let formKey = this.props.formKey || processDefinitionKey + 'Form';
121
+ let ExForm = formRegistry.get(formKey);
122
+ if (!ExForm) {
123
+ return <div>
124
+ 未注册表单,请注册表单 {formKey}。
125
+ <Gap></Gap>
126
+ <div>js代码示例:</div>
127
+ <div>
128
+ // app.js
129
+ </div>
130
+ <div>
131
+ formRegistry.register("{formKey}",XXXForm)
132
+ </div>
133
+ </div>
134
+ }
135
+
136
+ return <ExForm id={businessKey} formKey={formKey} ref={this.props.externalFormRef} taskInfo={this.props.taskInfo}></ExForm>
137
+ }
138
+ }
@@ -0,0 +1,79 @@
1
+ import React from "react";
2
+ import {Card, Empty, Skeleton, Table} from "antd";
3
+ import {HttpUtil} from "../framework";
4
+
5
+
6
+ export default class InstanceStatusInfo extends React.Component {
7
+
8
+ state = {
9
+ instanceCommentList: [],
10
+ vars: {},
11
+
12
+ id: null,
13
+ starter: null,
14
+ startTime: null,
15
+ name: null,
16
+
17
+ data: {
18
+ commentList: [],
19
+ img: null
20
+ },
21
+ loading: true,
22
+
23
+ errorMsg: null
24
+ }
25
+
26
+
27
+ componentDidMount() {
28
+ const {id, businessKey} = this.props;
29
+ HttpUtil.get("admin/flowable/my/getInstanceInfo", {id, businessKey}).then(rs => {
30
+ this.setState(rs)
31
+ this.setState({data: rs})
32
+ }).catch(e => {
33
+ this.setState({errorMsg: e})
34
+ }).finally(() => {
35
+ this.setState({loading: false})
36
+ })
37
+
38
+ }
39
+
40
+
41
+ render() {
42
+ if (this.state.errorMsg) {
43
+ return <Empty description={this.state.errorMsg}></Empty>
44
+ }
45
+
46
+ const {data, loading} = this.state
47
+ const {commentList, img} = data
48
+ if (loading) {
49
+ return <Skeleton/>
50
+ }
51
+
52
+
53
+ return <Card title='处理记录'>
54
+ <img src={img} style={{maxWidth: '100%'}}/>
55
+ <Table dataSource={commentList}
56
+ bordered
57
+ size='small'
58
+ pagination={false}
59
+ rowKey='id'
60
+ columns={[
61
+ {
62
+ dataIndex: 'content',
63
+ title: '操作'
64
+ },
65
+ {
66
+ dataIndex: 'user',
67
+ title: '处理人'
68
+ },
69
+ {
70
+ dataIndex: 'time',
71
+ title: '处理时间'
72
+ },
73
+ ]}
74
+ />
75
+ </Card>
76
+
77
+ }
78
+
79
+ }
@@ -0,0 +1,27 @@
1
+ import {LazyLog, ScrollFollow} from "react-lazylog";
2
+ import React from "react";
3
+ import {SysUtil} from "../framework";
4
+
5
+ /**
6
+ * https://mozilla-frontend-infra.github.io/react-lazylog/
7
+ */
8
+ export default class extends React.Component {
9
+
10
+ render() {
11
+ const url = this.props.url;
12
+ const headers = SysUtil.getHeaders();
13
+
14
+
15
+ return <ScrollFollow
16
+ startFollowing={true}
17
+ render={({follow, onScroll}) => (
18
+ <LazyLog url={url}
19
+ height={500}
20
+ follow={follow}
21
+ fetchOptions={{credentials:'include', ...headers}}
22
+ onScroll={onScroll}/>
23
+ )}
24
+ />
25
+
26
+ }
27
+ }
@@ -0,0 +1,85 @@
1
+ function removeProperty(businessObject, key) {
2
+ delete businessObject.$attrs[key];
3
+ }
4
+
5
+ function removeAllProperty(businessObject) {
6
+ const keys = Object.keys(businessObject.$attrs);
7
+ keys.forEach((key) => {
8
+ delete businessObject.$attrs[key];
9
+ });
10
+ }
11
+
12
+ function setProperty(businessObject, key, value) {
13
+ if (value == null || value == '') {
14
+ removeProperty(businessObject, key);
15
+ } else {
16
+ businessObject.set(key, value);
17
+ }
18
+ }
19
+
20
+ // modeling.updateModdleProperties 没有处理空值
21
+ function setProperties(businessObject, values) {
22
+ for (let k in values) {
23
+ let v = values[k];
24
+ setProperty(businessObject, k, v);
25
+ }
26
+ }
27
+
28
+ export default class BpmnUtils {
29
+ constructor({ modeler, modeling }) {
30
+ this.modeling = modeling;
31
+ this.modeler = modeler;
32
+ }
33
+
34
+ modeler = null;
35
+ modeling = null;
36
+
37
+ static getFormValues(bo) {
38
+ let attrs = bo.$attrs;
39
+
40
+ const data = {};
41
+ for (let k in attrs) {
42
+ data[k.replace('flowable:', '')] = attrs[k];
43
+ }
44
+
45
+ return data;
46
+ }
47
+
48
+ static setFormValues(businessObject, formValues) {
49
+ const data = {};
50
+ for (let k in formValues) {
51
+ const v = formValues[k];
52
+ data['flowable:' + k] = v;
53
+ }
54
+
55
+ //清空原有属性
56
+ removeAllProperty(businessObject);
57
+ setProperties(businessObject, data);
58
+ }
59
+
60
+ getElementById(id) {
61
+ const elementRegistry = this.modeler.get('elementRegistry');
62
+ return elementRegistry.get(id);
63
+ }
64
+
65
+ static removeProperty = removeProperty;
66
+
67
+ static setDocumentation = (modeler, element, text) => {
68
+ const modeling = modeler.get('modeling');
69
+ const moddle = modeler.get('moddle');
70
+
71
+ var doc = moddle.create('bpmn:Documentation');
72
+ doc.text = text;
73
+
74
+ modeling.updateProperties(element, { documentation: [doc] });
75
+ };
76
+
77
+ static getDocumentation(bo) {
78
+ if (bo.documentation && bo.documentation.length > 0) {
79
+ return bo.documentation[0].text;
80
+ }
81
+ }
82
+ static removeDocumentation(modeler, element, text) {
83
+ modeling.updateProperties(element, { documentation: null });
84
+ }
85
+ }
@@ -0,0 +1,19 @@
1
+ import translations from './translations';
2
+
3
+ export default function customTranslate(template, replacements) {
4
+ replacements = replacements || {};
5
+
6
+ // Translate
7
+ let result = translations[template];
8
+ if (result == null) {
9
+ console.log('没有翻译', template);
10
+ return template;
11
+ }
12
+
13
+ // 替换变量
14
+ result = result.replace(/{([^}]+)}/g, function (_, key) {
15
+ return replacements[key] || '{' + key + '}';
16
+ });
17
+
18
+ return result;
19
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * This is a sample file that should be replaced with the actual translation.
3
+ *
4
+ * Checkout https://github.com/bpmn-io/bpmn-js-i18n for a list of available
5
+ * translations and labels to translate.
6
+ */
7
+ export default {
8
+ 'Create Task': '创建任务',
9
+ 'Exclusive Gateway': '互斥网关',
10
+ 'Parallel Gateway': '并行网关',
11
+ 'Inclusive Gateway': '包容网关',
12
+ 'Complex Gateway': '复杂网关',
13
+ 'Event based Gateway': '事件网关',
14
+ 'Message Start Event': '消息启动事件',
15
+ 'Timer Start Event': '定时启动事件',
16
+ 'Conditional Start Event': '条件启动事件',
17
+ 'Signal Start Event': '信号启动事件',
18
+ 'Error Start Event': '错误启动事件',
19
+ 'Escalation Start Event': '升级启动事件',
20
+ 'Compensation Start Event': '补偿启动事件',
21
+ 'Message Start Event (non-interrupting)': '消息启动事件 (非中断)',
22
+ 'Timer Start Event (non-interrupting)': '定时启动事件 (非中断)',
23
+ 'Conditional Start Event (non-interrupting)': '条件启动事件 (非中断)',
24
+ 'Signal Start Event (non-interrupting)': '信号启动事件 (非中断)',
25
+ 'Escalation Start Event (non-interrupting)': '升级启动事件 (非中断)',
26
+ 'Default Flow': '默认分支',
27
+ 'Sequence Flow': '普通分支',
28
+ 'Conditional Flow': '条件分支',
29
+ Remove: '删除',
30
+ 'Change type': '修改类型',
31
+ 'Activate the hand tool': '激活手动工具',
32
+ 'Activate the global connect tool': '激活全局连接工具',
33
+ 'Append User Task': '追加审批任务',
34
+ 'Append Gateway': '追加条件网管',
35
+ 'End Event': '结束事件',
36
+ 'Append {type}': '追加类型{type}',
37
+ 'Append EndEvent': '追加结束事件',
38
+ 'Append Task': '追加任务',
39
+ 'Create Group': '创建分组',
40
+
41
+ 'Activate the lasso tool': '激活连接工具',
42
+ 'Activate the create/remove space tool': '激活创建/删除空间工具',
43
+ 'Create StartEvent': '创建开始事件',
44
+ 'Create Intermediate/Boundary Event': '创建边界事件',
45
+ 'Create EndEvent': '创建结束事件',
46
+ 'Create Gateway': '创建网关',
47
+ 'Create DataObjectReference': '创建对象引用?',
48
+ 'Create DataStoreReference': '创建对象存储引用',
49
+ 'Create expanded SubProcess': '创建子流程',
50
+ 'Create Pool/Participant': '创建泳道',
51
+
52
+ 'Append Intermediate/Boundary Event': '追加泳道',
53
+ 'Intermediate Throw Event': '中间抛出事件',
54
+ 'Connect using Sequence/MessageFlow or Association': '连线',
55
+
56
+ 'Receive Task': '接收任务',
57
+ 'Send Task': '发送任务',
58
+ 'User Task': '用户任务(审核,处理)',
59
+ 'Manual Task': '手动任务',
60
+ 'Business Rule Task': '业务规则任务',
61
+ 'Service Task': '服务任务',
62
+ 'Script Task': '脚本任务',
63
+ 'Call Activity': '拨打任务',
64
+ 'Sub Process (collapsed)': '子流程收缩',
65
+ 'Sub Process (expanded)': '子流程展开',
66
+ 'Parallel Multi Instance': '并行多实例',
67
+ 'Sequential Multi Instance': '串行多实例',
68
+ Loop: '循环',
69
+
70
+ 'Start Event': '开始事件',
71
+ 'Message End Event': '消息结束事件',
72
+ 'Escalation End Event': 'Escalation End Event',
73
+ 'Error End Event': '异常结束事件',
74
+ 'Compensation End Event': 'Compensation End Event',
75
+ 'Signal End Event': '信号结束事件',
76
+ 'Terminate End Event': '终止结束事件',
77
+
78
+ Task: '普通任务',
79
+ };