config.form.data.ts
4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
import { BasicColumn, FormSchema } from '/@/components/Table';
import type { FormSchema as QFormSchema } from '/@/components/Form/index';
import { JCronValidator } from '/@/components/Form';
import { EJobGroup, EJobGroupName } from './config.data';
// 定时任务表格配置
export const columnSchedue: BasicColumn[] = [
{
title: '任务名称',
dataIndex: 'jobName',
width: 120,
},
{
title: '任务组名',
dataIndex: 'jobGroup',
width: 120,
format: (text: string) => {
return EJobGroupName[text];
},
},
{
title: '调用目标字符串',
dataIndex: 'invokeTarget',
width: 120,
},
{
title: 'cron执行表达式',
dataIndex: 'cronExpression',
width: 160,
},
{
title: '状态',
dataIndex: 'status',
width: 160,
slots: { customRender: 'status' },
},
];
// 定时任务格查询配置
export const searchSchedueFormSchema: FormSchema[] = [
{
field: 'jobName',
label: '任务名称',
component: 'Input',
colProps: { span: 6 },
componentProps: {
maxLength: 36,
placeholder: '请输入任务名称',
},
},
{
field: 'jobGroup',
label: '任务组名',
component: 'Select',
colProps: { span: 6 },
componentProps: {
options: [
{
label: '默认',
value: EJobGroup.DEFAULT,
},
{
label: '系统',
value: EJobGroup.SYSTEM,
},
{
label: '报表',
value: EJobGroup.REPORT,
},
{
label: '任务中心',
value: EJobGroup.TASK_CENTER,
},
],
placeholder: '请选择任务组名',
},
},
{
field: 'status',
label: '任务状态',
component: 'Select',
colProps: { span: 6 },
componentProps: {
options: [
{
label: '启用',
value: 1,
},
{
label: '禁用',
value: 0,
},
],
placeholder: '请选择任务状态',
},
},
];
// 新增编辑配置
export const formSchema: QFormSchema[] = [
{
field: 'jobName',
label: '任务名称',
colProps: { span: 24 },
required: true,
component: 'Input',
componentProps: {
maxLength: 255,
placeholder: '请输入任务名称',
},
},
{
field: 'jobGroup',
component: 'Select',
label: '任务分组',
dynamicDisabled: true,
colProps: {
span: 24,
},
componentProps: {
placeholder: '请选择任务分组',
options: [
{
label: EJobGroupName.DEFAULT,
value: EJobGroup.DEFAULT,
},
{
label: EJobGroupName.SYSTEM,
value: EJobGroup.SYSTEM,
},
{
label: EJobGroupName.REPORT,
value: EJobGroup.REPORT,
},
{
label: EJobGroupName.TASK_CENTER,
value: EJobGroup.TASK_CENTER,
},
],
},
},
{
field: 'invokeTarget',
label: ' 调用方法',
helpMessage: [
'Bean调用示例:reportTask.noParams()Class类调用示例:reportTask.noParams()参数说明:支持字符串,布尔类型,长整型,浮点型,整型',
],
colProps: { span: 24 },
required: true,
component: 'Input',
componentProps: {
maxLength: 255,
placeholder: '请输入调用方法',
},
},
{
field: 'cronExpression',
label: 'Cron表达式',
component: 'JEasyCron',
defaultValue: '* * * * * ? *',
dynamicDisabled: true,
colProps: {
span: 24,
},
rules: [{ required: true, message: '请输入Cron表达式' }, { validator: JCronValidator }],
},
{
field: 'misfirePolicy',
component: 'RadioButtonGroup',
label: '执行策略',
colProps: {
span: 24,
},
defaultValue: 1,
componentProps: {
options: [
{
label: '立即执行',
value: 0,
},
{
label: '执行一次',
value: 1,
},
{
label: '放弃执行',
value: 2,
},
],
},
},
{
field: 'concurrent',
component: 'RadioButtonGroup',
label: '是否并发',
colProps: {
span: 24,
},
defaultValue: 1,
componentProps: {
options: [
{
label: '允许',
value: 0,
},
{
label: '禁止',
value: 1,
},
],
},
},
{
field: 'status',
component: 'RadioGroup',
label: '状态',
colProps: {
span: 24,
},
defaultValue: 1,
componentProps: {
options: [
{
label: '启用',
value: 1,
},
{
label: '禁用',
value: 0,
},
],
},
},
];