From 876a5e6657d67df66bb525d02dd6d147ba81cae5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 05 一月 2023 09:53:37 +0800 Subject: [PATCH] 2023-01-05 --- src/tabviews/custom/components/card/cardcellList/index.jsx | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 47 insertions(+), 1 deletions(-) diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index bc4830a..0c35281 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/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> -- Gitblit v1.8.0