From bde2916433c7830e2879e6524e32b9f6c8bd0bab Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 02 一月 2022 16:31:32 +0800
Subject: [PATCH] 2022-01-02

---
 src/tabviews/zshare/normalTable/index.jsx |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx
index 41e586a..88e69c8 100644
--- a/src/tabviews/zshare/normalTable/index.jsx
+++ b/src/tabviews/zshare/normalTable/index.jsx
@@ -269,7 +269,7 @@
     if (id !== this.props.MenuID) return
 
     if (this.props.data.length > 0) {
-      this.changeRow(null, 0)
+      this.changeRow(this.props.data[0], 0)
     }
   }
 
@@ -281,7 +281,7 @@
     let i = index - (pageIndex - 1) * pageSize - 1
 
     if (this.props.data[i]) {
-      this.changeRow(null, i)
+      this.changeRow(this.props.data[i], i)
       MKEmitter.emit('autoTransSelectData', this.props.MenuID, this.props.data[i])
     } else {
       MKEmitter.emit('autoMaticOver', this.props.MenuID)
@@ -481,7 +481,7 @@
         content = md5(content)
       }
 
-      if (item.linkThdMenu || item.linkurl) {
+      if (!record.$disabled && (item.linkThdMenu || item.linkurl)) {
         if (item.rowspan === 'true') {
           return {
             children: (
@@ -580,7 +580,7 @@
         content = md5(content)
       }
 
-      if (item.linkThdMenu || item.linkurl) {
+      if (!record.$disabled && (item.linkThdMenu || item.linkurl)) {
         if (item.rowspan === 'true') {
           return {
             children: (
@@ -725,6 +725,7 @@
                   key={btn.uuid}
                   btn={btn}
                   BID={record.$$BID}
+                  disabled={record.$disabled}
                   selectedData={[record]}
                   BData={this.props.BData}
                   setting={this.props.setting}
@@ -738,6 +739,7 @@
                   key={btn.uuid}
                   btn={btn}
                   BID={record.$$BID}
+                  disabled={record.$disabled}
                   selectedData={[record]}
                   BData={this.props.BData}
                   setting={this.props.setting}
@@ -748,6 +750,7 @@
                 <TabButton
                   key={btn.uuid}
                   btn={btn}
+                  disabled={record.$disabled}
                   selectedData={[record]}
                   BData={this.props.BData}
                   MenuID={this.props.MenuID}
@@ -759,6 +762,7 @@
                 <NewPageButton
                   key={btn.uuid}
                   btn={btn}
+                  disabled={record.$disabled}
                   selectedData={[record]}
                   BData={this.props.BData}
                   setting={this.props.setting}
@@ -1029,7 +1033,7 @@
 
     this.setState({ selectedRowKeys, activeIndex: _activeIndex })
 
-    let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index))
+    let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index) && !item.$disabled)
 
     this.props.chgSelectData(selects)
   }
@@ -1039,6 +1043,7 @@
    */
   changeRow = (record, index) => {
     if (!this.props.setting.tableType || this.props.pickup) return
+    if (record.$disabled) return
     
     let newkeys = fromJS(this.state.selectedRowKeys).toJS()
 
@@ -1171,6 +1176,7 @@
     const { setting } = this.props
 
     if (!setting.doubleClick) return
+    if (record.$disabled) return
 
     MKEmitter.emit('triggerBtnId', setting.doubleClick, [record])
   }
@@ -1281,7 +1287,9 @@
           dataSource={_data}
           rowClassName={(record) => {
             let className = ''
-            if ((setting.tableType === 'checkbox' || setting.tableType === 'radio') && record.key === activeIndex) {
+            if (record.$disabled) {
+              className = 'mk-disabled '
+            } else if ((setting.tableType === 'checkbox' || setting.tableType === 'radio') && record.key === activeIndex) {
               className = 'mk-row-active '
             }
 

--
Gitblit v1.8.0