1
This commit is contained in:
parent
070e6b1c94
commit
61a6d7f12b
@ -138,6 +138,12 @@ const NodeConfigDrawer: React.FC<NodeConfigDrawerProps> = ({
|
|||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
|
case 'integer': // 添加对 integer 类型的支持
|
||||||
|
return (
|
||||||
|
<Form.Item key={key} {...baseProps}>
|
||||||
|
<Input type="number"/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
case 'number':
|
case 'number':
|
||||||
return (
|
return (
|
||||||
<Form.Item key={key} {...baseProps}>
|
<Form.Item key={key} {...baseProps}>
|
||||||
@ -168,9 +174,7 @@ const NodeConfigDrawer: React.FC<NodeConfigDrawerProps> = ({
|
|||||||
extra={
|
extra={
|
||||||
<Space>
|
<Space>
|
||||||
<Button onClick={handleCancel}>取消</Button>
|
<Button onClick={handleCancel}>取消</Button>
|
||||||
<Button type="primary" onClick={handleOk}>
|
<Button type="primary" onClick={handleOk}>确定</Button>
|
||||||
确定
|
|
||||||
</Button>
|
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@ -179,16 +183,19 @@ const NodeConfigDrawer: React.FC<NodeConfigDrawerProps> = ({
|
|||||||
nodeDefinition?.panelVariablesSchema && {
|
nodeDefinition?.panelVariablesSchema && {
|
||||||
key: 'panel',
|
key: 'panel',
|
||||||
label: '面板变量',
|
label: '面板变量',
|
||||||
children: Object.entries(nodeDefinition.panelVariablesSchema.properties).map(([key, property]) => {
|
children: Object.entries(nodeDefinition.panelVariablesSchema.properties || {}).map(([key, property]) => {
|
||||||
const required = nodeDefinition.panelVariablesSchema?.properties.required?.includes(key) || false;
|
// 获取必填字段列表
|
||||||
|
const requiredFields = nodeDefinition.panelVariablesSchema?.required || [];
|
||||||
|
const required = requiredFields.includes(key);
|
||||||
return renderFormItem(key, property as SchemaProperty, required, false);
|
return renderFormItem(key, property as SchemaProperty, required, false);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
nodeDefinition?.localVariablesSchema && {
|
nodeDefinition?.localVariablesSchema && {
|
||||||
key: 'local',
|
key: 'local',
|
||||||
label: '环境变量',
|
label: '环境变量',
|
||||||
children: Object.entries(nodeDefinition.localVariablesSchema.properties).map(([key, property]) => {
|
children: Object.entries(nodeDefinition.localVariablesSchema.properties || {}).map(([key, property]) => {
|
||||||
const required = nodeDefinition.localVariablesSchema?.properties.required?.includes(key) || false;
|
const requiredFields = nodeDefinition.localVariablesSchema?.required || [];
|
||||||
|
const required = requiredFields.includes(key);
|
||||||
return renderFormItem(key, property as SchemaProperty, required, true);
|
return renderFormItem(key, property as SchemaProperty, required, true);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1068,11 +1068,11 @@ const WorkflowDesign: React.FC = () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// 校验流程图
|
// 校验流程图
|
||||||
// const validationResult = validateWorkflow(graph);
|
const validationResult = validateWorkflow(graph);
|
||||||
// if (!validationResult.valid) {
|
if (!validationResult.valid) {
|
||||||
// message.error(validationResult.message);
|
message.error(validationResult.message);
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// 获取所有节点和边的数据
|
// 获取所有节点和边的数据
|
||||||
const nodes = graph.getNodes().map(node => {
|
const nodes = graph.getNodes().map(node => {
|
||||||
|
|||||||
@ -113,7 +113,6 @@ const validateAllNodesConfig = (graph: Graph): ValidationResult => {
|
|||||||
|
|
||||||
for (const node of nodes) {
|
for (const node of nodes) {
|
||||||
const nodeDefinition = node.getProp('nodeDefinition');
|
const nodeDefinition = node.getProp('nodeDefinition');
|
||||||
console.log(nodeDefinition)
|
|
||||||
const result = validateNodeConfig(node, nodeDefinition);
|
const result = validateNodeConfig(node, nodeDefinition);
|
||||||
if (!result.valid) {
|
if (!result.valid) {
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user