From 5046d0d13dc6a8563b8e54e31913bc44cfa1072f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 26 四月 2022 19:23:18 +0800 Subject: [PATCH] 2022-04-26 --- src/menu/components/card/data-card/index.jsx | 24 +++++++++--------------- 1 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index 335e3f9..7b10cf3 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -46,7 +46,6 @@ let _card = { uuid: card.uuid, type: card.type, - floor: card.floor, tabId: card.tabId || '', parentId: card.parentId || '', format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 @@ -57,7 +56,7 @@ 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: [], @@ -436,7 +435,7 @@ 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', @@ -494,6 +493,10 @@ delete res.supNodes } else { delete _card.supNodes + } + + if (res.layout === 'flex') { + _card.wrap.pagestyle = 'page' } this.updateComponent(_card) @@ -640,17 +643,6 @@ 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 ( @@ -676,7 +668,9 @@ <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} -- Gitblit v1.8.0