From b8e1395f02c929eaa96b949cf6027ee2a43856a6 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 06 九月 2022 19:03:37 +0800
Subject: [PATCH] 2022-09-06

---
 src/tabviews/custom/components/share/normalTable/index.jsx |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index 4c99a8d..317b96d 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -177,15 +177,17 @@
       }
 
       if (content !== '') {
-        let decimal = col.decimal || 0
+        if (col.round) {
+          content = Math.round(content * col.round) / col.round
+        }
         if (col.format === 'percent') {
           content = content * 100
-          decimal = decimal > 2 ? decimal - 2 : 0
         } else if (col.format === 'abs') {
           content = Math.abs(content)
         }
-  
-        content = content.toFixed(decimal)
+        if (col.round) {
+          content = content.toFixed(col.decimal)
+        }
   
         if (col.format === 'thdSeparator') {
           content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
@@ -240,7 +242,6 @@
         photos = photos.split(',').filter(Boolean)
       }
 
-      let cols = 24 / (col.picSort || 1)
       let paddingTop = '100%'
       let scale = col.scale === 'true'
 
@@ -250,8 +251,8 @@
 
       resProps.children = (
         <div>
-          {photos && photos.map((url, i) => (
-            <Col key={i} span={cols}>
+          {photos.map((url, i) => (
+            <Col key={i} span={col.span || 24}>
               <div className={'ant-mk-picture' + (scale ? ' scale' : '')} onClick={() => {
                 if (!scale) return
                 MKEmitter.emit('mkImageScale', url, photos)

--
Gitblit v1.8.0