| | |
| | | let _card = { |
| | | uuid: card.uuid, |
| | | type: card.type, |
| | | floor: card.floor, |
| | | tabId: card.tabId || '', |
| | | parentId: card.parentId || '', |
| | | format: 'array', // 组件属性 - 数据格式 |
| | |
| | | name: card.name, |
| | | subtype: card.subtype, |
| | | setting: { interType: 'system' }, |
| | | wrap: { name: card.name, width: card.width || 24, title: '', pagestyle: 'page', switch: 'false', cardType: '' }, |
| | | wrap: { name: card.name, width: card.width || 24, title: '', pagestyle: 'page', cardType: '' }, |
| | | style: { marginLeft: '0px', marginRight: '0px', marginTop: '8px', marginBottom: '8px' }, |
| | | headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' }, |
| | | columns: [], |
| | |
| | | newcard = { |
| | | uuid: Utils.getuuid(), |
| | | $cardType: 'extendCard', |
| | | setting: { width: 6, type: 'simple', click: 'button'}, |
| | | setting: { width: 6, type: 'simple', click: ''}, |
| | | style: { |
| | | height, |
| | | borderWidth: '1px', borderColor: '#e8e8e8', |
| | |
| | | delete res.supNodes |
| | | } else { |
| | | delete _card.supNodes |
| | | } |
| | | |
| | | if (res.layout === 'flex') { |
| | | _card.wrap.pagestyle = 'page' |
| | | } |
| | | |
| | | this.updateComponent(_card) |
| | |
| | | render() { |
| | | const { card, appType } = this.state |
| | | |
| | | let offset = 0 |
| | | if (card.wrap.cardFloat && card.wrap.cardFloat !== 'left') { |
| | | let _width = 0 |
| | | card.subcards.forEach(card => { |
| | | _width += card.setting.width |
| | | }) |
| | | offset = _width < 24 ? 24 - _width : 0 |
| | | if (card.wrap.cardFloat === 'center') { |
| | | offset = Math.floor(offset / 2) |
| | | } |
| | | } |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | |
| | | <ToolOutlined /> |
| | | </Popover> |
| | | <ActionComponent config={card} type="datacard" setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | {card.subcards.map((subcard, index) => (<CardComponent key={subcard.uuid} offset={!index ? offset : 0} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} |
| | | <div className={'float-' + (card.wrap.cardFloat || 'left')}> |
| | | {card.subcards.map((subcard, index) => (<CardComponent key={subcard.uuid} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} |
| | | </div> |
| | | <div style={{clear: 'both'}}></div> |
| | | {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType !== 'mob' ? <Pagination total={85} size="small" showTotal={total => `共 ${total} 条`} pageSize={20} defaultCurrent={1}/> : null} |
| | | {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType === 'mob' ? <MobPagination /> : null} |