config.data.ts
4.64 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
import { DescItem } from '/@/components/Description/index';
import { BasicColumn, FormSchema } from '/@/components/Table';
import moment from 'moment';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
///任务组名Enum
export enum EJobGroup {
DEFAULT = 'DEFAULT',
SYSTEM = 'SYSTEM',
REPORT = 'REPORT',
}
//任务详细配置
export const personSchema: DescItem[] = [
{
field: 'jobGroup',
label: '任务分组:',
render: (_, data) => {
return data.jobGroup == EJobGroup.DEFAULT
? '默认'
: data.jobGroup == EJobGroup.SYSTEM
? '系统'
: '报表';
},
},
{
field: 'jobName',
label: '任务名称:',
},
{
field: 'createTime',
label: '创建时间:',
},
{
field: 'cronExpression',
label: 'cron表达式:',
},
{
field: 'updateTime',
label: '下次执行时间:',
},
{
field: 'invokeTarget',
label: '调用目标方法:',
},
{
field: 'status',
label: '任务状态:',
render: (_, data) => {
return data.status == 1 ? '启用' : '禁用';
},
},
{
field: 'concurrent',
label: '是否并发:',
render: (_, data) => {
return data.concurrent == 0 ? '允许' : '禁止';
},
},
{
field: 'misfirePolicy',
label: '执行策略:',
render: (_, data) => {
return data.misfirePolicy == 0
? '立即执行'
: data.misfirePolicy == 1
? '执行一次'
: '放弃执行';
},
},
];
// 调度日志表格配置
export const columnSchedue: BasicColumn[] = [
{
title: '任务名称',
dataIndex: 'jobName',
width: 120,
},
{
title: '任务组名',
dataIndex: 'jobGroup',
width: 120,
format: (_text: string, record: Recordable) => {
return record.jobGroup === EJobGroup.DEFAULT
? '默认'
: record.jobGroup === EJobGroup.SYSTEM
? '系统'
: '报表';
},
},
{
title: '调用目标字符串',
dataIndex: 'invokeTarget',
width: 120,
},
{
title: '日志信息',
dataIndex: 'jobMessage',
width: 160,
},
{
title: '执行状态',
dataIndex: 'status',
width: 160,
customRender: ({ record }) => {
const status = record.status;
const success = status === 1;
const color = success ? 'green' : 'red';
const successText: string = '成功';
const failedText: string = '失败';
const text = success ? successText : failedText;
return h(Tag, { color: color }, () => text);
},
},
{
title: '执行时间',
dataIndex: 'startTime',
width: 180,
},
];
// 调度日志表格查询配置
export const searchSchedueFormSchema: FormSchema[] = [
{
field: 'jobName',
label: '任务名称',
component: 'Input',
colProps: { span: 4 },
componentProps: {
maxLength: 36,
placeholder: '请输入任务名称',
},
},
{
field: 'jobGroup',
label: '任务组名',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{
label: '默认',
value: EJobGroup.DEFAULT,
},
{
label: '系统',
value: EJobGroup.SYSTEM,
},
{
label: '报表',
value: EJobGroup.REPORT,
},
],
placeholder: '请选择任务组名',
},
},
{
field: 'status',
label: '执行状态',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{
label: '成功',
value: 1,
},
{
label: '失败',
value: 0,
},
],
placeholder: '请选择执行状态',
},
},
{
field: 'sendTime',
label: '执行时间',
component: 'RangePicker',
componentProps: {
showTime: {
defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')],
},
},
colProps: { span: 4 },
},
];
// 调度日志详情
export const scheduleLogDetailSchema: DescItem[] = [
{
field: 'jobName',
label: '任务名称:',
},
{
field: 'jobGroup',
label: '任务组名:',
render: (_, data) => {
return data.jobGroup == EJobGroup.DEFAULT
? '默认'
: data.jobGroup == EJobGroup.SYSTEM
? '系统'
: '报表';
},
},
{
field: 'invokeTarget',
label: '调用目标字符串:',
},
{
field: 'jobMessage',
label: '日志信息:',
},
{
field: 'status',
label: '执行状态:',
render: (_, data) => {
return data.status == 1 ? '成功' : '失败';
},
},
{
field: 'startTime',
label: '执行时间:',
},
];