From 0245e64a9dff794903e546c3bdf9fef7efeefdf1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 06 十二月 2022 16:09:04 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

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 048b71d..19bf7e3 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -6,7 +6,6 @@
 import moment from 'moment'
 
 import Api from '@/api'
-import options from '@/store/options.js'
 import asyncComponent from '@/utils/asyncComponent'
 import Utils, { getEditTableSql, getMark } from '@/utils/utils.js'
 import MkIcon from '@/components/mk-icon'
@@ -388,15 +387,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, '$&,')
@@ -772,15 +773,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, '$&,')
@@ -889,7 +892,7 @@
   static propTpyes = {
     statFValue: PropTypes.any,       // 鍚堣瀛楁鏁版嵁
     MenuID: PropTypes.string,        // 鑿滃崟Id
-    setting: PropTypes.object,       // 琛ㄦ牸鍏ㄥ眬璁剧疆锛歵ableType锛堣〃鏍兼槸鍚﹀彲閫夈�佸崟閫夈�佸閫夛級銆乧olumnfixed锛堝垪鍥哄畾锛夈�乤ctionfixed锛堟寜閽浐瀹氾級
+    setting: PropTypes.object,       // 琛ㄦ牸鍏ㄥ眬璁剧疆锛歵ableType锛堣〃鏍兼槸鍚﹀彲閫夈�佸崟閫夈�佸閫夛級銆乤ctionfixed锛堟寜閽浐瀹氾級
     columns: PropTypes.array,        // 琛ㄦ牸鍒�
     lineMarks: PropTypes.any,        // 琛屾爣璁�
     fields: PropTypes.array,         // 缁勪欢瀛楁闆�
@@ -934,6 +937,10 @@
 
       if (item.type === 'text' && item.editable === 'true' && item.editType === 'select' && item.resourceType === '1') {
         let _option = Utils.getSelectQueryOptions(item)
+
+        if (window.GLOB.debugger === true || window.debugger === true) {
+          console.info(_option.sql)
+        }
 
         item.base_sql = window.btoa(window.encodeURIComponent(_option.sql))
         item.arr_field = _option.field
@@ -1104,11 +1111,6 @@
         localItems.push(`select '${item.uuid}' as obj_name,'${item.arr_field}' as arr_field,'${item.base_sql}' as LText`)
       }
     })
-    
-    if (options.sysType !== 'local') {
-      localItems = [...localItems, ...mainItems]
-      mainItems = []
-    }
 
     // 鏈湴璇锋眰
     let param = {

--
Gitblit v1.8.0