From 25fbc16aa14667064ac5de854183b09e01105f2c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 30 三月 2022 15:44:05 +0800
Subject: [PATCH] 2022-03-30

---
 src/tabviews/custom/components/card/prop-card/index.scss |    8 ++++++++
 src/tabviews/custom/components/card/prop-card/index.jsx  |    3 ++-
 src/menu/components/card/data-card/options.jsx           |   16 ++++++++++++++++
 src/menu/components/card/prop-card/index.jsx             |    8 +++++++-
 src/menu/components/card/prop-card/index.scss            |    8 ++++++++
 src/tabviews/custom/components/card/data-card/index.scss |    8 ++++++++
 src/tabviews/custom/components/card/data-card/index.jsx  |    3 ++-
 src/menu/components/card/data-card/index.jsx             |    4 ++++
 8 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx
index de13b31..6634d0d 100644
--- a/src/menu/components/card/data-card/index.jsx
+++ b/src/menu/components/card/data-card/index.jsx
@@ -495,6 +495,10 @@
       delete _card.supNodes
     }
 
+    if (res.layout === 'flex') {
+      _card.wrap.pagestyle = 'page'
+    }
+
     this.updateComponent(_card)
   }
 
diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx
index 67d8f47..ab2ea6d 100644
--- a/src/menu/components/card/data-card/options.jsx
+++ b/src/menu/components/card/data-card/options.jsx
@@ -77,6 +77,22 @@
     },
     {
       type: 'radio',
+      field: 'layout',
+      label: '鍗$墖甯冨眬',
+      initval: wrap.layout || 'grid',
+      tooltip: appType === 'mob' ? '寮规�у竷灞�鏃讹紝婊戝姩鍔犺浇鏃犳晥' : '寮规�у竷灞�鏃讹紝宸﹀彸鍒囨崲鏃犳晥',
+      required: false,
+      options: [
+        {value: 'grid', label: '鏍呮牸甯冨眬'},
+        {value: 'flex', label: '寮规�у竷灞�'},
+      ],
+      controlFields: [
+        {field: 'cardFloat', values: ['grid']},
+      ],
+      forbid: subtype === 'tablecard'
+    },
+    {
+      type: 'radio',
       field: 'pagestyle',
       label: '鍒嗛〉椋庢牸',
       initval: wrap.pagestyle || 'page',
diff --git a/src/menu/components/card/prop-card/index.jsx b/src/menu/components/card/prop-card/index.jsx
index 175074d..052e076 100644
--- a/src/menu/components/card/prop-card/index.jsx
+++ b/src/menu/components/card/prop-card/index.jsx
@@ -450,6 +450,10 @@
     if (res.supModule && res.supModule.length > 0) {
       _card.setting.supModule = res.supModule
     }
+    if (res.layout === 'flex') {
+      _card.wrap.pagestyle = 'page'
+    }
+
     this.updateComponent(_card)
   }
 
@@ -499,7 +503,9 @@
         } trigger="hover">
           <ToolOutlined />
         </Popover>
-        {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={(card.wrap.layout || 'grid') + '-layout'}>
+          {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>
       </div>
     )
   }
diff --git a/src/menu/components/card/prop-card/index.scss b/src/menu/components/card/prop-card/index.scss
index 827cf17..025f29a 100644
--- a/src/menu/components/card/prop-card/index.scss
+++ b/src/menu/components/card/prop-card/index.scss
@@ -71,6 +71,14 @@
       margin-right: 10px;
     }
   }
+  .flex-layout {
+    display: flex;
+    width: 100%;
+    >.ant-col {
+      width: 5%;
+      flex: 1;
+    }
+  }
 }
 .menu-prop-card-edit-box::after {
   display: block;
diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index c13c422..1e248d6 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -168,6 +168,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.wrapClass =  `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale}`
 
@@ -772,7 +773,7 @@
         }
         <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">
+          <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}>
diff --git a/src/tabviews/custom/components/card/data-card/index.scss b/src/tabviews/custom/components/card/data-card/index.scss
index 3cfc493..5e80317 100644
--- a/src/tabviews/custom/components/card/data-card/index.scss
+++ b/src/tabviews/custom/components/card/data-card/index.scss
@@ -46,6 +46,14 @@
       cursor: pointer;
     }
   }
+  .card-row-list.flex-layout {
+    display: flex;
+    width: 100%;
+    >.ant-col {
+      width: 5%;
+      flex: 1;
+    }
+  }
   .card-item-box {
     position: relative;
     background-color: #ffffff;
diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx
index 0659fb4..5a8912e 100644
--- a/src/tabviews/custom/components/card/prop-card/index.jsx
+++ b/src/tabviews/custom/components/card/prop-card/index.jsx
@@ -113,6 +113,7 @@
     _config.wrap.selStyle = _config.wrap.selStyle || 'active'
     _config.wrap.priKeyType = _config.wrap.priKeyType || 'static'
     _config.wrap.scale = _config.wrap.scale === 'true' ? 'scale' : ''
+    _config.wrap.layout = (_config.wrap.layout || 'grid') + '-layout'
 
     _config.wrap.wrapClass =  `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale || ''}`
 
@@ -418,7 +419,7 @@
           </div> : null
         }
         <NormalHeader config={config}/>
-        <Row className={`card-row-list data-zoom ${config.wrap.wrapClass}`}>
+        <Row className={`card-row-list data-zoom ${config.wrap.wrapClass} ${config.wrap.layout}`}>
           {config.subcards.map((item, index) => {
             let className = item.setting.click ? 'mk-card pointer ' : 'mk-card '
             if (activeKey === index) {
diff --git a/src/tabviews/custom/components/card/prop-card/index.scss b/src/tabviews/custom/components/card/prop-card/index.scss
index 7d7e25b..03534dc 100644
--- a/src/tabviews/custom/components/card/prop-card/index.scss
+++ b/src/tabviews/custom/components/card/prop-card/index.scss
@@ -17,6 +17,14 @@
       cursor: pointer;
     }
   }
+  .card-row-list.flex-layout {
+    display: flex;
+    width: 100%;
+    >.ant-col {
+      width: 5%;
+      flex: 1;
+    }
+  }
   .card-row-list.scale {
     .mk-card:hover {
       >.card-item-box {

--
Gitblit v1.8.0