增加工具栏提示。
This commit is contained in:
parent
692a6030eb
commit
e2d06ece26
@ -124,7 +124,7 @@ const NodeConfigDrawer: React.FC<NodeConfigDrawerProps> = ({
|
|||||||
|
|
||||||
const { configSchema } = nodeDefinition.graphConfig;
|
const { configSchema } = nodeDefinition.graphConfig;
|
||||||
console.log('NodeConfigModal - Rendering form items with schema:', configSchema);
|
console.log('NodeConfigModal - Rendering form items with schema:', configSchema);
|
||||||
|
|
||||||
const formItems = [];
|
const formItems = [];
|
||||||
|
|
||||||
// 根据 configSchema 生成表单项
|
// 根据 configSchema 生成表单项
|
||||||
@ -200,7 +200,16 @@ const NodeConfigDrawer: React.FC<NodeConfigDrawerProps> = ({
|
|||||||
layout="vertical"
|
layout="vertical"
|
||||||
initialValues={{}}
|
initialValues={{}}
|
||||||
>
|
>
|
||||||
{renderFormItems()}
|
<Form.Item name="code" hidden>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
{nodeDefinition?.graphConfig.configSchema &&
|
||||||
|
Object.entries(nodeDefinition.graphConfig.configSchema.properties).map(([key, property]) => {
|
||||||
|
// 跳过 code 字段的显示
|
||||||
|
if (key === 'code') return null;
|
||||||
|
const required = nodeDefinition.graphConfig.configSchema.required?.includes(key) || false;
|
||||||
|
return renderFormItem(key, property as SchemaProperty, required);
|
||||||
|
})}
|
||||||
</Form>
|
</Form>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -16,7 +16,6 @@ export const addNodeToGraph = (
|
|||||||
position?: { x: number, y: number }
|
position?: { x: number, y: number }
|
||||||
) => {
|
) => {
|
||||||
let nodeDefinition = workflowNodeDefinitionList.find(def => def.type === workflowDefinitionNode.type);
|
let nodeDefinition = workflowNodeDefinitionList.find(def => def.type === workflowDefinitionNode.type);
|
||||||
console.log(nodeDefinition.graphConfig.uiSchema, workflowDefinitionNode.graph)
|
|
||||||
let uiGraph = isNew ? nodeDefinition.graphConfig.uiSchema : workflowDefinitionNode.graph;
|
let uiGraph = isNew ? nodeDefinition.graphConfig.uiSchema : workflowDefinitionNode.graph;
|
||||||
// 根据形状类型设置正确的 shape
|
// 根据形状类型设置正确的 shape
|
||||||
let shape = 'rect'; // 默认使用矩形
|
let shape = 'rect'; // 默认使用矩形
|
||||||
@ -25,7 +24,6 @@ export const addNodeToGraph = (
|
|||||||
} else if (uiGraph.shape === 'diamond') {
|
} else if (uiGraph.shape === 'diamond') {
|
||||||
shape = 'polygon';
|
shape = 'polygon';
|
||||||
}
|
}
|
||||||
console.log(nodeDefinition.type, workflowDefinitionNode.type)
|
|
||||||
// 创建节点
|
// 创建节点
|
||||||
return graph.addNode({
|
return graph.addNode({
|
||||||
inherit: 'rect',
|
inherit: 'rect',
|
||||||
@ -50,7 +48,6 @@ export const addNodeToGraph = (
|
|||||||
type: isNew ? nodeDefinition.type : workflowDefinitionNode.type,
|
type: isNew ? nodeDefinition.type : workflowDefinitionNode.type,
|
||||||
code: uiGraph.code,
|
code: uiGraph.code,
|
||||||
ports: convertPortConfig(uiGraph.ports),
|
ports: convertPortConfig(uiGraph.ports),
|
||||||
nodeDefinition: nodeDefinition,
|
nodeDefinition: nodeDefinition
|
||||||
aaaaaa: "dasdasdsadasdd"
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
Loading…
Reference in New Issue
Block a user