This commit is contained in:
dengqichen 2024-12-20 09:36:39 +08:00
parent 9433287919
commit 0e4125a469

View File

@ -50,10 +50,6 @@ const FormRenderer: React.FC<{
readOnly?: boolean; readOnly?: boolean;
}> = ({ schema, path = '', readOnly = false }) => { }> = ({ schema, path = '', readOnly = false }) => {
if (!schema || !schema.properties) return null; if (!schema || !schema.properties) return null;
console.log('Current path:', path);
console.log('Properties:', Object.keys(schema.properties));
const renderPortConfig = (portSchema: any, portPath: string) => { const renderPortConfig = (portSchema: any, portPath: string) => {
if (!portSchema || !portSchema.properties) return null; if (!portSchema || !portSchema.properties) return null;
@ -297,62 +293,37 @@ const NodeDesignForm: React.FC = () => {
}} }}
> >
<div style={{ display: 'flex', gap: '24px', padding: '24px' }}> <div style={{ display: 'flex', gap: '24px', padding: '24px' }}>
<Card <Tabs
style={{ tabPosition="left"
width: 280, type="card"
height: 'fit-content', activeKey={selectedNode?.nodeCode || ''}
borderRadius: '8px', onChange={(key) => {
boxShadow: '0 1px 2px rgba(0,0,0,0.03)' const node = nodeDefinitionsDefined.find(n => n.nodeCode === key);
if (node) {
handleNodeSelect(node);
}
}} }}
styles={{ items={nodeDefinitionsDefined.map(node => ({
body: { padding: 0 } key: node.nodeCode,
}} label: (
> <div style={{ padding: '4px 0' }}>
<div style={{ <div style={{ fontSize: '14px', fontWeight: 500 }}>
padding: '16px', {node.nodeName}
borderBottom: '1px solid #f0f0f0',
fontWeight: 500,
fontSize: '14px',
color: '#333'
}}>
</div>
<Menu
selectedKeys={[selectedNode?.nodeCode || '']}
items={nodeDefinitionsDefined.map(node => ({
key: node.nodeCode,
label: (
<div style={{ padding: '4px 0' }}>
<div style={{ fontSize: '14px', fontWeight: 500 }}>
{node.nodeName}
</div>
<div style={{
fontSize: '12px',
color: '#666',
marginTop: '4px'
}}>
{node.nodeCode}
</div>
</div> </div>
) <div style={{
}))} fontSize: '12px',
onClick={({ key }) => { color: '#666',
const node = nodeDefinitionsDefined.find(n => n.nodeCode === key); marginTop: '4px'
if (node) { }}>
handleNodeSelect(node); {node.nodeCode}
} </div>
}} </div>
style={{ border: 'none', padding: '8px 0' }} )
/> }))}
</Card> />
<Card <Card
style={{ style={{
flex: 1, flex: 1,
borderRadius: '8px',
boxShadow: '0 1px 2px rgba(0,0,0,0.03)'
}}
styles={{
body: { padding: '24px' }
}} }}
> >
<Form <Form
@ -382,11 +353,6 @@ const NodeDesignForm: React.FC = () => {
</div> </div>
) : null ) : null
}))} }))}
style={{
marginTop: '-16px',
marginLeft: '-16px',
marginRight: '-16px'
}}
/> />
</Form> </Form>
</Card> </Card>