From 529482a83ee9c9a1e0b6b02cb35978d715aeeb0c Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 25 Jun 2025 18:40:20 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=A8=A1=E7=89=88=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=B5=81=E6=B0=B4=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/certd/pipeline/template/use.tsx | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/ui/certd-client/src/views/certd/pipeline/template/use.tsx b/packages/ui/certd-client/src/views/certd/pipeline/template/use.tsx index 3271c6d4..b210319b 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/template/use.tsx +++ b/packages/ui/certd-client/src/views/certd/pipeline/template/use.tsx @@ -42,11 +42,11 @@ export function useTemplate() { const randomMin = Math.floor(Math.random() * 60); const templateFormRef = ref(); - async function onSubmit(opts: { form: any }) { + async function doSubmit(opts: { form: any }) { const form = opts.form; await templateFormRef.value.validate(); - const tempInputs = templateFormRef.value.getFormData(); + const tempInputs = templateFormRef.value.getForm(); let newPipeline = cloneDeep(pipeline); newPipeline = fillPipelineByDefaultForm(newPipeline, form); @@ -64,9 +64,11 @@ export function useTemplate() { } } + const title = form.title; + newPipeline.title = title; const groupId = form.groupId; - const { id } = await templateApi.CreatePipelineByTemplate({ - title: form.title, + await templateApi.CreatePipelineByTemplate({ + title, content: JSON.stringify(newPipeline), keepHistoryCount: 30, groupId, @@ -76,7 +78,7 @@ export function useTemplate() { const crudOptions = { form: { - onSubmit, + doSubmit, wrapper: { title: `从模版<${detail.template.title}>创建流水线`, width: 1100, @@ -92,6 +94,16 @@ export function useTemplate() { }, }, columns: { + title: { + title: "流水线标题", + type: "text", + form: { + component: { + placeholder: "请输入流水线标题", + }, + rules: [{ required: true, message: "请输入流水线标题" }], + }, + }, triggerCron: { title: "定时触发", type: "text", @@ -133,7 +145,7 @@ export function useTemplate() { name: GroupSelector, vModel: "modelValue", }, - order: 9999, + order: 99, }, }, },