config.data.ts
5.39 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
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';
import { useI18n } from '/@/hooks/web/useI18n';
///任务组名Enum
export enum EJobGroup {
DEFAULT = 'DEFAULT',
SYSTEM = 'SYSTEM',
REPORT = 'REPORT',
TASK_CENTER = 'TASK_CENTER',
}
export enum EJobGroupName {
DEFAULT = '默认',
SYSTEM = '系统',
REPORT = '报表',
TASK_CENTER = '任务中心',
}
const { t } = useI18n();
//任务详细配置
export const personSchema: DescItem[] = [
{
field: 'jobGroup',
label: t('system.tasks.taskGroup'),
render: (value: EJobGroup) => {
return t(`system.tasks.EJobGroup.${value}`);
},
},
{
field: 'jobName',
label: t('system.tasks.taskName'),
},
{
field: 'createTime',
label: t('common.createTimeText') + ':',
},
{
field: 'cronExpression',
label: t('system.tasks.cron') + ':',
},
{
field: 'updateTime',
label: t('system.tasks.logDetail.nextTime'),
},
{
field: 'invokeTarget',
label: t('system.tasks.logDetail.callTarget'),
},
{
field: 'status',
label: t('system.tasks.table.taskState') + ':',
render: (_, data) => {
return data.status == 1 ? t('common.enableText') : t('common.disableText');
},
},
{
field: 'concurrent',
label: t('system.tasks.table.isConcurrent') + ':',
render: (_, data) => {
return data.concurrent == 0 ? t('system.tasks.table.allow') : t('system.tasks.table.disable');
},
},
{
field: 'misfirePolicy',
label: t('system.tasks.table.strategy') + ':',
render: (_, data) => {
return data.misfirePolicy == 0
? t('system.tasks.table.immediate')
: data.misfirePolicy == 1
? t('system.tasks.executeOnce')
: t('system.tasks.table.execution');
},
},
];
// 调度日志表格配置
export const columnSchedue: BasicColumn[] = [
{
title: t('system.tasks.taskName'),
dataIndex: 'jobName',
width: 120,
},
{
title: t('system.tasks.taskGroup'),
dataIndex: 'jobGroup',
width: 120,
format: (text: string) => {
return t(`system.tasks.EJobGroup.${text}`) || t(`system.tasks.EJobGroup.REPORT`);
},
},
{
title: t('system.tasks.table.callTarget'),
dataIndex: 'invokeTarget',
width: 120,
},
{
title: t('system.tasks.logDetail.loginfo'),
dataIndex: 'jobMessage',
width: 160,
format(text) {
return t('system.tasks.logDetail.timeConsuming', { time: text });
},
},
{
title: t('system.tasks.logDetail.state'),
dataIndex: 'status',
width: 160,
customRender: ({ record }) => {
const status = record.status;
const success = status === 1;
const color = success ? 'green' : 'red';
const successText = t('common.successText');
const failedText = t('common.failText');
const text = success ? successText : failedText;
return h(Tag, { color: color }, () => text);
},
},
{
title: t('system.tasks.logDetail.time'),
dataIndex: 'startTime',
width: 180,
},
];
// 调度日志表格查询配置
export const searchSchedueFormSchema: FormSchema[] = [
{
field: 'jobName',
label: t('system.tasks.taskName'),
component: 'Input',
colProps: { span: 4 },
componentProps: {
maxLength: 36,
},
},
{
field: 'jobGroup',
label: t('system.tasks.taskGroup'),
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{
label: t('system.tasks.table.deault'),
value: EJobGroup.DEFAULT,
},
{
label: t('system.tasks.table.system'),
value: EJobGroup.SYSTEM,
},
{
label: t('system.tasks.table.report'),
value: EJobGroup.REPORT,
},
],
},
},
{
field: 'status',
label: t('system.tasks.logDetail.state'),
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{
label: t('common.successText'),
value: 1,
},
{
label: t('common.failText'),
value: 0,
},
],
},
},
{
field: 'sendTime',
label: t('system.tasks.logDetail.time'),
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: t('system.tasks.taskName'),
},
{
field: 'jobGroup',
label: t('system.tasks.taskGroup') + ':',
render: (_, data) => {
return data.jobGroup == EJobGroup.DEFAULT
? t('system.tasks.table.default')
: data.jobGroup == EJobGroup.SYSTEM
? t('system.tasks.table.system')
: t('system.tasks.table.report');
},
},
{
field: 'invokeTarget',
label: t('system.tasks.table.callTarget') + ':',
},
{
field: 'jobMessage',
label: t('system.tasks.logDetail.loginfo') + ':',
},
{
field: 'status',
label: t('system.tasks.logDetail.state') + ':',
render: (_, data) => {
return data.status == 1 ? t('common.successText') : t('common.failText');
},
},
{
field: 'startTime',
label: t('system.tasks.logDetail.time') + ':',
},
];