From f07c42a322f41e14ef5b1bf8f2fd66fc5d338cdd Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 28 六月 2023 18:17:09 +0800
Subject: [PATCH] 2023-06-28

---
 src/tabviews/custom/components/table/base-table/index.jsx |   58 ++++++++++++++++++++++++----------------------------------
 1 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx
index f8f7454..d5d7bf5 100644
--- a/src/tabviews/custom/components/table/base-table/index.jsx
+++ b/src/tabviews/custom/components/table/base-table/index.jsx
@@ -46,7 +46,6 @@
    */
   UNSAFE_componentWillMount () {
     let _config = fromJS(this.props.config).toJS()
-    let _cols = new Map()
 
     let BID = ''
     let BData = ''
@@ -75,17 +74,6 @@
     } else {
       setting.orisel = true
     }
-
-    _config.columns.forEach(item => {
-      if (item.type !== 'number') return
-      _cols.set(item.field, item)
-    })
-
-    _config.cols.forEach(column => {
-      if (column.type === 'action') {
-        column.operations = column.elements
-      }
-    })
 
     _config.style = _config.style || {}
 
@@ -212,7 +200,7 @@
             })
           }
           if (setting.controlField) {
-            if (setting.controlVal.includes(item[setting.controlField])) {
+            if (setting.controlVal.includes(item[setting.controlField] + '')) {
               item.$disabled = true
             }
           }
@@ -231,6 +219,20 @@
           MKEmitter.emit('autoMaticOver', config.MenuID)
         }
       }
+
+      if (result.message) {
+        if (result.ErrCode === 'Y') {
+          Modal.success({
+            title: result.message
+          })
+        } else if (result.ErrCode === 'S') {
+          notification.success({
+            top: 92,
+            message: result.message,
+            duration: 2
+          })
+        }
+      }
     } else {
       this.setState({
         loading: false
@@ -240,11 +242,12 @@
         MKEmitter.emit('autoMaticError', config.MenuID)
       }
       
+      if (!result.message) return
       if (result.ErrCode === 'N') {
         Modal.error({
           title: result.message,
         })
-      } else {
+      } else if (result.ErrCode !== '-2') {
         notification.error({
           top: 92,
           message: result.message,
@@ -408,26 +411,13 @@
    * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃�
    */
   refreshbysearch = (searches) => {
-    const { setting } = this.state
-
-    if (setting.onload === 'false') {
-      this.setState({
-        pageIndex: 1,
-        search: searches,
-        setting: {...setting, onload: 'true'}
-      }, () => {
-        this.loadmaindata()
-        this.getStatFieldsValue()
-      })
-    } else {
-      this.setState({
-        pageIndex: 1,
-        search: searches
-      }, () => {
-        this.loadmaindata(true, 'true')
-        this.getStatFieldsValue()
-      })
-    }
+    this.setState({
+      pageIndex: 1,
+      search: searches
+    }, () => {
+      this.loadmaindata(true, 'true')
+      this.getStatFieldsValue()
+    })
   }
 
   /**

--
Gitblit v1.8.0