diff --git a/apps/web-ele/src/components/cron-tab/cron-tab.vue b/apps/web-ele/src/components/cron-tab/cron-tab.vue new file mode 100644 index 00000000..6aacf850 --- /dev/null +++ b/apps/web-ele/src/components/cron-tab/cron-tab.vue @@ -0,0 +1,1152 @@ + + + + + + + + + + + + + + + + + + + + + + + + 秒 + {{ value_second }} + + + + + + 任意值 + 范围 + 间隔 + 指定 + + + + + - + + + + + 秒开始,每 + + 秒执行一次 + + + + + + + + + + + + 分钟 + {{ value_minute }} + + + + + + 任意值 + 范围 + 间隔 + 指定 + + + + + - + + + + + 分钟开始,每 + + 分钟执行一次 + + + + + + + + + + + + 小时 + {{ value_hour }} + + + + + + 任意值 + 范围 + 间隔 + 指定 + + + + + - + + + + + 小时开始,每 + + 小时执行一次 + + + + + + + + + + + + 日 + {{ value_day }} + + + + + + 任意值 + 范围 + 间隔 + 指定 + 本月最后一天 + 不指定 + + + + + - + + + + + 号开始,每 + + 天执行一次 + + + + + + + + + + + + 月 + {{ value_month }} + + + + + + 任意值 + 范围 + 间隔 + 指定 + + + + + - + + + + + 月开始,每 + + 月执行一次 + + + + + + + + + + + + 周 + {{ value_week }} + + + + + + + 任意值 + 范围 + 间隔 + 指定 + 本月最后一周 + 不指定 + + + + + + + - + + + + + + 第 + + 周的星期 + + + + 执行一次 + + + + + + + + + + + + + + + + + + 年 + {{ value_year }} + + + + + + 忽略 + 任意值 + 范围 + 间隔 + 指定 + + + + + - + + + + + 年开始,每 + + 年执行一次 + + + + + + + + + + + + + 取 消 + 确 认 + + + + + diff --git a/apps/web-ele/src/components/cron-tab/index.ts b/apps/web-ele/src/components/cron-tab/index.ts new file mode 100644 index 00000000..8f4baae5 --- /dev/null +++ b/apps/web-ele/src/components/cron-tab/index.ts @@ -0,0 +1 @@ +export { default as CronTab } from './cron-tab.vue'; diff --git a/apps/web-ele/src/views/infra/job/data.ts b/apps/web-ele/src/views/infra/job/data.ts index 78b3b187..e2acb01a 100644 --- a/apps/web-ele/src/views/infra/job/data.ts +++ b/apps/web-ele/src/views/infra/job/data.ts @@ -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', }, }, ];