From c64c770f544154f8209cd2fc2c944961adb0892b Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 25 Sep 2025 17:05:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E3=80=90ele=E3=80=91=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?CronTab=20CRON=20=E8=A1=A8=E8=BE=BE=E5=BC=8F=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E3=80=81JOB=20=E8=A1=A8=E5=8D=95=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/cron-tab/cron-tab.vue | 1152 +++++++++++++++++ apps/web-ele/src/components/cron-tab/index.ts | 1 + apps/web-ele/src/views/infra/job/data.ts | 12 +- 3 files changed, 1162 insertions(+), 3 deletions(-) create mode 100644 apps/web-ele/src/components/cron-tab/cron-tab.vue create mode 100644 apps/web-ele/src/components/cron-tab/index.ts 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 @@ + + + + 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', }, }, ];