From 9a457873b191ad48f8500279571341e7a98bfd9f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 06 四月 2023 10:41:16 +0800 Subject: [PATCH] 2023-04-06 --- src/tabviews/custom/components/card/cardcellList/index.jsx | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 231b01d..89a6b8f 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -267,6 +267,19 @@ let city = sessionStorage.getItem('city') || '' let bid = data.$$BID || '' val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@mk_city@/ig, city).replace(/@bid@/ig, bid) + } else if (/@month@/ig.test(val)) { + val = val.replace(/@month@/ig, new Date().toLocaleString('en-US', { month: 'long' })) + } else if (/@week@/ig.test(val)) { + val = val.replace(/@week@/ig, (() => { + let day = new Date().getDay() + let weeks = ['鏄熸湡鏃�', '鏄熸湡涓�', '鏄熸湡浜�', '鏄熸湡涓�', '鏄熸湡鍥�', '鏄熸湡浜�', '鏄熸湡鍏�'] + return weeks[day] + })()) + } else if (/@day@/ig.test(val)) { + val = val.replace(/@day@/ig, (() => { + let day = new Date().getDate() + return day < 10 ? '0' + day : day + })()) } } else if (data.hasOwnProperty(card.field)) { val = data[card.field] @@ -387,11 +400,18 @@ if (card.bgImage && data[card.bgImage]) { _style.backgroundImage = `url('${data[card.bgImage]}')` } + + let lineStyle = {height: card.innerHeight || 'auto'} + if (card.alignItems) { + lineStyle.display = 'flex' + lineStyle.alignItems = card.alignItems + lineStyle.justifyContent = _style.textAlign || 'left' + } 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 || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> + <div className={'ant-mk-text line' + (card.height || '') + className} style={lineStyle}>{val}</div> </div> </Col> ) @@ -457,11 +477,18 @@ } className = mark.signType } + + let lineStyle = {height: card.innerHeight || 'auto'} + if (card.alignItems) { + lineStyle.display = 'flex' + lineStyle.alignItems = card.alignItems + lineStyle.justifyContent = _style.textAlign || 'left' + } contents.push( <Col key={card.uuid} style={_style_} span={card.width}> <div style={_style}> - <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> + <div className={'ant-mk-text line' + (card.height || '') + className} style={lineStyle}>{val}</div> </div> </Col> ) @@ -776,11 +803,18 @@ } className = mark.signType } + + let lineStyle = {height: card.innerHeight || 'auto'} + if (card.alignItems) { + lineStyle.display = 'flex' + lineStyle.alignItems = card.alignItems + lineStyle.justifyContent = _style.textAlign || 'left' + } contents.push( <Col key={card.uuid} style={_style_} span={card.width}> <div style={_style}> - <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> + <div className={'ant-mk-text line' + (card.height || '') + className} style={lineStyle}>{val}</div> </div> </Col> ) @@ -983,8 +1017,10 @@ } render() { + const { cardCell } = this.props + return ( - <div className="card-cell-list"> + <div className={'card-cell-list ' + (cardCell && cardCell.setting && cardCell.setting.layout === 'flex' ? 'mk-flex' : '')}> {this.getContent()} </div> ) -- Gitblit v1.8.0