import React, { useState } from 'react'; import { Modal, Form, Input, InputNumber, Radio } from 'antd'; import { Edge } from '@antv/x6'; import { ConditionType, EdgeCondition } from '../types'; interface ExpressionModalProps { visible: boolean; edge: Edge; onOk: (condition: EdgeCondition) => void; onCancel: () => void; } const ExpressionModal: React.FC = ({ visible, edge, onOk, onCancel }) => { const [form] = Form.useForm(); const currentCondition = edge.getProp('condition') as EdgeCondition; const handleOk = async () => { try { const values = await form.validateFields(); onOk(values); } catch (error) { console.error('表单验证失败:', error); } }; return (
表达式 默认路径 prevValues.type !== currentValues.type} > {({ getFieldValue }) => { const type = getFieldValue('type'); return type === 'EXPRESSION' ? ( ) : null; }}
); }; export default ExpressionModal;