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