From 59db6fab9c1ed1fa5559d423d439e14ea33b1598 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 27 四月 2023 11:18:24 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/views/billprint/index.jsx |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx
index 70a2505..1757a88 100644
--- a/src/views/billprint/index.jsx
+++ b/src/views/billprint/index.jsx
@@ -336,6 +336,11 @@
               return cols.map(item => {
                 if (item.type === 'colspan') {
                   item.subcols = getColumns(item.subcols)
+                } else if (item.type === 'custom') {
+                  item.elements = item.elements.map(cell => {
+                    cell = this.resetElement(cell)
+                    return cell
+                  })
                 } else {
                   item.IsSort = 'false'
                 }
@@ -345,6 +350,41 @@
             }
             component.cols = getColumns(component.cols)
             component.statFields = []
+          } else if (['card', 'carousel', 'timeline'].includes(component.type)) {
+            component.subcards && component.subcards.forEach(card => {
+              if (card.style.boxShadow) {
+                delete card.style.hShadow
+                delete card.style.vShadow
+                delete card.style.shadowBlur
+                delete card.style.shadowColor
+              }
+    
+              card.elements = card.elements.filter(cell => {
+                if (cell.eleType === 'button') return false
+   
+                cell = this.resetElement(cell)
+    
+                return true
+              })
+    
+              if (!card.backElements || card.backElements.length === 0) return
+    
+              card.backElements = card.backElements.filter(cell => {
+                if (cell.eleType === 'button') return false
+   
+                cell = this.resetElement(cell)
+    
+                return true
+              })
+            })
+          } else if (component.type === 'balcony') {
+            component.elements = component.elements.filter(cell => {
+              if (cell.eleType === 'button') return false
+                
+              cell = this.resetElement(cell)
+    
+              return true
+            })
           }
 
           if (component.wrap && component.wrap.datatype === 'static') {
@@ -454,6 +494,23 @@
     })
   }
 
+  resetElement = (cell) => {
+    cell.style = cell.style || {}
+    if (['text', 'number', 'formula'].includes(cell.eleType)) {
+      cell.innerHeight = cell.innerHeight || 'auto'
+      cell.alignItems = cell.height > 1 ? cell.alignItems : ''
+
+      if (cell.eleType === 'number' && typeof(cell.decimal) === 'number') {
+        cell.round = Math.pow(10, cell.decimal)
+        if (cell.format === 'percent') {
+          cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0
+        }
+      }
+    }
+
+    return cell
+  }
+
   reload = () => {
     const { tempId } = this.state
     

--
Gitblit v1.8.0