From bc5ec1017fd8a140ec5c30ea9e8ea839d5bf1bda Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 15 十二月 2020 16:22:20 +0800 Subject: [PATCH] 2020-12-15 --- src/menu/components/card/cardcellcomponent/index.jsx | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index d96bf0d..a26c5e4 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -138,7 +138,7 @@ let _card = fromJS(card).toJS() - if (_card.eleType === 'text' || _card.eleType === 'number' || _card.eleType === 'link') { + if (_card.eleType === 'text' || _card.eleType === 'number') { _card.style = style let fontSize = 14 @@ -376,7 +376,7 @@ if (res.eleType === 'splitline' && cell.eleType !== 'splitline') { res.style.paddingTop = '5px' res.style.paddingBottom = '5px' - } else if (res.eleType === 'text' || res.eleType === 'number' || res.eleType === 'link') { + } else if (res.eleType === 'text' || res.eleType === 'number') { let fontSize = 14 let lineHeight = 1.5 let line = res.height || 1 @@ -389,7 +389,7 @@ } res.innerHeight = fontSize * lineHeight * line - if (res.eleType === 'link' && !res.style.color) { + if (res.eleType === 'text' && res.link && !res.style.color) { res.style.color = 'rgba(24, 144, 255, 1)' } } else if (res.eleType === 'barcode') { @@ -560,6 +560,21 @@ }) } + updateMarks = (card) => { + const { elements } = this.state + + let _elements = elements.map(cell => { + if (cell.uuid === card.uuid) return card + return cell + }) + + this.setState({ + elements: _elements + }, () => { + this.props.updateElement(_elements) + }) + } + dropButton = (id) => { const { cards } = this.props let index = cards.action.findIndex(item => item.uuid === id) @@ -587,6 +602,8 @@ <div className="model-menu-card-cell-list"> <DragElement list={elements} + fields={cards.columns} + updateMarks={this.updateMarks} handleList={this.handleList} handleMenu={this.handleElement} handleStyle={this.handleStyle} -- Gitblit v1.8.0