From 5e80f9de102e1f01802e30841eda8c4856d1e908 Mon Sep 17 00:00:00 2001 From: dengqichen Date: Fri, 27 Dec 2024 12:56:44 +0800 Subject: [PATCH] 1 --- .../List/components/DeploymentConfigModal.tsx | 60 +++++++++++-------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx index cb3365f9..009c5d04 100644 --- a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx +++ b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx @@ -5,6 +5,8 @@ import type {DeploymentConfig, DeployConfigTemplate, CreateDeploymentConfigReque import {createDeploymentConfig, updateDeploymentConfig, getDeployConfigTemplates} from '../service'; import {getApplicationList} from '../../../Application/List/service'; import type {Application} from '../../../Application/List/types'; +import {BetaSchemaForm} from '@ant-design/pro-form'; +import {convertJsonSchemaToColumns} from '@/utils/jsonSchemaUtils'; import {Editor} from '@/components/Editor'; import type {JsonNode} from '@/types/common'; import './styles.less'; @@ -66,7 +68,7 @@ const DeploymentConfigModal: React.FC = ({ } }, [open, fetchApplications, fetchTemplates]); - // 初始化表单数据 + // ���始化表单数据 useEffect(() => { if (!open) return; @@ -117,7 +119,7 @@ const DeploymentConfigModal: React.FC = ({ // 获取对应的模板 const template = templates.find(t => t.languageType === selectedApp.language); if (!template) { - throw new Error('未找到匹配���配置模板'); + throw new Error('未找到匹配配置模板'); } // 构建提交数据 @@ -224,9 +226,11 @@ const DeploymentConfigModal: React.FC = ({ {/* 动态构建配置 */} {selectedTemplate?.buildVariablesSchema?.properties && ( - Object.entries(selectedTemplate.buildVariablesSchema.properties).map(([key, property]) => { - if (property.editorConfig) { - return ( + <> + {/* 富文本编辑器字段 */} + {Object.entries(selectedTemplate.buildVariablesSchema.properties) + .filter(([_, property]) => property.editorConfig) + .map(([key, property]) => ( = ({ renderWhitespace: 'boundary', }} loading={ -
= ({ } /> - ); + )) } - return ( - - ) => handleInputChange(key, e.target.value)} - placeholder={`请输入${property.title || key}`} - /> - - ); - }) + {/* 普通字段 */} + {Object.entries(selectedTemplate.buildVariablesSchema.properties) + .filter(([_, property]) => !property.editorConfig) + .map(([key, property]) => ( + + ) => handleInputChange(key, e.target.value)} + placeholder={`请输入${property.title || key}`} + /> + + )) + } + )} {/* 状态和排序 */} @@ -325,7 +333,7 @@ const DeploymentConfigModal: React.FC = ({ styles={{ body: { padding: 0 }, mask: { backgroundColor: 'rgba(0, 0, 0, 0.65)' }, - content: { + content: { position: 'fixed', top: 0, left: 0,