| | |
| | | ) |
| | | } else if (card.eleType === 'icon') { |
| | | let val = '' |
| | | let icon = '' |
| | | let height = card.innerHeight |
| | | |
| | | if (card.datatype === 'dynamic') { |
| | | icon = data[card.field] || '' |
| | | } else { |
| | | icon = card.icon |
| | | } |
| | | |
| | | if (!height) { // 兼容 |
| | | let fontSize = 14 |
| | |
| | | height = fontSize * lineHeight |
| | | } |
| | | |
| | | if (card.datatype === 'static') { |
| | | if (data.hasOwnProperty(card.tooltip)) { |
| | | val = data[card.tooltip] |
| | | } else { |
| | | val = card.tooltip |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | | } |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | {val ? <Tooltip title={val}> |
| | | <MkIcon className="ant-mk-icon" style={{height: height}} type={card.icon}/> |
| | | </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: height}} type={card.icon}/>} |
| | | <MkIcon className="ant-mk-icon" style={{height: height}} type={icon}/> |
| | | </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: height}} type={icon}/>} |
| | | </div> |
| | | </Col> |
| | | ) |