2024-10-14 21:18:42 +08:00
|
|
|
import { $t } from '@/plugins/i18n';
|
2025-04-25 16:58:41 +08:00
|
|
|
import { reactive } from 'vue';
|
2024-10-14 21:18:42 +08:00
|
|
|
|
|
|
|
// 表格列
|
|
|
|
export const columns: TableColumnList = [
|
2025-04-29 18:18:07 +08:00
|
|
|
{
|
|
|
|
type: 'index',
|
|
|
|
index: (index: number) => index + 1,
|
2025-05-04 19:28:50 +08:00
|
|
|
label: $t("index"),
|
2025-04-29 18:18:07 +08:00
|
|
|
width: 60,
|
|
|
|
},
|
2025-04-24 13:43:37 +08:00
|
|
|
// 任务名称
|
|
|
|
{ label: $t('schedulers_jobName'), prop: 'jobName' },
|
|
|
|
// 任务分组
|
|
|
|
{ label: $t('schedulers_jobGroup'), prop: 'jobGroup' },
|
|
|
|
// 任务详情
|
|
|
|
{ label: $t('schedulers_description'), prop: 'description' },
|
|
|
|
// 任务类名称
|
|
|
|
{ label: $t('schedulers_jobClassName'), prop: 'jobClassName' },
|
|
|
|
// 触发器名称
|
|
|
|
{ label: $t('schedulers_triggerName'), prop: 'triggerName' },
|
|
|
|
// 触发器状态
|
|
|
|
{ label: $t('schedulers_triggerState'), prop: 'triggerState' },
|
|
|
|
// corn表达式
|
|
|
|
{ label: $t('schedulers_cronExpression'), prop: 'cronExpression' },
|
2025-04-29 18:18:07 +08:00
|
|
|
{
|
|
|
|
label: $t('table.operation'),
|
|
|
|
fixed: 'right',
|
|
|
|
width: 210,
|
|
|
|
slot: 'operation',
|
|
|
|
},
|
2024-10-14 21:18:42 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
// 添加规则
|
|
|
|
export const rules = reactive({
|
2025-04-24 13:43:37 +08:00
|
|
|
// 任务名称
|
2025-04-29 18:18:07 +08:00
|
|
|
jobName: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: `${$t('input')}${$t('schedulers_jobName')}`,
|
|
|
|
trigger: 'blur',
|
|
|
|
},
|
|
|
|
],
|
2025-04-24 13:43:37 +08:00
|
|
|
// 任务分组
|
2025-04-29 18:18:07 +08:00
|
|
|
jobGroup: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: `${$t('input')}${$t('schedulers_jobGroup')}`,
|
|
|
|
trigger: 'blur',
|
|
|
|
},
|
|
|
|
],
|
2025-04-24 13:43:37 +08:00
|
|
|
// 任务类名称
|
2025-04-29 18:18:07 +08:00
|
|
|
jobClassName: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: `${$t('input')}${$t('schedulers_jobClassName')}`,
|
|
|
|
trigger: 'blur',
|
|
|
|
},
|
|
|
|
],
|
2025-04-24 13:43:37 +08:00
|
|
|
// corn表达式
|
2025-04-29 18:18:07 +08:00
|
|
|
cronExpression: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: `${$t('input')}${$t('schedulers_cronExpression')}`,
|
|
|
|
trigger: 'blur',
|
|
|
|
},
|
|
|
|
],
|
2024-10-14 21:18:42 +08:00
|
|
|
});
|