king
2022-04-26 5046d0d13dc6a8563b8e54e31913bc44cfa1072f
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}