From dbc911dbb044895f98a49ef69ef5a5800a4aba3e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 15 九月 2024 20:26:39 +0800
Subject: [PATCH] 2024-09-15

---
 src/tabviews/custom/components/card/cardcellList/index.jsx            |    3 +++
 src/tabviews/custom/components/share/normalTable/index.jsx            |    3 +++
 src/utils/utils-custom.js                                             |   14 +++-----------
 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx |    3 +++
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx
index f585b93..aaf053d 100644
--- a/src/tabviews/custom/components/card/cardcellList/index.jsx
+++ b/src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -554,6 +554,9 @@
           }
           if (card.format === 'percent') {
             val = val * 100
+            if (!card.round) {
+              val = +val.toFixed(2)
+            }
           } else if (card.format === 'abs') {
             val = Math.abs(val)
           }
diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index b5b0dbb..b01e03d 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -236,6 +236,9 @@
         }
         if (col.format === 'percent') {
           content = content * 100
+          if (!col.round) {
+            content = +content.toFixed(2)
+          }
         } else if (col.format === 'abs') {
           content = Math.abs(content)
         }
diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
index 5108d1c..6e3aeef 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -877,6 +877,9 @@
         }
         if (col.format === 'percent') {
           content = content * 100
+          if (!col.round) {
+            content = +content.toFixed(2)
+          }
         } else if (col.format === 'abs') {
           content = Math.abs(content)
         }
diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index 0ab2b6b..156e414 100644
--- a/src/utils/utils-custom.js
+++ b/src/utils/utils-custom.js
@@ -3455,7 +3455,7 @@
             type: item.type,
             isconst: item.constant === 'true'
           }
-    
+
           if (_item.type === 'datemonth') {
             _item.type = 'text'
           } else if (_item.type === 'number' || _item.type === 'rate') {
@@ -3832,11 +3832,7 @@
         let _key = item.key.toLowerCase()
   
         keys.push(_key)
-        if (item.type === 'number' || item.type === 'rate') {
-          values.push('@mk_' + _key + '_mk@')
-        } else {
-          values.push(`'@mk_${_key}_mk@'`)
-        }
+        values.push('@' + _key)
       })
   
       if (!keys.includes(primaryKey.toLowerCase())) {
@@ -3880,11 +3876,7 @@
         let _key = item.key.toLowerCase()
         
         _arr.push(_key)
-        if (item.type === 'number' || item.type === 'rate') {
-          _form.push(`${_key}=@mk_${_key}_mk@`)
-        } else {
-          _form.push(`${_key}='@mk_${_key}_mk@'`)
-        }
+        _form.push(_key + '=@' + _key)
       })
   
       if (_actionType === 'audit') {

--
Gitblit v1.8.0