| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Col, Tooltip, notification, Typography } from 'antd' |
| | | import { Col, Tooltip, notification, Typography, message } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'color') { |
| | | let color = '' |
| | | |
| | | if (card.datatype === 'static') { |
| | | color = card.value |
| | | } else { |
| | | color = data[card.field] || '' |
| | | } |
| | | |
| | | if (color === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | let _bgstyle = {backgroundColor: color} |
| | | |
| | | if (PicRadio[card.lenWidRadio]) { |
| | | _bgstyle.paddingTop = PicRadio[card.lenWidRadio] |
| | | } else { |
| | | _bgstyle.paddingTop = '100%' |
| | | } |
| | | |
| | | if (card.copyable === 'true') { |
| | | _bgstyle.cursor = 'pointer' |
| | | } |
| | | |
| | | contents.push( |
| | | <Col key={card.uuid} style={_style_} span={card.width}> |
| | | <div className="ant-mk-color" style={card.style}> |
| | | <div style={_bgstyle} onClick={(e) => { |
| | | if (card.copyable === 'true') { |
| | | e.stopPropagation() |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = color |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | |
| | | message.success('复制成功。') |
| | | } |
| | | }}></div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'button') { |
| | | let _disabled = data.$disabled |
| | | if (card.control === 'hidden') { |
| | |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | columns={cards.columns} |
| | | selectedData={_data} |
| | | /> |
| | | </Col> |