1
This commit is contained in:
parent
0accb8d53b
commit
d8cc3c0983
@ -65,7 +65,8 @@ const FormRenderer: React.FC<{
|
||||
schema: any;
|
||||
path?: string;
|
||||
readOnly?: boolean;
|
||||
}> = ({schema, path = '', readOnly = false}) => {
|
||||
currentTab?: any;
|
||||
}> = ({schema, path = '', readOnly = false, currentTab}) => {
|
||||
if (!schema || !schema.properties) return null;
|
||||
const renderPortConfig = (portSchema: any, portPath: string) => {
|
||||
if (!portSchema || !portSchema.properties) return null;
|
||||
@ -85,6 +86,12 @@ const FormRenderer: React.FC<{
|
||||
required={portSchema.required?.includes('position')}
|
||||
initialValue={'default' in position ? position.default : undefined}
|
||||
style={{marginBottom: 16}}
|
||||
rules={[
|
||||
{
|
||||
required: portSchema.required?.includes('position'),
|
||||
message: `请${position.type === 'string' ? '输入' : '选择'}${position.title}`
|
||||
}
|
||||
]}
|
||||
>
|
||||
{readOnly ? (
|
||||
<span style={{color: '#666'}}>{position.default || '-'}</span>
|
||||
@ -112,6 +119,7 @@ const FormRenderer: React.FC<{
|
||||
schema={attrs}
|
||||
path={`${portPath}.attrs`}
|
||||
readOnly={readOnly}
|
||||
currentTab={currentTab}
|
||||
/>
|
||||
</Card>
|
||||
)}
|
||||
@ -192,6 +200,7 @@ const FormRenderer: React.FC<{
|
||||
schema={value}
|
||||
path={fieldPath}
|
||||
readOnly={readOnly}
|
||||
currentTab={currentTab}
|
||||
/>
|
||||
</Card>
|
||||
);
|
||||
@ -207,9 +216,15 @@ const FormRenderer: React.FC<{
|
||||
</span>
|
||||
}
|
||||
tooltip={value.description}
|
||||
required={schema.required?.includes(key)}
|
||||
required={currentTab?.schemaKey === 'uiVariables' && schema.required?.includes(key)}
|
||||
initialValue={'default' in value ? value.default : undefined}
|
||||
style={{marginBottom: 16}}
|
||||
rules={currentTab?.schemaKey === 'uiVariables' ? [
|
||||
{
|
||||
required: schema.required?.includes(key),
|
||||
message: `请${value.type === 'string' ? '输入' : '选择'}${value.title}`
|
||||
}
|
||||
] : undefined}
|
||||
>
|
||||
{readOnly ? (
|
||||
<span style={{color: '#666'}}>{value.default || '-'}</span>
|
||||
@ -638,6 +653,7 @@ const NodeDesignForm: React.FC = () => {
|
||||
<FormRenderer
|
||||
schema={getCurrentSchema()}
|
||||
readOnly={tab.readonly}
|
||||
currentTab={tab}
|
||||
/>
|
||||
</div>
|
||||
) : null
|
||||
|
||||
Loading…
Reference in New Issue
Block a user