import React from 'react' import ConItem from '../ConItem' import { Menu, Dropdown } from 'antd' import cls from 'classnames' import { layerWidth } from 'stores/funcs/newEvent' import FormulaEditor from 'src/components/common/formulaEditor/EventFormulaEditor' const MenuItem = Menu.Item export default class BlockLoopConItem extends ConItem { constructor(props) { super(props) } getValueWidth() { const groupLayer = this.props.groupLayer > 0 ? this.props.groupLayer : 0 const nestingLayer = this.props.nestGroupLayer > 0 ? this.props.nestGroupLayer - 1 : 0 const extraGapGroupLayer = this.props.extraGapGroupLayer > 0 ? (this.props.extraGapGroupLayer - 1) * 2 : 0 let originWidth = 224.5 - ((groupLayer + nestingLayer) * 2) / 2 - extraGapGroupLayer / 2 let width = layerWidth({ originWidth: originWidth + this.state.widthDelta / 2, decreaseFactor: 10.5, layer: this.props.layer }) return { width: width + 'px' } } render() { let conFlagsMenu = () => { return ( {this.state.conFlags.map(option => { return ( {this.getOptionName(option)} ) })} ) } let conOperatorsMenu = () => { return ( {this.state.conOperatorOptions.map(option => { return ( {option} ) })} ) } return (
{this.props.index === 0 ? (
{this.getConItemFlagName()}
) : (
triggerNode.parentNode} overlayClassName={'loop-con-flag-dropdown'} overlay={conFlagsMenu()} >
)}
triggerNode.parentNode} overlayClassName={'loop-con-operator-dropdown'} overlay={conOperatorsMenu()} >
) : null}
) } }