From 46fb8fb5ded5f69b39e2f47b25cd330b8b03a833 Mon Sep 17 00:00:00 2001 From: dengqichen Date: Fri, 28 Nov 2025 11:24:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E6=B6=88=E6=81=AF=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/Dashboard/components/DeploymentFormModal.tsx | 8 +++++--- frontend/src/pages/Dashboard/types.ts | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx b/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx index 6374c31f..95c52fdb 100644 --- a/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx +++ b/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx @@ -46,12 +46,14 @@ const DeploymentFormModal: React.FC = ({ // ✅ 使用 useMemo 缓存预填充数据,避免每次渲染都创建新对象 const prefillData = React.useMemo(() => { return { - // Jenkins 配置 - jenkins: { + // 构建类型 + buildType: app.buildType || 'JENKINS', + // Jenkins 配置(仅当 buildType 为 JENKINS 时需要) + jenkins: app.buildType === 'JENKINS' ? { serverId: app.deploySystemId?.toString() || '', jobName: app.deployJob || '', branch: app.branch || 'master', - }, + } : undefined, // 团队信息 teamId: teamId?.toString() || '', // 应用信息 diff --git a/frontend/src/pages/Dashboard/types.ts b/frontend/src/pages/Dashboard/types.ts index efcb2269..86989f42 100644 --- a/frontend/src/pages/Dashboard/types.ts +++ b/frontend/src/pages/Dashboard/types.ts @@ -38,12 +38,15 @@ export interface DeployRecord { duration?: number; // 持续时间(毫秒) } +export type BuildType = 'JENKINS' | 'NATIVE'; + export interface ApplicationConfig { teamApplicationId: number; applicationId: number; applicationCode: string; applicationName: string; applicationDesc?: string; + buildType?: BuildType; // 构建类型 branch: string; deployBranch?: string; // 🆕 部署分支 deploySystemId?: number;