From d59f518f466274b2caeb2e01c10c92deafe7c93b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 09 二月 2022 11:48:29 +0800
Subject: [PATCH] 2022-02-09

---
 src/tabviews/custom/components/share/normalTable/index.jsx |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index 15d0d33..fe54374 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -30,6 +30,10 @@
     let { lineMarks, onDoubleClick, data, className, ...resProps } = this.props
     let style = {}
 
+    if (data && data.$disabled) {
+      className = className + ' mk-disabled '
+    }
+
     if (lineMarks && lineMarks.length > 0) {
       lineMarks.some(mark => {
         let originVal = data[mark.field[0]] + ''
@@ -80,7 +84,7 @@
             if (mark.fontColor) {
               style.color = mark.fontColor
             }
-            className += className + ' background'
+            className = className + ' background'
           } else if (mark.signType[0] === 'underline') {
             style.textDecoration = 'underline'
             style.color = mark.color
@@ -145,7 +149,7 @@
         resProps.rowSpan = record['$$' + col.field]
       }
       
-      if (col.linkThdMenu || col.linkurl) {
+      if (!record.$disabled && (col.linkThdMenu || col.linkurl)) {
         content = (
           <div>
             <div className="link-menu" onDoubleClick={(e) => triggerLink(e, col, record)}></div>
@@ -171,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)
@@ -204,7 +210,7 @@
         resProps.rowSpan = record['$$' + col.field]
       }
 
-      if (col.linkThdMenu || col.linkurl) {
+      if (!record.$disabled && (col.linkThdMenu || col.linkurl)) {
         content = (
           <div>
             <div className="link-menu" onDoubleClick={(e) => triggerLink(e, col, record)}></div>
@@ -376,7 +382,6 @@
     lineMarks: PropTypes.array,      // 琛屾爣璁�
     fields: PropTypes.array,         // 缁勪欢瀛楁闆�
     ContainerId: PropTypes.any,      // 鏍囩椤靛灞侷d
-    BData: PropTypes.any,            // 涓昏〃鏁版嵁
     data: PropTypes.any,             // 琛ㄦ牸鏁版嵁
     total: PropTypes.any,            // 鎬绘暟
     loading: PropTypes.bool,         // 琛ㄦ牸鍔犺浇涓�
@@ -526,6 +531,7 @@
     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 })
@@ -649,7 +655,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)
     if (setting.$hasSyncModule) {
@@ -664,6 +670,7 @@
     const { setting, MenuID, data } = this.props
 
     if (!setting.tableType || this.state.pickup) return
+    if (record.$disabled) return
     
     let newkeys = fromJS(this.state.selectedRowKeys).toJS()
 
@@ -688,7 +695,7 @@
       this.setState({ selectedRowKeys: newkeys, activeIndex: _index !== '' ? _index : null })
     }
 
-    let selects = this.props.data.filter((item, _index) => newkeys.includes(_index))
+    let selects = this.props.data.filter((item, _index) => newkeys.includes(_index) && !item.$disabled)
     
     this.props.chgSelectData(selects)
 
@@ -723,6 +730,8 @@
       _id = data[index][setting.primaryKey] || ''
       _data = data[index] || ''
     }
+
+    if (_data && _data.$disabled) return
 
     MKEmitter.emit('resetSelectLine', MenuID, _id, _data)
   }
@@ -812,6 +821,7 @@
     const { setting } = this.props
 
     if (!setting.doubleClick) return
+    if (record.$disabled) return
 
     MKEmitter.emit('triggerBtnId', setting.doubleClick, [record])
   }

--
Gitblit v1.8.0