feat:【ele】新增 CronTab CRON 表达式配置组件、JOB 表单优化

This commit is contained in:
puhui999
2025-09-25 17:05:26 +08:00
parent 484cd432fe
commit c64c770f54
3 changed files with 1162 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
export { default as CronTab } from './cron-tab.vue';

View File

@@ -3,7 +3,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { InfraJobApi } from '#/api/infra/job';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
import { h, markRaw } from 'vue';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
@@ -11,6 +11,7 @@ import { formatDateTime } from '@vben/utils';
import { ElTimeline, ElTimelineItem } from 'element-plus';
import { CronTab } from '#/components/cron-tab';
import { DictTag } from '#/components/dict-tag';
/** 新增/修改的表单 */
@@ -57,12 +58,11 @@ export function useFormSchema(): VbenFormSchema[] {
{
fieldName: 'cronExpression',
label: 'CRON 表达式',
component: 'Input',
component: markRaw(CronTab),
componentProps: {
placeholder: '请输入 CRON 表达式',
},
rules: 'required',
// TODO @芋艿:未来支持动态的 CRON 表达式选择
},
{
fieldName: 'retryCount',
@@ -71,6 +71,8 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: {
placeholder: '请输入重试次数。设置为 0 时,不进行重试',
min: 0,
controlsPosition: 'right',
class: '!w-full',
},
rules: 'required',
},
@@ -81,6 +83,8 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: {
placeholder: '请输入重试间隔,单位:毫秒。设置为 0 时,无需间隔',
min: 0,
controlsPosition: 'right',
class: '!w-full',
},
rules: 'required',
},
@@ -91,6 +95,8 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: {
placeholder: '请输入监控超时时间,单位:毫秒',
min: 0,
controlsPosition: 'right',
class: '!w-full',
},
},
];