From cb4c8706eb48183ac8875d92d4a950ad6b6675a2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 18 三月 2020 11:01:11 +0800
Subject: [PATCH] 2020-03-18

---
 src/tabviews/tableshare/normalTable/index.jsx |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/tabviews/commontable/mainTable/index.jsx b/src/tabviews/tableshare/normalTable/index.jsx
similarity index 95%
rename from src/tabviews/commontable/mainTable/index.jsx
rename to src/tabviews/tableshare/normalTable/index.jsx
index 0d7425b..ec02ca6 100644
--- a/src/tabviews/commontable/mainTable/index.jsx
+++ b/src/tabviews/tableshare/normalTable/index.jsx
@@ -1,6 +1,5 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-// import { is, fromJS } from 'immutable'
 import { Table, message, Affix, Button, Typography } from 'antd'
 import './index.scss'
 
@@ -8,6 +7,7 @@
 
 export default class MainTable extends Component {
   static propTpyes = {
+    tableId: PropTypes.string,     // 鍒楄〃Id
     dict: PropTypes.object,        // 瀛楀吀椤�
     MenuID: PropTypes.string,      // 鑿滃崟Id
     setting: PropTypes.object,     // 琛ㄦ牸鍏ㄥ眬璁剧疆锛歵ableType锛堣〃鏍兼槸鍚﹀彲閫夈�佸崟閫夈�佸閫夛級銆乧olumnfixed锛堝垪鍥哄畾锛夈�乤ctionfixed锛堟寜閽浐瀹氾級
@@ -289,6 +289,9 @@
 
   changedata = (index) => {
     const { data, setting } = this.props
+
+    if (!this.props.tableId) return
+
     let _id = ''
     let _data = ''
 
@@ -297,7 +300,7 @@
       _data = data[index] || ''
     }
 
-    this.props.handleTableId('mainTable', _id, _data)
+    this.props.handleTableId(this.props.tableId, _id, _data)
   }
 
   resetTable = () => {
@@ -311,6 +314,7 @@
     const { setting, pickup } = this.props
     let { selectedRowKeys } = this.state
 
+    // 璁剧疆琛ㄦ牸閫夋嫨灞炴�э細鍗曢�夈�佸閫夈�佷笉鍙��
     let rowSelection = null
     if (setting.tableType) {
       rowSelection = {
@@ -319,9 +323,10 @@
         onChange: this.onSelectChange
       }
     }
+
+    // 琛ㄦ牸澶撮儴鍥哄畾浜庨《閮ㄦ椂锛屽垽鏂窛椤堕儴楂樺害
     let offset = null
-    if (setting.columnfixed) {
-      // 琛ㄦ牸澶撮儴鍥哄畾浜庨《閮ㄦ椂锛屽垽鏂窛椤堕儴楂樺害
+    if (this.props.tableId === 'mainTable' && setting.columnfixed) {
       if (!setting.actionfixed) {
         offset = 48
       } else {
@@ -334,6 +339,7 @@
       }
     }
 
+    // 鏁版嵁鏀惰捣鏃讹紝杩囨护宸查�夋暟鎹�
     let _data = this.props.data ? this.props.data : []
 
     if (pickup) {
@@ -341,8 +347,8 @@
     }
 
     return (
-      <div className="main-table">
-        {setting.columnfixed && <Affix offsetTop={offset} className="fix-header">
+      <div className="normal-data-table">
+        {offset && <Affix offsetTop={offset} className="fix-header">
           <Table
             size="middle"
             bordered={true}

--
Gitblit v1.8.0