@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.
- package/config/config.js +10 -0
- package/config/config.local.js +10 -0
- package/config/defaultConfig.js +35 -0
- package/config/plugins/forms.js +44 -0
- package/config/plugins/routes.js +82 -0
- package/package.json +41 -0
- package/src/.npmignore +6 -0
- package/src/app.js +0 -0
- package/src/asserts/login_bg.jpg +0 -0
- package/src/asserts/welcome.png +0 -0
- package/src/components/InstanceInfo.jsx +138 -0
- package/src/components/InstanceStatusInfo.jsx +79 -0
- package/src/components/StreamLog.jsx +27 -0
- package/src/components/flow/BpmnUtils.js +85 -0
- package/src/components/flow/customTranslate/customTranslate.js +19 -0
- package/src/components/flow/customTranslate/translations.js +79 -0
- package/src/components/flow/design/contextPad.js +50 -0
- package/src/components/flow/design/form/ConditionForm.jsx +316 -0
- package/src/components/flow/design/form/ServiceTaskForm.jsx +55 -0
- package/src/components/flow/design/form/TimerEventDefinitionForm.jsx +62 -0
- package/src/components/flow/design/form/UserTaskForm.jsx +211 -0
- package/src/components/flow/design/palette.js +39 -0
- package/src/components/monitor/AllDefinition.jsx +46 -0
- package/src/components/monitor/AllInstance.jsx +76 -0
- package/src/forms/demoForm.jsx +16 -0
- package/src/framework/components/ButtonList.d.ts +9 -0
- package/src/framework/components/ButtonList.jsx +91 -0
- package/src/framework/components/DownloadFileButton.d.ts +11 -0
- package/src/framework/components/DownloadFileButton.jsx +33 -0
- package/src/framework/components/Echarts/index.d.ts +10 -0
- package/src/framework/components/Echarts/index.jsx +49 -0
- package/src/framework/components/EditTable/index.d.ts +11 -0
- package/src/framework/components/EditTable/index.jsx +85 -0
- package/src/framework/components/EditTable/index.less +29 -0
- package/src/framework/components/Ellipsis.jsx +39 -0
- package/src/framework/components/Ellipsis.less +8 -0
- package/src/framework/components/FieldRemoteTree.jsx +20 -0
- package/src/framework/components/Gap/index.d.ts +10 -0
- package/src/framework/components/Gap/index.jsx +15 -0
- package/src/framework/components/Gap/index.less +3 -0
- package/src/framework/components/HasPerm.jsx +18 -0
- package/src/framework/components/ImageView.d.ts +12 -0
- package/src/framework/components/ImageView.jsx +64 -0
- package/src/framework/components/LinkButton.d.ts +14 -0
- package/src/framework/components/LinkButton.jsx +13 -0
- package/src/framework/components/MsgBox.jsx +180 -0
- package/src/framework/components/NamedIcon.tsx +15 -0
- package/src/framework/components/OrgTree.jsx +60 -0
- package/src/framework/components/Page/index.d.ts +10 -0
- package/src/framework/components/Page/index.jsx +30 -0
- package/src/framework/components/Page/index.less +10 -0
- package/src/framework/components/PageLoading.jsx +31 -0
- package/src/framework/components/Panel/index.d.ts +11 -0
- package/src/framework/components/Panel/index.jsx +24 -0
- package/src/framework/components/Panel/index.less +0 -0
- package/src/framework/components/ProModal/index.tsx +66 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +124 -0
- package/src/framework/components/ProTable/components/ToolBar/index.less +53 -0
- package/src/framework/components/ProTable/index.d.ts +38 -0
- package/src/framework/components/ProTable/index.jsx +258 -0
- package/src/framework/components/ProTable/index.less +3 -0
- package/src/framework/components/ProTable/utils/index.js +43 -0
- package/src/framework/components/RoleTree.jsx +53 -0
- package/src/framework/components/ValueType/index.jsx +34 -0
- package/src/framework/components/ValueType/registry.jsx +38 -0
- package/src/framework/components/field/FieldAutoTime/index.tsx +46 -0
- package/src/framework/components/field/FieldBoolean/index.tsx +92 -0
- package/src/framework/components/field/FieldEditTable/index.d.ts +13 -0
- package/src/framework/components/field/FieldEditTable/index.jsx +103 -0
- package/src/framework/components/field/FieldEditTable/index.less +29 -0
- package/src/framework/components/field/FieldEditor.jsx +48 -0
- package/src/framework/components/field/FieldFileBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldFileBase64/index.jsx +23 -0
- package/src/framework/components/field/FieldImageBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldImageBase64/index.jsx +22 -0
- package/src/framework/components/field/FieldInput.jsx +13 -0
- package/src/framework/components/field/FieldOrgTree/index.tsx +45 -0
- package/src/framework/components/field/FieldPassword.jsx +11 -0
- package/src/framework/components/field/FieldProps.ts +19 -0
- package/src/framework/components/field/FieldRemoteTreeCascader.jsx +75 -0
- package/src/framework/components/field/FieldRemoteTreeCheckable.jsx +81 -0
- package/src/framework/components/field/FieldRemoteTreeMultipleSelect.jsx +100 -0
- package/src/framework/components/field/FieldRemoteTreeSelect.jsx +82 -0
- package/src/framework/components/field/FieldSelectPosition/index.tsx +85 -0
- package/src/framework/components/field/FieldTree.jsx +45 -0
- package/src/framework/components/field/dict/index.tsx +110 -0
- package/src/framework/components/field/flat-multiple-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-multiple-select/index.jsx +116 -0
- package/src/framework/components/field/flat-multiple-select/index.less +12 -0
- package/src/framework/components/field/flat-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-select/index.jsx +107 -0
- package/src/framework/components/field/flat-select/index.less +12 -0
- package/src/framework/components/field/index.js +33 -0
- package/src/framework/components/field/input-number-percent/index.d.ts +11 -0
- package/src/framework/components/field/input-number-percent/index.jsx +28 -0
- package/src/framework/components/field/select/FieldSelect/index.d.ts +39 -0
- package/src/framework/components/field/select/FieldSelect/index.jsx +156 -0
- package/src/framework/components/field/select/FieldTableSelect/index.d.ts +29 -0
- package/src/framework/components/field/select/FieldTableSelect/index.jsx +155 -0
- package/src/framework/components/field/select/index.jsx +2 -0
- package/src/framework/components/field/switch-y-n/index.d.ts +11 -0
- package/src/framework/components/field/switch-y-n/index.jsx +31 -0
- package/src/framework/components/field/text/index.tsx +7 -0
- package/src/framework/components/field/time/DatePickerString.tsx +37 -0
- package/src/framework/components/field/time/DateTimePickerString.tsx +42 -0
- package/src/framework/components/field/time/FieldDateRange.d.ts +9 -0
- package/src/framework/components/field/time/FieldDateRange.jsx +49 -0
- package/src/framework/components/field/time/HHmmPickerString.tsx +42 -0
- package/src/framework/components/field/time/MonthPickerString.tsx +45 -0
- package/src/framework/components/field/time/TimePickerTool.ts +14 -0
- package/src/framework/components/field/time/YearPickerString.tsx +41 -0
- package/src/framework/components/field/time/YearQuarterString.tsx +38 -0
- package/src/framework/components/field/time/index.tsx +7 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.d.ts +22 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.jsx +11 -0
- package/src/framework/components/field/upload/FieldUploadFile.d.ts +35 -0
- package/src/framework/components/field/upload/FieldUploadFile.jsx +145 -0
- package/src/framework/components/field/upload/FieldUploadImage.d.ts +7 -0
- package/src/framework/components/field/upload/FieldUploadImage.jsx +16 -0
- package/src/framework/components/field/upload/index.jsx +3 -0
- package/src/framework/components/index.js +25 -0
- package/src/framework/components/system.jsx +29 -0
- package/src/framework/components/view/ViewBoolean.jsx +15 -0
- package/src/framework/components/view/ViewBooleanEnableDisable.jsx +16 -0
- package/src/framework/components/view/ViewEllipsis.d.ts +11 -0
- package/src/framework/components/view/ViewEllipsis.jsx +30 -0
- package/src/framework/components/view/ViewFile.d.ts +10 -0
- package/src/framework/components/view/ViewFile.jsx +50 -0
- package/src/framework/components/view/ViewFileButton.d.ts +10 -0
- package/src/framework/components/view/ViewFileButton.jsx +0 -0
- package/src/framework/components/view/ViewImage.d.ts +9 -0
- package/src/framework/components/view/ViewImage.jsx +61 -0
- package/src/framework/components/view/ViewPassword.jsx +24 -0
- package/src/framework/components/view/ViewRange/index.d.ts +16 -0
- package/src/framework/components/view/ViewRange/index.jsx +20 -0
- package/src/framework/components/view/ViewText.jsx +9 -0
- package/src/framework/components/view/index.js +12 -0
- package/src/framework/index.js +3 -0
- package/src/framework/system/FormRegistry.js +58 -0
- package/src/framework/system/dict.js +88 -0
- package/src/framework/system/http.jsx +290 -0
- package/src/framework/system/index.js +13 -0
- package/src/framework/system/page.js +109 -0
- package/src/framework/system/permission.js +44 -0
- package/src/framework/system/sys.js +60 -0
- package/src/framework/system/theme.js +17 -0
- package/src/framework/utils/arr.js +118 -0
- package/src/framework/utils/browser.js +24 -0
- package/src/framework/utils/color.js +269 -0
- package/src/framework/utils/date.js +173 -0
- package/src/framework/utils/debounce.js +33 -0
- package/src/framework/utils/dom.js +16 -0
- package/src/framework/utils/eventBus.js +70 -0
- package/src/framework/utils/html.js +13 -0
- package/src/framework/utils/index.js +17 -0
- package/src/framework/utils/obj.js +72 -0
- package/src/framework/utils/storage.js +37 -0
- package/src/framework/utils/str.js +297 -0
- package/src/framework/utils/tree.js +175 -0
- package/src/framework/utils/uid.js +76 -0
- package/src/framework/utils/url.js +84 -0
- package/src/framework/utils/validate.js +9 -0
- package/src/index.js +2 -0
- package/src/layouts/PageRender.d.ts +22 -0
- package/src/layouts/PageRender.jsx +90 -0
- package/src/layouts/admin/HeaderRight.jsx +104 -0
- package/src/layouts/admin/TabPageRender.jsx +158 -0
- package/src/layouts/admin/index.jsx +174 -0
- package/src/layouts/admin/index.less +64 -0
- package/src/layouts/index.jsx +163 -0
- package/src/layouts/index.less +45 -0
- package/src/loading.jsx +18 -0
- package/src/pages/404.jsx +13 -0
- package/src/pages/about.jsx +14 -0
- package/src/pages/api/accessLog/index.jsx +108 -0
- package/src/pages/api/accountResource/index.jsx +149 -0
- package/src/pages/api/doc.jsx +135 -0
- package/src/pages/api/index.jsx +163 -0
- package/src/pages/api/resource.jsx +18 -0
- package/src/pages/flowable/design/index.css +7 -0
- package/src/pages/flowable/design/index.jsx +297 -0
- package/src/pages/flowable/index.jsx +128 -0
- package/src/pages/flowable/instance/view.jsx +13 -0
- package/src/pages/flowable/monitor.jsx +106 -0
- package/src/pages/flowable/task/form.jsx +99 -0
- package/src/pages/flowable/task/index.jsx +200 -0
- package/src/pages/flowable/test/form.jsx +31 -0
- package/src/pages/flowable/test/index.jsx +54 -0
- package/src/pages/index.jsx +25 -0
- package/src/pages/job/index.jsx +239 -0
- package/src/pages/job/logList.jsx +100 -0
- package/src/pages/job/status.jsx +84 -0
- package/src/pages/login.jsx +144 -0
- package/src/pages/login.less +53 -0
- package/src/pages/system/config/index.jsx +136 -0
- package/src/pages/system/dict/Dict.jsx +73 -0
- package/src/pages/system/dict/DictItem.jsx +177 -0
- package/src/pages/system/dict/index.jsx +25 -0
- package/src/pages/system/file/index.jsx +152 -0
- package/src/pages/system/log/index.jsx +78 -0
- package/src/pages/system/org/index.jsx +263 -0
- package/src/pages/system/role/index.jsx +314 -0
- package/src/pages/system/role/perm.jsx +111 -0
- package/src/pages/system/sysManual/index.jsx +127 -0
- package/src/pages/system/user/UserPerm.jsx +132 -0
- package/src/pages/system/user/index.jsx +261 -0
- package/src/pages/test.jsx +16 -0
- package/src/pages/ureport/index.jsx +43 -0
- package/src/pages/userCenter/ChangePassword.jsx +64 -0
- package/src/pages/userCenter/index.jsx +90 -0
- package/src/pages/userCenter/manual.jsx +63 -0
- package/src/pages/userCenter/message.jsx +105 -0
- package/src/style/global.less +51 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Button, Modal, Tabs} from "antd";
|
|
3
|
+
import {HttpUtil, LinkButton, Page, PageLoading, ProTable} from "../../../framework";
|
|
4
|
+
import InstanceInfo from "../../../components/InstanceInfo";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default class extends React.Component {
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
show: true
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
render() {
|
|
14
|
+
if (!this.state.show) {
|
|
15
|
+
return <PageLoading/>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const items = [
|
|
19
|
+
{label: '待办任务', key: '1', children: this.renderTodo()},
|
|
20
|
+
{label: '已办任务', key: '2', children: this.renderDone()},
|
|
21
|
+
{label: '我发起的', key: '3', children: this.renderMyStart()},
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
return <Page padding>
|
|
25
|
+
<Tabs defaultActiveKey="1" destroyOnHidden items={items}>
|
|
26
|
+
|
|
27
|
+
</Tabs>
|
|
28
|
+
</Page>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
renderTodo = () => <ProTable
|
|
33
|
+
showToolbarSearch={false}
|
|
34
|
+
request={(params) => HttpUtil.pageData("admin/flowable/my/todoTaskPage", params)}
|
|
35
|
+
columns={[
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
title: '发起人',
|
|
39
|
+
dataIndex: 'instanceStarter'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: '流程名称',
|
|
43
|
+
dataIndex: 'instanceName',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
title: '当前节点',
|
|
47
|
+
dataIndex: 'taskName',
|
|
48
|
+
width: 100,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
title: '当前操作人',
|
|
52
|
+
dataIndex: 'assigneeInfo',
|
|
53
|
+
width: 100
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
{
|
|
57
|
+
title: '发起时间',
|
|
58
|
+
dataIndex: 'instanceStartTime',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
title: '任务创建时间',
|
|
62
|
+
dataIndex: 'createTime',
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
{
|
|
66
|
+
title: '操作',
|
|
67
|
+
dataIndex: 'option',
|
|
68
|
+
render: (_, record) => {
|
|
69
|
+
let path = '/flowable/task/form?taskId=' + record.id + '&instanceId=' + record.instanceId;
|
|
70
|
+
if (record.formKey) {
|
|
71
|
+
path += "&formKey=" + record.formKey
|
|
72
|
+
}
|
|
73
|
+
return (
|
|
74
|
+
<LinkButton
|
|
75
|
+
type='primary'
|
|
76
|
+
path={path}
|
|
77
|
+
label='处理任务'>处理</LinkButton>
|
|
78
|
+
);
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
]}
|
|
82
|
+
size='small'
|
|
83
|
+
/>;
|
|
84
|
+
|
|
85
|
+
renderDone = () => <ProTable
|
|
86
|
+
showToolbarSearch={false}
|
|
87
|
+
request={(params) => HttpUtil.pageData("admin/flowable/my/doneTaskPage", params)}
|
|
88
|
+
columns={[
|
|
89
|
+
{
|
|
90
|
+
title: '流程名称',
|
|
91
|
+
dataIndex: 'instanceName',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: '发起人',
|
|
95
|
+
dataIndex: 'instanceStarter'
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
title: '发起时间',
|
|
99
|
+
dataIndex: 'instanceStartTime',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
title: '任务创建时间',
|
|
103
|
+
dataIndex: 'createTime',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: '处理时间',
|
|
107
|
+
dataIndex: 'endTime',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
title: '耗时',
|
|
111
|
+
dataIndex: 'durationInfo',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: '处理节点',
|
|
115
|
+
dataIndex: 'taskName'
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: '操作人',
|
|
119
|
+
dataIndex: 'assigneeInfo'
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
{
|
|
124
|
+
title: '操作',
|
|
125
|
+
dataIndex: 'option',
|
|
126
|
+
render: (_, record) => (
|
|
127
|
+
<Button size='small' onClick={() => {
|
|
128
|
+
Modal.info({
|
|
129
|
+
title: '流程信息',
|
|
130
|
+
width: '800vw',
|
|
131
|
+
content: <InstanceInfo id={record.instanceId}/>
|
|
132
|
+
})
|
|
133
|
+
}}> 查看 </Button>
|
|
134
|
+
),
|
|
135
|
+
},
|
|
136
|
+
]}
|
|
137
|
+
size='small'
|
|
138
|
+
/>;
|
|
139
|
+
|
|
140
|
+
renderMyStart = () => <ProTable
|
|
141
|
+
request={(params) => HttpUtil.pageData("admin/flowable/my/myInstance", params)}
|
|
142
|
+
columns={[
|
|
143
|
+
|
|
144
|
+
{
|
|
145
|
+
title: '流程名称',
|
|
146
|
+
dataIndex: 'processDefinitionName',
|
|
147
|
+
render(_, r) {
|
|
148
|
+
return r.name || r.processDefinitionName
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
title: '发起人',
|
|
153
|
+
dataIndex: 'startUserName',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
title: '发起时间',
|
|
157
|
+
dataIndex: 'startTime',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
title: '业务标识',
|
|
161
|
+
dataIndex: 'businessKey',
|
|
162
|
+
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
{
|
|
167
|
+
title: '结束时间',
|
|
168
|
+
dataIndex: 'endTime',
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
{
|
|
172
|
+
title: '流程状态',
|
|
173
|
+
dataIndex: 'x',
|
|
174
|
+
render(_, row) {
|
|
175
|
+
return row.endTime == null ? '进行中' : '已结束'
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
title: '终止原因',
|
|
180
|
+
dataIndex: 'deleteReason',
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
{
|
|
185
|
+
title: '操作',
|
|
186
|
+
dataIndex: 'option',
|
|
187
|
+
render: (_, record) => (
|
|
188
|
+
<Button size='small' onClick={() => {
|
|
189
|
+
|
|
190
|
+
Modal.info({
|
|
191
|
+
title: '流程信息',
|
|
192
|
+
width: '80vw',
|
|
193
|
+
content: <InstanceInfo id={record.id}/>
|
|
194
|
+
})
|
|
195
|
+
}}> 查看 </Button>
|
|
196
|
+
),
|
|
197
|
+
},
|
|
198
|
+
]}
|
|
199
|
+
/>;
|
|
200
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Form, Input, Typography} from "antd";
|
|
3
|
+
|
|
4
|
+
export default class extends React.Component {
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
render() {
|
|
8
|
+
console.log('测试表单', this.props)
|
|
9
|
+
return <div>
|
|
10
|
+
<Typography.Title level={3} >测试表单</Typography.Title>
|
|
11
|
+
<Form labelCol={{flex:'150px'}}>
|
|
12
|
+
<Form.Item name='days' label='请假天数'>
|
|
13
|
+
<Input disabled/>
|
|
14
|
+
</Form.Item>
|
|
15
|
+
|
|
16
|
+
<Form.Item name='pathname' label='pathname' initialValue={this.props.location.pathname}>
|
|
17
|
+
<Input disabled/>
|
|
18
|
+
</Form.Item>
|
|
19
|
+
|
|
20
|
+
<Form.Item name='search' label='search' initialValue={this.props.location.search}>
|
|
21
|
+
<Input disabled/>
|
|
22
|
+
</Form.Item>
|
|
23
|
+
<Form.Item name='params' label='路由参数' initialValue={JSON.stringify(this.props.location.params)}>
|
|
24
|
+
<Input disabled/>
|
|
25
|
+
</Form.Item>
|
|
26
|
+
</Form>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Button, Card, Form, Input} from "antd";
|
|
3
|
+
import {HttpUtil, PageLoading, PageUtil} from "../../../framework";
|
|
4
|
+
|
|
5
|
+
export default class extends React.Component {
|
|
6
|
+
|
|
7
|
+
state = {
|
|
8
|
+
model: undefined
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
componentDidMount() {
|
|
13
|
+
let params = PageUtil.currentLocationQuery()
|
|
14
|
+
const id = this.id = params.id
|
|
15
|
+
|
|
16
|
+
HttpUtil.get('admin/flowable/test/get', {id}).then(rs=>{
|
|
17
|
+
this.setState({model: rs})
|
|
18
|
+
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
render() {
|
|
25
|
+
if(this.state.model === undefined){
|
|
26
|
+
return <PageLoading />
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return <Card title={'流程测试 / 【' + this.state.model.name + "】 / " + this.state.model.code }>
|
|
30
|
+
<Form onFinish={this.onFinish} layout='vertical' >
|
|
31
|
+
<Form.Item name='id' label='业务标识(相当于业务表的id)' rules={[{required: true}]} initialValue={1}>
|
|
32
|
+
<Input />
|
|
33
|
+
</Form.Item>
|
|
34
|
+
|
|
35
|
+
{this.state.model.conditionVariableList.map(item=><Form.Item key={item.name} name={item.name} label={item.label}>
|
|
36
|
+
<Input />
|
|
37
|
+
</Form.Item>)}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<Form.Item label=' ' colon={false}>
|
|
42
|
+
<Button htmlType="submit" type='primary'>提交</Button>
|
|
43
|
+
</Form.Item>
|
|
44
|
+
</Form>
|
|
45
|
+
</Card>
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
onFinish = values => {
|
|
49
|
+
values.modelCode = this.state.model.code
|
|
50
|
+
HttpUtil.post('admin/flowable/test/submit', values).then(rs=>{
|
|
51
|
+
|
|
52
|
+
})
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Button, Card, Space} from "antd";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default class extends React.Component {
|
|
6
|
+
|
|
7
|
+
state = {
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
render() {
|
|
11
|
+
|
|
12
|
+
return <Card>
|
|
13
|
+
欢迎使用本系统
|
|
14
|
+
|
|
15
|
+
<Space>
|
|
16
|
+
<Button onClick={()=>MsgBox.alert('你好')}>alert</Button>
|
|
17
|
+
<Button onClick={()=>MsgBox.confirm('你好')}>comfirm</Button>
|
|
18
|
+
<Button onClick={()=>MsgBox.prompt('你好')}>prompt</Button>
|
|
19
|
+
|
|
20
|
+
</Space>
|
|
21
|
+
|
|
22
|
+
</Card>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import {AutoComplete, Button, Form, Input, message, Modal, Popconfirm, Select, Space, Switch, Tag} from 'antd'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import {PlusOutlined, ReloadOutlined} from "@ant-design/icons";
|
|
4
|
+
import {HttpUtil, Page, PageUtil, ProTable, StrUtil, ValueType} from "../../framework";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const cronOptions = [
|
|
8
|
+
{
|
|
9
|
+
label: '*/5 * * * * ? 每隔5秒',
|
|
10
|
+
value: '*/5 * * * * ?'
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
label: '0 */5 * * * ? 每隔5分钟',
|
|
14
|
+
value: '0 */5 * * * ?'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: '0 0 22 * * ? 每天22点',
|
|
18
|
+
value: '0 0 22 * * ?'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: '0 0 1 * * ? 每天1点',
|
|
22
|
+
value: '0 0 1 * * ?'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: '0 0 1 1 * ? 每月1号凌晨1点',
|
|
26
|
+
value: '0 0 1 1 * ?'
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export default class extends React.Component {
|
|
32
|
+
|
|
33
|
+
state = {
|
|
34
|
+
formValues: {},
|
|
35
|
+
formOpen: false,
|
|
36
|
+
|
|
37
|
+
selectedRowKeys: [],
|
|
38
|
+
|
|
39
|
+
jobClassOptions: [],
|
|
40
|
+
|
|
41
|
+
paramList: []
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
componentDidMount() {
|
|
45
|
+
HttpUtil.get('admin/job/jobClassOptions').then(rs => {
|
|
46
|
+
this.setState({jobClassOptions: rs})
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
tableRef = React.createRef()
|
|
51
|
+
formRef = React.createRef()
|
|
52
|
+
|
|
53
|
+
columns = [
|
|
54
|
+
{
|
|
55
|
+
title: '分组',
|
|
56
|
+
dataIndex: 'group',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: '名称',
|
|
60
|
+
dataIndex: 'name',
|
|
61
|
+
render:(name, record)=> {
|
|
62
|
+
return <a onClick={()=>PageUtil.open('/job/logList?jobId=' + record.id, '作业日志-'+name)}>{name}</a>;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: '执行类',
|
|
67
|
+
dataIndex: 'jobClass',
|
|
68
|
+
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
{
|
|
72
|
+
title: 'cron',
|
|
73
|
+
dataIndex: 'cron',
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
{
|
|
78
|
+
title: '参数',
|
|
79
|
+
dataIndex: 'jobData',
|
|
80
|
+
render(list) {
|
|
81
|
+
if (list)
|
|
82
|
+
return JSON.stringify(list)
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
{
|
|
87
|
+
title: '运行状态',
|
|
88
|
+
dataIndex: 'executing',
|
|
89
|
+
render: (v, record) => {
|
|
90
|
+
return record.executing ? <Tag icon={<ReloadOutlined spin/>} color='green'>运行中</Tag> :
|
|
91
|
+
<Tag>空闲</Tag>
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
{
|
|
98
|
+
title: '启用状态',
|
|
99
|
+
dataIndex: 'enabled',
|
|
100
|
+
render: (v, record) => {
|
|
101
|
+
return record.enabled ? <Tag color='green'>启用</Tag> : <Tag color='red'>停用</Tag>
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
title: '操作',
|
|
107
|
+
dataIndex: 'option',
|
|
108
|
+
fixed: 'right',
|
|
109
|
+
render: (_, record) => {
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<Space>
|
|
113
|
+
|
|
114
|
+
<Button size='small' onClick={() => this.handleTriggerJob(record)}>执行一次</Button>
|
|
115
|
+
<Button size='small' onClick={() => this.handleEdit(record)}> 编辑 </Button>
|
|
116
|
+
<Popconfirm title='是否确定删除?' onConfirm={() => this.handleDelete(record)}>
|
|
117
|
+
<Button size='small'>删除</Button>
|
|
118
|
+
</Popconfirm>
|
|
119
|
+
</Space>
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
handleAdd = () => {
|
|
127
|
+
this.setState({formOpen: true, formValues: {}, paramList: []})
|
|
128
|
+
}
|
|
129
|
+
handleEdit = (record) => {
|
|
130
|
+
this.loadJobParamFields(record.jobClass, record.jobData)
|
|
131
|
+
this.setState({formOpen: true, formValues: record,})
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
loadJobParamFields(className, jobData) {
|
|
135
|
+
HttpUtil.post("admin/job/getJobParamFields", jobData || {}, {className}).then(rs => {
|
|
136
|
+
this.setState({paramList: rs})
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
onFinish = (values) => {
|
|
141
|
+
HttpUtil.post('admin/job/save', values).then(rs => {
|
|
142
|
+
this.setState({formOpen: false})
|
|
143
|
+
this.tableRef.current.reload();
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
handleDelete = row => {
|
|
148
|
+
const hide = message.loading("删除作业中...")
|
|
149
|
+
HttpUtil.get('admin/job/delete', {id: row.id}).then(rs => {
|
|
150
|
+
this.tableRef.current.reload();
|
|
151
|
+
}).catch(hide)
|
|
152
|
+
}
|
|
153
|
+
handleTriggerJob = row => {
|
|
154
|
+
HttpUtil.get('admin/job/triggerJob', {id: row.id}).then(rs => {
|
|
155
|
+
this.tableRef.current.reload();
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
render() {
|
|
161
|
+
return <Page>
|
|
162
|
+
<ProTable
|
|
163
|
+
actionRef={this.tableRef}
|
|
164
|
+
toolBarRender={() => {
|
|
165
|
+
return <Button type='primary' onClick={() => this.handleAdd()} icon={<PlusOutlined/>}>
|
|
166
|
+
新增
|
|
167
|
+
</Button>
|
|
168
|
+
}}
|
|
169
|
+
request={(params) => HttpUtil.pageData('admin/job/page', params)}
|
|
170
|
+
columns={this.columns}
|
|
171
|
+
bordered={true}
|
|
172
|
+
/>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
<Modal title='作业调度'
|
|
176
|
+
open={this.state.formOpen}
|
|
177
|
+
destroyOnHidden
|
|
178
|
+
width={800}
|
|
179
|
+
onOk={() => this.formRef.current.submit()}
|
|
180
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
181
|
+
>
|
|
182
|
+
|
|
183
|
+
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
184
|
+
initialValues={this.state.formValues}
|
|
185
|
+
onValuesChange={this.onValuesChange}
|
|
186
|
+
onFinish={this.onFinish}>
|
|
187
|
+
<Form.Item name='id' noStyle>
|
|
188
|
+
</Form.Item>
|
|
189
|
+
<Form.Item label='执行类' name='jobClass' rules={[{required: true}]}
|
|
190
|
+
tooltip='org.quartz.Job接口,参考io.tmgg.job.builtin.DemoJob'>
|
|
191
|
+
<Select options={this.state.jobClassOptions}/>
|
|
192
|
+
</Form.Item>
|
|
193
|
+
<Form.Item label='名称' name='name' rules={[{required: true}]}>
|
|
194
|
+
<Input/>
|
|
195
|
+
</Form.Item>
|
|
196
|
+
|
|
197
|
+
<Form.Item label='cron表达式' name='cron' help='格式:秒分时日月周,留空表示手动执行' rules={[{required: true}]}>
|
|
198
|
+
<AutoComplete placeholder='如 0 */5 * * * ?' options={cronOptions}/>
|
|
199
|
+
</Form.Item>
|
|
200
|
+
|
|
201
|
+
<Form.Item label='启用' name='enabled' valuePropName='checked' rules={[{required: true}]}>
|
|
202
|
+
<Switch/>
|
|
203
|
+
</Form.Item>
|
|
204
|
+
|
|
205
|
+
{this.state.paramList?.map(p => (
|
|
206
|
+
<Form.Item label={p.label}
|
|
207
|
+
name={['jobData', p.name]}
|
|
208
|
+
key={p.name}
|
|
209
|
+
rules={[{required: p.required}]}>
|
|
210
|
+
{ValueType.renderField(p.componentType,p.componentProps)}
|
|
211
|
+
</Form.Item>
|
|
212
|
+
))}
|
|
213
|
+
</Form>
|
|
214
|
+
</Modal>
|
|
215
|
+
|
|
216
|
+
</Page>
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
onValuesChange = (changed, values) => {
|
|
220
|
+
if (changed.jobClass) {
|
|
221
|
+
this.loadJobParamFields(values.jobClass)
|
|
222
|
+
const option = this.state.jobClassOptions.find(o => o.value === changed.jobClass)
|
|
223
|
+
if (option) {
|
|
224
|
+
let {label} = option;
|
|
225
|
+
if (StrUtil.contains(label, " ")) { // 取中文名部门设置为name
|
|
226
|
+
this.formRef.current.setFieldValue("name", label.split(" ")[1])
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (changed.jobData) {
|
|
232
|
+
this.loadJobParamFields(values.jobClass, values.jobData)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {Button} from 'antd'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import {HttpUtil, PageUtil, ProTable, SysUtil} from "../../framework";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export default class extends React.Component {
|
|
7
|
+
|
|
8
|
+
state = {
|
|
9
|
+
formValues: {},
|
|
10
|
+
formOpen: false,
|
|
11
|
+
|
|
12
|
+
selectedRowKeys: [],
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
tableRef = React.createRef()
|
|
17
|
+
|
|
18
|
+
columns = [
|
|
19
|
+
{
|
|
20
|
+
title: '名称',
|
|
21
|
+
dataIndex: ['sysJob','name'],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: '执行类',
|
|
25
|
+
dataIndex: ['sysJob','jobClass'],
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
{
|
|
29
|
+
title: '开始时间',
|
|
30
|
+
dataIndex: 'beginTime',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: '结束时间',
|
|
34
|
+
dataIndex: 'endTime',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: '耗时',
|
|
38
|
+
dataIndex: 'jobRunTimeLabel',
|
|
39
|
+
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: '是否成功',
|
|
43
|
+
dataIndex: 'success',
|
|
44
|
+
width: 200,
|
|
45
|
+
render:v=>{
|
|
46
|
+
if(v != null){
|
|
47
|
+
return v ? '成功':'异常'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: '返回结果',
|
|
53
|
+
dataIndex: 'result',
|
|
54
|
+
width:300
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
{
|
|
58
|
+
title: '操作',
|
|
59
|
+
dataIndex: 'option',
|
|
60
|
+
fixed:'right',
|
|
61
|
+
render: (_, record) => {
|
|
62
|
+
let url = SysUtil.getServerUrl() + 'sys/log/'+ record.id;
|
|
63
|
+
return <a href={url} target='_blank'>日志</a>;
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
clean = (selectedRowKeys)=>{
|
|
70
|
+
HttpUtil.post('admin/job/jobLogClean', {ids:selectedRowKeys} ).then(rs=>{
|
|
71
|
+
this.tableRef.current.reload()
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
render() {
|
|
78
|
+
return <>
|
|
79
|
+
<ProTable
|
|
80
|
+
toolBarRender={(_,{selectedRowKeys})=><>
|
|
81
|
+
<Button disabled={selectedRowKeys.length === 0} onClick={()=>this.clean(selectedRowKeys)} type='primary' >删除{selectedRowKeys.length}条</Button>
|
|
82
|
+
</>}
|
|
83
|
+
actionRef={this.tableRef}
|
|
84
|
+
request={(params) => {
|
|
85
|
+
const jobId = PageUtil.currentParams().jobId
|
|
86
|
+
params.jobId = jobId;
|
|
87
|
+
|
|
88
|
+
return HttpUtil.pageData('admin/job/jobLog', params);
|
|
89
|
+
}}
|
|
90
|
+
columns={this.columns}
|
|
91
|
+
rowSelection={{}}
|
|
92
|
+
rowKey='id'
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
</>
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|