1
This commit is contained in:
parent
e4816ed308
commit
5e80f9de10
@ -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<DeploymentConfigModalProps> = ({
|
||||
}
|
||||
}, [open, fetchApplications, fetchTemplates]);
|
||||
|
||||
// 初始化表单数据
|
||||
// <EFBFBD><EFBFBD><EFBFBD>始化表单数据
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
|
||||
@ -117,7 +119,7 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
||||
// 获取对应的模板
|
||||
const template = templates.find(t => t.languageType === selectedApp.language);
|
||||
if (!template) {
|
||||
throw new Error('未找到匹配<EFBFBD><EFBFBD><EFBFBD>配置模板');
|
||||
throw new Error('未找到匹配配置模板');
|
||||
}
|
||||
|
||||
// 构建提交数据
|
||||
@ -224,9 +226,11 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
||||
|
||||
{/* 动态构建配置 */}
|
||||
{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]) => (
|
||||
<Form.Item
|
||||
key={key}
|
||||
label={
|
||||
@ -282,10 +286,13 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
||||
}
|
||||
/>
|
||||
</Form.Item>
|
||||
);
|
||||
))
|
||||
}
|
||||
|
||||
return (
|
||||
{/* 普通字段 */}
|
||||
{Object.entries(selectedTemplate.buildVariablesSchema.properties)
|
||||
.filter(([_, property]) => !property.editorConfig)
|
||||
.map(([key, property]) => (
|
||||
<Form.Item
|
||||
key={key}
|
||||
label={property.title || key}
|
||||
@ -298,8 +305,9 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
||||
placeholder={`请输入${property.title || key}`}
|
||||
/>
|
||||
</Form.Item>
|
||||
);
|
||||
})
|
||||
))
|
||||
}
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* 状态和排序 */}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user