From 7adf0212cd71a8ec604f65ba2c2e9bdfc5dec22d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 13 一月 2023 10:31:38 +0800
Subject: [PATCH] 2023-01-13

---
 src/tabviews/custom/components/table/normal-table/index.jsx |   40 ++++++++++++++++++++++++----------------
 1 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx
index bf7d655..87c85cb 100644
--- a/src/tabviews/custom/components/table/normal-table/index.jsx
+++ b/src/tabviews/custom/components/table/normal-table/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { notification, Collapse } from 'antd'
+import { notification, Collapse, Modal } from 'antd'
 
 import Api from '@/api'
 import Utils from '@/utils/utils.js'
@@ -78,7 +78,7 @@
 
     let setting = {..._config.setting, ..._config.wrap}
 
-    if (setting.selected !== 'always' && setting.selected !== 'init') {
+    if (setting.selected !== 'always' && setting.selected !== 'init' && setting.selected !== 'sign') {
       setting.selected = 'false'
     } else {
       setting.orisel = true
@@ -120,7 +120,7 @@
 
       if (setting.selected !== 'false' && _data && _data.length > 0) {
         setTimeout(() => {
-          MKEmitter.emit('mkCheckTopLine', _config.uuid)
+          MKEmitter.emit('mkCheckTopLine', _config.uuid, '', setting.selected)
         }, 200)
         if (setting.selected === 'init') {
           setting.selected = 'false'
@@ -236,7 +236,7 @@
     if (result.status) {
       if ((setting.selected !== 'false' || (setting.orisel && id)) && result.data && result.data.length > 0) {
         setTimeout(() => {
-          MKEmitter.emit('mkCheckTopLine', config.uuid, id)
+          MKEmitter.emit('mkCheckTopLine', config.uuid, id, setting.selected)
         }, 200)
         if (setting.selected === 'init') {
           this.setState({setting: {...setting, selected: 'false'}})
@@ -289,11 +289,18 @@
         loading: false
       })
       this.timer && this.timer.stop()
-      notification.error({
-        top: 92,
-        message: result.message,
-        duration: 10
-      })
+      
+      if (result.ErrCode === 'N') {
+        Modal.error({
+          title: result.message,
+        })
+      } else {
+        notification.error({
+          top: 92,
+          message: result.message,
+          duration: 10
+        })
+      }
     }
   }
 
@@ -554,6 +561,7 @@
     const { setting } = this.state
 
     if (!setting.supModule || setting.supModule !== MenuID) return
+
     if (id !== this.state.BID || id !== '') {
       this.setState({
         pageIndex: 1,
@@ -628,7 +636,7 @@
 
         if (setting.selected !== 'false' && _data && _data.length > 0) {
           setTimeout(() => {
-            MKEmitter.emit('mkCheckTopLine', config.uuid)
+            MKEmitter.emit('mkCheckTopLine', config.uuid, '', setting.selected)
           }, 200)
           if (setting.selected === 'init') {
             this.setState({setting: {...setting, selected: 'false'}})
@@ -637,7 +645,7 @@
       }
 
       this.setState({sync: false, data: _data})
-    } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
+    } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
       this.setState({pageIndex: 1}, () => {
         this.reloadtable()
       })
@@ -699,15 +707,15 @@
             {config.search && config.search.length ?
               <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null
             }
-            <MainAction
+            {actions.length > 0 ? <MainAction
               BID={BID}
               setting={setting}
               actions={actions}
               BData={BData}
               columns={config.columns}
               selectedData={selectedData}
-            />
-            <div className={'main-table-box ' + (!actions || actions.length === 0 ? 'no-action' : '')}>
+            /> : <div className="mk-action-space" style={{height: '25px'}}></div>}
+            <div className="main-table-box">
               <MainTable
                 setting={setting}
                 columns={columns}
@@ -728,14 +736,14 @@
           {config.search && config.search.length ?
             <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null
           }
-          <MainAction
+          {actions.length > 0 ? <MainAction
             BID={BID}
             setting={setting}
             actions={actions}
             BData={BData}
             columns={config.columns}
             selectedData={selectedData}
-          />
+          /> : <div className="mk-action-space" style={{height: '25px'}}></div>}
           <div className={'main-table-box ' + (!actions || actions.length === 0 ? 'no-action' : '')}>
             <MainTable
               setting={setting}

--
Gitblit v1.8.0