From bdfec44c9f3a37dbbe05bf14a252ffec04132a86 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 06 九月 2022 21:24:28 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/tabviews/custom/components/share/normalTable/index.jsx |   62 +++++++++++++-----------------
 1 files changed, 27 insertions(+), 35 deletions(-)

diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index 99f8396..317b96d 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -10,6 +10,7 @@
 import MKEmitter from '@/utils/events.js'
 import zhCN from '@/locales/zh-CN/main.js'
 import enUS from '@/locales/en-US/main.js'
+import Encrypts from '@/components/encrypts'
 import '@/assets/css/table.scss'
 import './index.scss'
 
@@ -122,9 +123,13 @@
           content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}`
         } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) {
           content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}`
+        } else if (col.textFormat === 'encryption') {
+          content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span>
         }
-  
-        content = (col.prefix || '') + content + (col.postfix || '')
+
+        if (col.textFormat !== 'encryption') {
+          content = (col.prefix || '') + content + (col.postfix || '')
+        }
       }
 
       if (col.marks) {
@@ -172,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, '$&,')
@@ -235,7 +242,6 @@
         photos = photos.split(',').filter(Boolean)
       }
 
-      let cols = 24 / (col.picSort || 1)
       let paddingTop = '100%'
       let scale = col.scale === 'true'
 
@@ -245,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)
@@ -627,35 +633,21 @@
     } else if (item.linkurl) {
       let src = item.linkurl
 
-      if (src.indexOf('paramsmain/') > -1) {
-        try {
-          let _url = item.linkurl.split('paramsmain/')[0] + 'paramsmain/'
-          let _param = JSON.parse(window.decodeURIComponent(window.atob(item.linkurl.split('paramsmain/')[1])))
-          _param.UserID = sessionStorage.getItem('UserID')
-          _param.LoginUID = sessionStorage.getItem('LoginUID')
-          _param.User_Name = sessionStorage.getItem('User_Name')
-          _param.param = __param
-          src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))
-        } catch (e) {
-          console.warn('鑿滃崟鍙傛暟瑙f瀽閿欒锛�')
-        }
-      } else {
-        let con = '?'
+      let con = '?'
 
-        if (/\?/ig.test(src)) {
-          con = '&'
-        }
-
-        if (item.linkfields && item.linkfields.length > 0) {
-          item.linkfields.forEach(field => {
-            if (field.toLowerCase() === 'id') return
-            con += `${field}=${record[field] || ''}&`
-          })
-        }
-        
-        src = src + `${con}id=${record.$$uuid}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}`
+      if (/\?/ig.test(src)) {
+        con = '&'
       }
 
+      if (item.linkfields && item.linkfields.length > 0) {
+        item.linkfields.forEach(field => {
+          if (field.toLowerCase() === 'id') return
+          con += `${field}=${record[field] || ''}&`
+        })
+      }
+      
+      src = src + `${con}id=${record.$$uuid}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}`
+
       window.open(src)
     }
   }

--
Gitblit v1.8.0