| | |
| | | |
| | | let _style = {opacity: isDragging ? 0.3 : 1} |
| | | |
| | | if (card.style) { |
| | | if (card.style && card.eleType !== 'tag') { |
| | | _style = {...card.style, opacity: isDragging ? 0.3 : 1} |
| | | _style = resetStyle(_style) |
| | | } |
| | |
| | | let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{card.formula}<span style={_s}>{card.postfix || ''}</span></> |
| | | } |
| | | |
| | | return ( |
| | | <div className="ant-mk-text" style={{height: card.innerHeight || 'auto'}}> |
| | | {val} |
| | | </div> |
| | | ) |
| | | } else if (card.eleType === 'tag') { |
| | | let vals = [] |
| | | if (card.datatype === 'static') { |
| | | vals = card.value.split(',').filter(Boolean) |
| | | } else { |
| | | vals = [card.field || ''] |
| | | } |
| | | |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className="ant-mk-tag"> |
| | | {vals.map((val, index) => <span key={index} className="tag-item" style={_style}>{val}</span>)} |
| | | </div> |
| | | ) |
| | | } else if (card.eleType === 'color') { |
| | | _style.overflow = 'hidden' |
| | | let _bgstyle = {backgroundColor: card.value || '#1890ff'} |