From 53b9fb93d0376eb02bb996935f1720b4e95cd897 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 12 十月 2022 14:41:06 +0800
Subject: [PATCH] 2022-10-12

---
 src/tabviews/custom/components/share/normalTable/index.jsx |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index 4c99a8d..0e98c31 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -16,6 +16,7 @@
 
 const { Paragraph } = Typography
 const CardCellComponent = asyncComponent(() => import('@/tabviews/custom/components/card/cardcellList'))
+const MkPicture = asyncComponent(() => import('@/components/mkPicture'))
 const PicRadio = {
   '4:3': '75%', '3:2': '66.67%', '16:9': '56.25%', '2:1': '50%', '3:1': '33.33%', '4:1': '25%',
   '5:1': '20%', '6:1': '16.67%', '7:1': '14.29%', '8:1': '12.5%', '9:1': '11.11%',
@@ -177,15 +178,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 +243,6 @@
         photos = photos.split(',').filter(Boolean)
       }
 
-      let cols = 24 / (col.picSort || 1)
       let paddingTop = '100%'
       let scale = col.scale === 'true'
 
@@ -250,12 +252,9 @@
 
       resProps.children = (
         <div>
-          {photos && photos.map((url, i) => (
-            <Col key={i} span={cols}>
-              <div className={'ant-mk-picture' + (scale ? ' scale' : '')} onClick={() => {
-                if (!scale) return
-                MKEmitter.emit('mkImageScale', url, photos)
-              }} style={{paddingTop, backgroundImage: `url('${url}')`}}></div>
+          {photos.map((url, i) => (
+            <Col key={i} span={col.span || 24}>
+              <MkPicture style={{paddingTop}} scale={scale} url={url} urls={photos}/>
             </Col>
           ))}
         </div>

--
Gitblit v1.8.0