From 526d2be8959e6e99c1afd31cf213f0f1e7a56a8b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 26 四月 2022 15:43:58 +0800
Subject: [PATCH] 2022-04-26

---
 src/tabviews/custom/components/card/data-card/index.jsx |   28 +---------------------------
 1 files changed, 1 insertions(+), 27 deletions(-)

diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index 3176642..3b9a2bc 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -98,20 +98,6 @@
       _sync = false
     }
 
-    if (_config.wrap.cardFloat && _config.wrap.cardFloat !== 'left') {
-      let _width = 0
-      precards.forEach(card => {
-        _width += card.setting.width
-      })
-      nextcards.forEach(card => {
-        _width += card.setting.width
-      })
-      
-      _config.$offset = _width
-    } else {
-      _config.wrap.cardFloat = null
-    }
-
     let selected = 'false'
     if (_config.wrap.selected === 'always' || _config.wrap.selected === 'init') {
       selected = _config.wrap.selected
@@ -170,7 +156,7 @@
 
     _config.wrap.selStyle = _config.wrap.selStyle || 'active'
     _config.wrap.scale = _config.wrap.scale === 'true' ? 'scale' : ''
-    _config.wrap.layout = (_config.wrap.layout || 'grid') + '-layout'
+    _config.wrap.layout = (_config.wrap.layout || 'grid') + '-layout float-' + (_config.wrap.cardFloat || 'left')
 
     _config.wrap.wrapClass =  `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale}`
 
@@ -750,17 +736,6 @@
       _total = config.setting.pageSize * pageIndex
       switchable = true
     }
-    let offset = 0
-
-    if (config.wrap.cardFloat) {
-      let length = data ? data.length : 0
-      if (card.setting.width * length + config.$offset < 24) {
-        offset = 24 - card.setting.width * length - config.$offset
-        if (config.wrap.cardFloat === 'center') {
-          offset = Math.floor(offset / 2)
-        }
-      }
-    }
 
     let extendData = {$$BID: BID, $$BData: BData, $$selectedData: selectedData, $$type: 'extendCard'}
 
@@ -790,7 +765,6 @@
         <div className={`data-zoom ${config.wrap.wrapClass}`}>
           {switchable ? <div className={'prev-page ' + (pageIndex === 1 ? 'disabled' : '')} onClick={this.prevPage}><div><div><img src={preImg} alt=""/></div></div></div> : null}
           <Row className={'card-row-list ' + config.wrap.layout}>
-            {offset ? <Col span={offset} style={{height: '10px'}}> </Col> : null}
             {precards.map((item, index) => (
               <Col key={'pre' + index} className="extend-card" span={item.setting.width || 6}>
                 <CardItem card={item} cards={config} data={extendData}/>

--
Gitblit v1.8.0