| | |
| | | render() { |
| | | const { card } = this.props |
| | | const { dict, visible, cardcell } = this.state |
| | | let _width = '100%' |
| | | if (card.actions.length > 0) { |
| | | _width = Math.floor((100 / card.actions.length) * 10000) / 10000 + '%' |
| | | } |
| | | |
| | | return ( |
| | | <div className="line-card-edit-box"> |
| | |
| | | className={'ant-card ant-card-bordered chart-card' + (card.widthType === 'ratio' ? ' ant-col ant-col-' + card.cardWidth : '')} |
| | | style={card.widthType === 'absolute' ? { width: card.cardWidth } : null} |
| | | > |
| | | <div className="ant-card-head"> |
| | | <div className="ant-card-head-wrapper"> |
| | | <div className="ant-card-head-title">Card Title</div> |
| | | <div className="ant-card-extra"> |
| | | <span>Action</span> |
| | | {card.subelement.includes('header') ? |
| | | <div className="ant-card-head"> |
| | | <Icon className="edit" title="Edit" type="edit" onClick={this.editHeader} /> |
| | | <div className="ant-card-head-wrapper"> |
| | | <div className="ant-card-head-title">{card.header.title.content}</div> |
| | | <div className="ant-card-extra"> |
| | | <span>Action</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div className="ant-card-body"> |
| | | </div> : null |
| | | } |
| | | {card.subelement.includes('content') ? <div className="ant-card-body"> |
| | | <div className="ant-card-meta"> |
| | | <Icon type="plus" onClick={() => this.editdetail()} /> |
| | | {card.cardType === 'card2' ? <div className="ant-card-meta-avatar"> |
| | | <span className="ant-avatar ant-avatar-circle ant-avatar-image" style={{width: 32, height: 32}}> |
| | | <img src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" alt=""/> |
| | | </span> |
| | | </div> : null } |
| | | {card.subelement.includes('avatar') ? |
| | | <div className="ant-card-meta-avatar"> |
| | | <Icon className="edit" title="Edit" type="edit" onClick={this.editAvatar} /> |
| | | <span className="ant-avatar ant-avatar-circle ant-avatar-image" style={{width: 32, height: 32}}> |
| | | <img src={card.avatar.content || 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'} alt=""/> |
| | | </span> |
| | | </div> : null |
| | | } |
| | | <DragDetail |
| | | list={card.details} |
| | | cardObj={card} |
| | | handleList={this.handleList} |
| | | handleMenu={this.editdetail} |
| | | deleteMenu={this.deletedetail} |
| | | /> |
| | | </div> |
| | | </div> |
| | | {card.cardType === 'card2' ? <ul className="ant-card-actions"> |
| | | <li style={{width: '33.3333%'}}> |
| | | <span> |
| | | <Icon type="setting"/> |
| | | </span> |
| | | </li> |
| | | <li style={{width: '33.3333%'}}> |
| | | <span> |
| | | <Icon type="edit"/> |
| | | </span> |
| | | </li> |
| | | <li style={{width: '33.3333%'}}> |
| | | <span> |
| | | <Icon type="edit"/> |
| | | </span> |
| | | </li> |
| | | </ul> : null} |
| | | </div> : null} |
| | | {card.subelement.includes('actions') ? |
| | | <ul className="ant-card-actions"> |
| | | <Icon className="edit" title="Edit" type="edit" onClick={this.editAction} /> |
| | | {card.actions.map(item => (<li style={{width: _width}}> |
| | | <span> |
| | | <Icon type={item.icon || 'dash'}/> |
| | | </span> |
| | | </li>))} |
| | | </ul> : null |
| | | } |
| | | </div> |
| | | {/* 显示列编辑 */} |
| | | <Modal |