From 28d65cf7ebfe0dd30ade6973e0634e1c8f663b63 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 28 十月 2020 16:12:20 +0800
Subject: [PATCH] 2020-10-28

---
 src/tabviews/zshare/cardcomponent/index.jsx |   85 +++++++++---------------------------------
 1 files changed, 18 insertions(+), 67 deletions(-)

diff --git a/src/tabviews/zshare/cardcomponent/index.jsx b/src/tabviews/zshare/cardcomponent/index.jsx
index 229ce3c..a5ca725 100644
--- a/src/tabviews/zshare/cardcomponent/index.jsx
+++ b/src/tabviews/zshare/cardcomponent/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Icon, Card, Spin, Empty, Tabs } from 'antd'
+import { Icon, Card, Spin, Empty } from 'antd'
 
 import asyncComponent from '@/utils/asyncComponent'
 import asyncExcelComponent from './asyncButtonComponent'
@@ -16,8 +16,6 @@
 const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton'))
 const ChangeUserButton = asyncComponent(() => import('@/tabviews/zshare/actionList/changeuserbutton'))
 const PrintButton = asyncComponent(() => import('@/tabviews/zshare/actionList/printbutton'))
-
-const { TabPane } = Tabs
 
 class CardCell extends Component {
   static propTpyes = {
@@ -458,7 +456,7 @@
     }
 
     return (
-      <div className={'chart-card-box ' + card.outclass} style={card.outstyle || null} >
+      <div className={'chart-card-box ' + card.outclass}>
         {type !== 'insert' ? <Card
           size="small"
           className={'chart-card ' + (selectKey === data.key ? 'chart-card-selected' : '')}
@@ -564,6 +562,13 @@
       }
     })
 
+    if (plot.widthType === 'absolute') {
+      plot.cardWidth = 6
+    }
+    if (plot.avatar && plot.avatar.widthType === 'absolute') {
+      card.avatar.width = 32
+    }
+
     actions.forEach(item => {
       if ((item.Ot && item.Ot !== 'notRequired' && !['excelIn', 'excelOut'].includes(item.OpenType)) || item.funcType === 'changeuser') {
         actionMap.set(item.uuid, item)
@@ -617,13 +622,9 @@
       } else if (card.avatar.type === 'picture' && colMap.get(plot.avatar.field)) {
         card.avatar.field = plot.avatar.field
         card.avatar.width = plot.avatar.width
-        card.avatar.widthType = plot.avatar.widthType
         card.avatar.radius = plot.avatar.radius !== 'false'
 
-        let _width = card.avatar.width
-        if (plot.avatar.widthType === 'ratio') {
-          _width = _width + '%'
-        }
+        let _width = card.avatar.width + '%'
 
         card.avatar.class = {width: _width, paddingTop: _width}
       }
@@ -681,18 +682,8 @@
       }
     }
 
-    let outclass = ''
-
-    if (plot.widthType === 'ratio' && plot.over !== 'roll') {
-      outclass += ' ant-col ant-col-' + plot.cardWidth
-    }
-
-    card.outclass = outclass
+    card.outclass = ' ant-col ant-col-' + plot.cardWidth
     card.bordered = plot.border !== 'hidden'
-    
-    if (plot.widthType === 'absolute') {
-      card.outstyle = { width: plot.cardWidth }
-    }
 
     if (plot.bgfield && colMap.get(plot.bgfield)) {
       let col = fromJS(colMap.get(plot.bgfield)).toJS()
@@ -733,17 +724,13 @@
       let _flex = false
       let _cardWidth = 300
 
-      if (plot.widthType === 'absolute') {
-        _cardWidth = plot.cardWidth
-      } else {
-        let _outWidth = document.body.offsetWidth - 260
-        if (this.cardRef.offsetWidth) {
-          _outWidth = this.cardRef.offsetWidth
-        }
-        _cardWidth = Math.floor(_outWidth * plot.cardWidth / 24 - 20)
+      let _outWidth = document.body.offsetWidth - 260
+      if (this.cardRef.offsetWidth) {
+        _outWidth = this.cardRef.offsetWidth
       }
+      _cardWidth = Math.floor(_outWidth * plot.cardWidth / 24 - 20)
 
-      if (card.avatar.widthType === 'ratio' && card.avatar.display !== 'block') {
+      if (card.avatar.display !== 'block') {
         if (card.avatar.width < 90) {
           _flex = true
         }
@@ -816,7 +803,7 @@
           </div>
           <div style={{clear: 'both'}}></div>
         </div>
-        {plot.over !== 'roll' && data && data.length > 0 &&
+        {data && data.length > 0 &&
           data.map((item, i) => (
             <CardCell
               key={i}
@@ -836,7 +823,7 @@
             />
           ))
         }
-        {!loading && card.insertAction && plot.over !== 'roll' ?
+        {!loading && card.insertAction ?
           <CardCell
             key="insert"
             type="insert"
@@ -851,42 +838,6 @@
             switchCard={() => {}}
             refreshdata={this.props.refreshdata}
           /> : null
-        }
-        {plot.over === 'roll' && data && data.length > 0 ?
-          <Tabs activeKey="">
-            {data.map((item, i) => (
-              <TabPane tab={<CardCell
-                BID={BID}
-                Tab={Tab}
-                card={card}
-                data={item}
-                BData={BData}
-                MenuID={MenuID}
-                colMap={colMap}
-                selectKey={selectKey}
-                logcolumns={logcolumns}
-                setting={config.setting}
-                ContainerId={ContainerId}
-                switchCard={this.switchCard}
-                refreshdata={this.props.refreshdata}
-              />} key={i}></TabPane>
-            ))}
-            {!loading && card.insertAction ?
-              <TabPane tab={<CardCell
-                type="insert"
-                BID={BID}
-                Tab={Tab}
-                card={card}
-                data={{key: 'insert'}}
-                BData={BData}
-                MenuID={MenuID}
-                setting={config.setting}
-                ContainerId={ContainerId}
-                switchCard={() => {}}
-                refreshdata={this.props.refreshdata}
-              />} key="insert"></TabPane> : null
-            }
-          </Tabs> : null
         }
         {(loading || !card.insertAction) && (!data || data.length === 0) ? <Empty description={false}/> : null}
         <div className="clear"></div>

--
Gitblit v1.8.0