| | |
| | | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | } |
| | | 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') { |
| | |
| | | }) |
| | | } |
| | | |
| | | 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) |
| | |
| | | <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} |