From 5a5e07a0ce81d064038ece372e7e8844157a7d1b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 05 六月 2022 22:59:20 +0800
Subject: [PATCH] 2022-06-05

---
 src/menu/components/card/cardsimplecomponent/index.jsx           |    2 
 src/menu/components/card/cardcellcomponent/dragaction/card.jsx   |   13 ++++++
 src/menu/components/card/cardsimplecomponent/options.jsx         |   14 ++++++
 src/tabviews/custom/components/card/cardcellList/index.jsx       |    4 +-
 src/menu/components/card/cardcellcomponent/dragaction/index.scss |    5 ++
 src/tabviews/custom/index.jsx                                    |   61 ++++++++++++++++++++++++++++++
 src/menu/components/card/data-card/options.jsx                   |    9 ++--
 src/tabviews/custom/components/card/cardcellList/index.scss      |    6 +++
 8 files changed, 105 insertions(+), 9 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
index b5ae599..61b0c90 100644
--- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
+++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
@@ -83,7 +83,18 @@
         <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div>
       )
     } else if (card.eleType === 'icon') {
-      return (<MkIcon type={card.icon}/>)
+      let fontSize = 14
+      let lineHeight = 1.5
+
+      if (card.style.fontSize) {
+        fontSize = parseInt(card.style.fontSize)
+      }
+      if (card.style.lineHeight) {
+        lineHeight = parseFloat(card.style.lineHeight)
+      }
+
+      let innerHeight = fontSize * lineHeight
+      return (<MkIcon style={{height: innerHeight}} className="ant-mk-icon" type={card.icon}/>)
     } else if (card.eleType === 'slider') {
       let val = card.value ? (card.value / card.maxValue) * 100 : 30
       return <MkProgress value={val} config={card}/>
diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.scss b/src/menu/components/card/cardcellcomponent/dragaction/index.scss
index ab11c7e..c7c3f27 100644
--- a/src/menu/components/card/cardcellcomponent/dragaction/index.scss
+++ b/src/menu/components/card/cardcellcomponent/dragaction/index.scss
@@ -1,4 +1,5 @@
 .card-detail-row {
+  line-height: 1.5;
   .ant-mk-text {
     font-style: inherit;
     font-weight: inherit;
@@ -122,6 +123,10 @@
     background-position: center center;
     background-repeat: no-repeat;
   }
+  .ant-mk-icon {
+    vertical-align: top;
+    line-height: inherit;
+  }
   .ant-switch-large {
     min-width: 60px;
     height: 30px;
diff --git a/src/menu/components/card/cardsimplecomponent/index.jsx b/src/menu/components/card/cardsimplecomponent/index.jsx
index 07f6588..eea36ff 100644
--- a/src/menu/components/card/cardsimplecomponent/index.jsx
+++ b/src/menu/components/card/cardsimplecomponent/index.jsx
@@ -151,7 +151,7 @@
           })
         }
       })
-      return getTableSetting(card.setting, cards.columns, buttons)
+      return getTableSetting(card.setting, cards.columns, buttons, cards.action)
     } else {
       return getCarouselSetting(card.setting, cards.subtype === 'propcard')
     }
diff --git a/src/menu/components/card/cardsimplecomponent/options.jsx b/src/menu/components/card/cardsimplecomponent/options.jsx
index 28680d5..f013902 100644
--- a/src/menu/components/card/cardsimplecomponent/options.jsx
+++ b/src/menu/components/card/cardsimplecomponent/options.jsx
@@ -1,7 +1,7 @@
 /**
  * @description tablecard setting琛ㄥ崟閰嶇疆淇℃伅
  */
-export function getTableSetting (setting, columns, buttons = []) {
+export function getTableSetting (setting, columns, buttons = [], action = []) {
   let _columns = columns.map(item => ({value: item.field, label: item.label}))
   _columns.push({value: '$Index', label: '搴忓彿锛堝墠绔級'})
   let appType = sessionStorage.getItem('appType')
@@ -147,6 +147,18 @@
       initval: setting.linkbtn || '',
       required: true,
       options: buttons
+    },
+    {
+      type: 'radio',
+      field: 'swipe',
+      label: '婊戝姩鎸夐挳',
+      initval: setting.swipe || 'true',
+      required: false,
+      options: [
+        {value: 'true', label: '鏄剧ず'},
+        {value: 'false', label: '涓嶆樉绀�'},
+      ],
+      forbid: action.length === 0 || appType !== 'mob'
     }
   ]
 
diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx
index 6db48b9..18c7a2c 100644
--- a/src/menu/components/card/data-card/options.jsx
+++ b/src/menu/components/card/data-card/options.jsx
@@ -171,7 +171,8 @@
         {value: 'false', label: '鏃�'},
         {value: 'init', label: '鍒濆鍖�'},
         {value: 'always', label: '鏁版嵁鍔犺浇'},
