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