From d5ce81026882ada34e5d49411be7c90ee96cc102 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 17 一月 2023 18:20:11 +0800 Subject: [PATCH] 2023-01-17 --- src/tabviews/custom/components/card/cardcellList/index.jsx | 64 +++++++++++++++++++++++++++++-- 1 files changed, 59 insertions(+), 5 deletions(-) diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index bc4830a..8f74c29 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' @@ -237,6 +237,7 @@ if (card.eleType === 'sequence') { let _style = {} + let className = '' if (card.marks) { _style.width = card.innerHeight _style.height = card.innerHeight @@ -245,11 +246,12 @@ let mark = getMark(card.marks, data, _style) _style = mark.style + className = mark.signType } contents.push( <Col key={card.uuid} style={_style_} span={card.width}> <div style={card.style}> - <div className="ant-mk-text line1" style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> + <div className={'ant-mk-text line1' + className} style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> </div> </Col> ) @@ -362,6 +364,7 @@ } } + let className = '' if (card.marks) { let mark = getMark(card.marks, data, _style) @@ -374,6 +377,7 @@ val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> } } + className = mark.signType } if (card.link || (card.anchors && card.anchors.length > 0)) { @@ -387,7 +391,7 @@ contents.push( <Col key={card.uuid} style={_style_} span={card.width}> <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> - <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> + <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> </div> </Col> ) @@ -437,6 +441,7 @@ } } + let className = '' if (card.marks) { let mark = getMark(card.marks, data, _style) @@ -449,12 +454,13 @@ val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> } } + className = mark.signType } contents.push( <Col key={card.uuid} style={_style_} span={card.width}> <div style={_style}> - <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> + <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> </div> </Col> ) @@ -747,6 +753,7 @@ } } + let className = '' if (card.marks) { let mark = getMark(card.marks, data, _style) @@ -759,12 +766,58 @@ val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> } } + className = mark.signType } contents.push( <Col key={card.uuid} style={_style_} span={card.width}> <div style={_style}> - <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> + <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> + </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> ) @@ -896,6 +949,7 @@ BData={data.$$BData || ''} disabled={_disabled} setting={cards.setting} + columns={cards.columns} selectedData={_data} /> </Col> -- Gitblit v1.8.0