-      ]
+      ],
+      forbid: subtype === 'tablecard'
     },
     {
       type: 'select',
@@ -186,8 +187,8 @@
         {value: 'backFont', label: '鑳屾櫙+鏂囧瓧'},
         {value: 'font', label: '鏂囧瓧'},
         ...(subtype === 'datacard' && appType === 'mob' ? [{value: 'check', label: '鍕鹃��'}] : [])
-      ]
-      // forbid: subtype !== 'propcard'
+      ],
+      forbid: subtype === 'tablecard'
     },
     // {
     //   type: 'radio',
@@ -440,7 +441,7 @@
       initval: wrap.slidetip || wrap.slidetip === '' ? wrap.slidetip : '娌℃湁鏇村浜�',
       tooltip: '婊戝姩鍔犺浇鑷冲簳閮ㄦ椂鐨勬彁绀轰俊鎭��',
       required: false,
-      forbid: appType !== 'mob'
+      forbid: appType !== 'mob' || subtype === 'propcard'
     },
     {
       type: 'table',
diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx
index 1d12717..21d6ad7 100644
--- a/src/tabviews/custom/components/card/cardcellList/index.jsx
+++ b/src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -463,8 +463,8 @@
         <Col key={card.uuid} span={card.width}>
           <div style={card.style}>
             {val ? <Tooltip title={val}>
-              <MkIcon type={card.icon}/>
-            </Tooltip> : <MkIcon type={card.icon}/>}
+              <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/>
+            </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/>}
           </div>
         </Col>
       )
diff --git a/src/tabviews/custom/components/card/cardcellList/index.scss b/src/tabviews/custom/components/card/cardcellList/index.scss
index 8aea31b..ba005cc 100644
--- a/src/tabviews/custom/components/card/cardcellList/index.scss
+++ b/src/tabviews/custom/components/card/cardcellList/index.scss
@@ -1,6 +1,8 @@
 
 .card-cell-list {
   position: relative;
+  line-height: 1.5;
+  
   .ant-btn {
     padding: 0;
   }
@@ -162,6 +164,10 @@
   .ant-mk-picture.scale {
     cursor: zoom-in;
   }
+  .ant-mk-icon {
+    vertical-align: top;
+    line-height: inherit;
+  }
   .ant-switch-large {
     min-width: 60px;
     height: 30px;
diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index d8f28c0..e794b18 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -569,6 +569,18 @@
               col.elements = col.elements.map(cell => {
                 if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) {
                   cell.innerHeight = 'auto'
+                } else if (cell.eleType === 'icon') {
+                  let fontSize = 14
+                  let lineHeight = 1.5
+            
+                  if (cell.style.fontSize) {
+                    fontSize = parseInt(cell.style.fontSize)
+                  }
+                  if (cell.style.lineHeight) {
+                    lineHeight = parseFloat(cell.style.lineHeight)
+                  }
+            
+                  cell.innerHeight = fontSize * lineHeight
                 }
                 return cell
               })
@@ -658,6 +670,18 @@
               }
             } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
               cell.innerHeight = 'auto'
+            } else if (cell.eleType === 'icon') {
+              let fontSize = 14
+              let lineHeight = 1.5
+        
+              if (cell.style.fontSize) {
+                fontSize = parseInt(cell.style.fontSize)
+              }
+              if (cell.style.lineHeight) {
+                lineHeight = parseFloat(cell.style.lineHeight)
+              }
+        
+              cell.innerHeight = fontSize * lineHeight
             }
 
             return cell.eleType !== 'button' || skip || permAction[cell.uuid]
@@ -688,7 +712,20 @@
               }
             } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
               cell.innerHeight = 'auto'
+            } else if (cell.eleType === 'icon') {
+              let fontSize = 14
+              let lineHeight = 1.5
+        
+              if (cell.style.fontSize) {
+                fontSize = parseInt(cell.style.fontSize)
+              }
+              if (cell.style.lineHeight) {
+                lineHeight = parseFloat(cell.style.lineHeight)
+              }
+        
+              cell.innerHeight = fontSize * lineHeight
             }
+            
             return cell.eleType !== 'button' || skip || permAction[cell.uuid]
           })
         })
@@ -718,6 +755,18 @@
             }
           } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) {
             cell.innerHeight = 'auto'
+          } else if (cell.eleType === 'icon') {
+            let fontSize = 14
+            let lineHeight = 1.5
+      
+            if (cell.style.fontSize) {
+              fontSize = parseInt(cell.style.fontSize)
+            }
+            if (cell.style.lineHeight) {
+              lineHeight = parseFloat(cell.style.lineHeight)
+            }
+      
+            cell.innerHeight = fontSize * lineHeight
           }
 
           return cell.eleType !== 'button' || skip || permAction[cell.uuid]
@@ -751,6 +800,18 @@
               }
             } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
               cell.innerHeight = 'auto'
+            } else if (cell.eleType === 'icon') {
+              let fontSize = 14
+              let lineHeight = 1.5
+        
+              if (cell.style.fontSize) {
+                fontSize = parseInt(cell.style.fontSize)
+              }
+              if (cell.style.lineHeight) {
+                lineHeight = parseFloat(cell.style.lineHeight)
+              }
+        
+              cell.innerHeight = fontSize * lineHeight
             }
             return cell.eleType !== 'button' || skip || permAction[cell.uuid]
           })

--
Gitblit v1.8.0