king
2023-01-05 876a5e6657d67df66bb525d02dd6d147ba81cae5
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -1,7 +1,7 @@
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'
@@ -768,6 +768,51 @@
            </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') {
@@ -896,6 +941,7 @@
                  BData={data.$$BData || ''}
                  disabled={_disabled}
                  setting={cards.setting}
                  columns={cards.columns}
                  selectedData={_data}
                />
              </Col>