From d7ec8fbd65cd7225ce8d405a0ee0a1f166f44d7b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 16 九月 2021 17:23:54 +0800
Subject: [PATCH] 2021-09-16

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

diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index 9cabfa1..a1bb8fc 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -51,7 +51,7 @@
           try {
             originVal = parseFloat(originVal)
             contrastVal = parseFloat(contrastVal)
-          } catch {
+          } catch (e) {
             originVal = NaN
           }
   
@@ -62,7 +62,7 @@
           try {
             originVal = parseFloat(originVal)
             contrastVal = parseFloat(contrastVal)
-          } catch {
+          } catch (e) {
             originVal = NaN
           }
   
@@ -120,7 +120,7 @@
         try {
           originVal = parseFloat(originVal)
           contrastVal = parseFloat(contrastVal)
-        } catch {
+        } catch (e) {
           originVal = NaN
         }
 
@@ -131,7 +131,7 @@
         try {
           originVal = parseFloat(originVal)
           contrastVal = parseFloat(contrastVal)
-        } catch {
+        } catch (e) {
           originVal = NaN
         }
 
@@ -223,7 +223,7 @@
         if (isNaN(content)) {
           content = ''
         }
-      } catch {
+      } catch (e) {
         content = ''
       }
 
@@ -332,7 +332,7 @@
         
         try {
           _param = window.btoa(_quary)
-        } catch {
+        } catch (e) {
           _param = window.btoa(window.encodeURIComponent(_quary))
         }
         
@@ -500,6 +500,7 @@
   }
 
   componentDidMount () {
+    MKEmitter.addListener('mkCheckTopLine', this.mkCheckTopLine)
     MKEmitter.addListener('mkCheckAll', this.mkCheckAll)
     MKEmitter.addListener('resetTable', this.resetTable)
   }
@@ -511,8 +512,23 @@
     this.setState = () => {
       return
     }
+    MKEmitter.removeListener('mkCheckTopLine', this.mkCheckTopLine)
     MKEmitter.removeListener('mkCheckAll', this.mkCheckAll)
     MKEmitter.removeListener('resetTable', this.resetTable)
+  }
+
+  mkCheckTopLine = (menuId) => {
+    const { MenuID, data, setting } = this.props
+
+    if (MenuID !== menuId || !data || data.length === 0) return
+
+    this.changedata(0)
+    this.setState({ selectedRowKeys: [0], activeIndex: 0 })
+    this.props.chgSelectData([data[0]])
+
+    if (setting.$hasSyncModule) {
+      MKEmitter.emit('syncBalconyData', MenuID, [data[0]], data.length === 1)
+    }
   }
 
   mkCheckAll = (menuId, checked) => {
@@ -594,7 +610,7 @@
           _param.User_Name = sessionStorage.getItem('User_Name')
           _param.param = __param
           src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))
-        } catch {
+        } catch (e) {
           console.warn('鑿滃崟鍙傛暟瑙f瀽閿欒锛�')
         }
       } else {
@@ -853,8 +869,10 @@
       _footer = statFValue.map(f => `${f.label}(鍚堣)锛�${f.value}`).join('锛�')
     }
 
+    let height = setting.height || false
+
     return (
-      <div className={`normal-custom-table ${setting.tableHeader || ''} ${setting.mode || ''}`} id={tableId}>
+      <div className={`normal-custom-table ${setting.tableHeader || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''}`} id={tableId}>
         {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && data && data.length > 0 ?
           <Switch title="鏀惰捣" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" checked={pickup} onChange={this.pickupChange} /> : null
         }
@@ -867,7 +885,7 @@
           columns={this.state.columns}
           dataSource={_data}
           loading={this.props.loading}
-          scroll={{ x: '100%', y: false }}
+          scroll={{ x: '100%', y: height }}
           onRow={(record, index) => {
             return {
               lineMarks,

--
Gitblit v1.8.0