From 4677982c003e357cff8f2544be44706bf31ea6de Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 05 五月 2022 19:12:19 +0800
Subject: [PATCH] 2022-05-05

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

diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index 6ff2056..a646dcb 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -175,6 +175,8 @@
         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)
@@ -222,7 +224,12 @@
       let photos = ''
       if (record[col.field]) {
         photos = `${record[col.field]}`
-        photos = photos.split(',')
+      }
+
+      if (/^data:image/.test(photos)) {
+        photos = [photos]
+      } else {
+        photos = photos.split(',').filter(Boolean)
       }
 
       let cols = 24 / (col.picSort || 1)
@@ -380,7 +387,6 @@
     lineMarks: PropTypes.array,      // 琛屾爣璁�
     fields: PropTypes.array,         // 缁勪欢瀛楁闆�
     ContainerId: PropTypes.any,      // 鏍囩椤靛灞侷d
-    BData: PropTypes.any,            // 涓昏〃鏁版嵁
     data: PropTypes.any,             // 琛ㄦ牸鏁版嵁
     total: PropTypes.any,            // 鎬绘暟
     loading: PropTypes.bool,         // 琛ㄦ牸鍔犺浇涓�
@@ -526,18 +532,27 @@
     MKEmitter.removeListener('resetTable', this.resetTable)
   }
 
-  mkCheckTopLine = (menuId) => {
+  mkCheckTopLine = (menuId, id) => {
     const { MenuID, data, setting } = this.props
 
     if (MenuID !== menuId || !data || data.length === 0) return
-    if (data[0].$disabled) return
 
-    this.changedata(0)
-    this.setState({ selectedRowKeys: [0], activeIndex: 0 })
-    this.props.chgSelectData([data[0]])
+    let index = 0
+    if (id) {
+      index = data.findIndex(item => item.$$uuid === id)
+      if (index === -1) {
+        index = 0
+      }
+    }
+
+    if (data[index].$disabled) return
+
+    this.changedata(index)
+    this.setState({ selectedRowKeys: [index], activeIndex: index })
+    this.props.chgSelectData([data[index]])
 
     if (setting.$hasSyncModule) {
-      MKEmitter.emit('syncBalconyData', MenuID, [data[0]], data.length === 1)
+      MKEmitter.emit('syncBalconyData', MenuID, [data[index]], data.length === 1)
     }
   }
 
@@ -720,13 +735,13 @@
   }
 
   changedata = (index) => {
-    const { MenuID, data, setting } = this.props
+    const { MenuID, data } = this.props
 
     let _id = ''
     let _data = ''
 
     if (data && data.length > 0 && index !== '') {
-      _id = data[index][setting.primaryKey] || ''
+      _id = data[index].$$uuid || ''
       _data = data[index] || ''
     }
 

--
Gitblit v1.8.0