1
This commit is contained in:
parent
15ebbab10a
commit
5abfb2e6ce
@ -217,10 +217,10 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
||||
{/* 动态构建配置 */}
|
||||
{selectedTemplate?.buildVariablesSchema?.properties && (
|
||||
<>
|
||||
{/* 富文本编辑器字段 */}
|
||||
{Object.entries(selectedTemplate.buildVariablesSchema.properties)
|
||||
.filter(([_, property]) => property.editorConfig)
|
||||
.map(([key, property]) => {
|
||||
{/* 按照原始顺序渲染所有字段 */}
|
||||
{Object.entries(selectedTemplate.buildVariablesSchema.properties).map(([key, property]) => {
|
||||
// 如果是编辑器字段
|
||||
if (property.editorConfig) {
|
||||
const isFullscreen = fullscreenEditor?.key === key;
|
||||
const editorConfig = property.editorConfig;
|
||||
|
||||
@ -298,48 +298,48 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
||||
{editor}
|
||||
</Form.Item>
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
{/* 普通字段 */}
|
||||
// 如果是普通字段,使用 BetaSchemaForm
|
||||
return (
|
||||
<BetaSchemaForm
|
||||
key={key}
|
||||
layoutType="Embed"
|
||||
columns={convertJsonSchemaToColumns({
|
||||
type: 'object',
|
||||
properties: Object.fromEntries(
|
||||
Object.entries(selectedTemplate.buildVariablesSchema.properties)
|
||||
.filter(([_, prop]) => !prop.editorConfig)
|
||||
.map(([key, prop]) => [
|
||||
key,
|
||||
{
|
||||
type: prop.type || 'string',
|
||||
title: prop.title,
|
||||
description: prop.description,
|
||||
default: prop.default,
|
||||
enum: prop.enum,
|
||||
enumNames: prop.enumNames,
|
||||
format: prop.format,
|
||||
minimum: prop.minimum,
|
||||
maximum: prop.maximum,
|
||||
minLength: prop.minLength,
|
||||
maxLength: prop.maxLength,
|
||||
pattern: prop.pattern,
|
||||
items: prop.items && {
|
||||
type: prop.items.type || 'string',
|
||||
enum: prop.items.enum,
|
||||
enumNames: prop.items.enumNames
|
||||
properties: {
|
||||
[key]: {
|
||||
type: property.type || 'string',
|
||||
title: property.title,
|
||||
description: property.description,
|
||||
default: property.default,
|
||||
enum: property.enum,
|
||||
enumNames: property.enumNames,
|
||||
format: property.format,
|
||||
minimum: property.minimum,
|
||||
maximum: property.maximum,
|
||||
minLength: property.minLength,
|
||||
maxLength: property.maxLength,
|
||||
pattern: property.pattern,
|
||||
items: property.items && {
|
||||
type: property.items.type || 'string',
|
||||
enum: property.items.enum,
|
||||
enumNames: property.items.enumNames
|
||||
}
|
||||
}
|
||||
])
|
||||
),
|
||||
required: selectedTemplate.buildVariablesSchema.required || []
|
||||
},
|
||||
required: selectedTemplate.buildVariablesSchema.required?.includes(key) ? [key] : []
|
||||
})}
|
||||
initialValues={buildVariables}
|
||||
initialValues={{
|
||||
[key]: buildVariables[key]
|
||||
}}
|
||||
onValuesChange={(_, values) => setBuildVariables(prev => ({
|
||||
...prev,
|
||||
...values
|
||||
}))}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user