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