From bd1dfc9e6c9b9f8076ca2783ce598e0936b4c664 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 22 十二月 2021 14:36:03 +0800
Subject: [PATCH] 2021-12-22

---
 src/tabviews/zshare/actionList/normalbutton/index.jsx |  385 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 285 insertions(+), 100 deletions(-)

diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index 8aac0c2..ba6f77f 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -3,7 +3,7 @@
 import moment from 'moment'
 import {connect} from 'react-redux'
 import { is, fromJS } from 'immutable'
-import { Button, Modal, notification, message, Drawer, Icon } from 'antd'
+import { Button, Modal, notification, message, Drawer } from 'antd'
 
 import Api from '@/api'
 import Utils, { getSysDefaultSql } from '@/utils/utils.js'
@@ -13,7 +13,8 @@
 import asyncSpinComponent from '@/utils/asyncSpinComponent'
 import { updateForm } from '@/utils/utils-update.js'
 import MKEmitter from '@/utils/events.js'
-import './index.scss'
+import MkIcon from '@/components/mk-icon'
+// import './index.scss'
 
 const MutilForm = asyncSpinComponent(() => import('@/tabviews/zshare/mutilform'))
 const { confirm } = Modal
@@ -37,13 +38,15 @@
     dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     visible: false,
     formdata: null,
-    tabledata: null,
+    selines: null,
     confirmLoading: false,
     btnconfig: null,
     loading: false,
     loadingNumber: '',
     disabled: false,
-    checkParam: null
+    hidden: false,
+    checkParam: null,
+    autoMatic: false
   }
 
   moduleParams = null
@@ -59,7 +62,7 @@
           disabled = true
         }
       })
-      this.setState({disabled})
+      this.setState({disabled, hidden: disabled && btn.control === 'hidden'})
     }
   }
 
@@ -68,13 +71,17 @@
   }
 
   componentDidMount () {
-    const { position } = this.props
+    const { position, btn } = this.props
 
     MKEmitter.addListener('triggerBtnId', this.actionTrigger)
     if (position === 'form') {
       MKEmitter.addListener('triggerFormSubmit', this.actionSubmit)
     }
     MKEmitter.addListener('returnModuleParam', this.resetModuleParam)
+
+    if (btn.autoMatic) {
+      MKEmitter.addListener('triggerBtnPopSubmit', this.triggerBtnPopSubmit)
+    }
   }
 
   UNSAFE_componentWillReceiveProps (nextProps) {
@@ -91,7 +98,7 @@
           }
         })
       }
-      this.setState({disabled})
+      this.setState({disabled, hidden: disabled && btn.control === 'hidden'})
     }
   }
 
@@ -102,6 +109,15 @@
     MKEmitter.removeListener('triggerBtnId', this.actionTrigger)
     MKEmitter.removeListener('triggerFormSubmit', this.actionSubmit)
     MKEmitter.removeListener('returnModuleParam', this.resetModuleParam)
+    MKEmitter.removeListener('triggerBtnPopSubmit', this.triggerBtnPopSubmit)
+  }
+
+  triggerBtnPopSubmit = (id) => {
+    const { btn } = this.props
+
+    if (btn.uuid !== id) return
+
+    this.handleOk()
   }
 
   actionSubmit = (res) => {
@@ -109,11 +125,9 @@
 
     if (btn.uuid !== res.menuId) return
 
-    this.setState({
-      loading: true
-    })
+    this.setState({ loading: true })
 
-    this.execSubmit(this.state.tabledata, () => {}, res.form)
+    this.execSubmit(this.state.selines, () => {}, res.form)
   }
 
   resetModuleParam = (menuId, btnId, param) => {
@@ -127,27 +141,22 @@
   /**
    * @description 鎸夐挳鐘舵�佹敼鍙�
    */
-  updateStatus = (type) => {
-    if (type === 'start') {
-      this.setState({
-        loading: true
-      })
-    } else if (type === 'over') {
-      this.setState({
-        loading: false,
-        visible: false
-      })
-    }
+  updateStatus = () => {
+    this.setState({
+      loading: false,
+      visible: false,
+      confirmLoading: false
+    })
   }
   
   /**
    * @description 瑙﹀彂鎸夐挳鎿嶄綔
    */
-  actionTrigger = (triggerId, record) => {
+  actionTrigger = (triggerId, record, type) => {
     const { Tab, BID, btn, selectedData, setting } = this.props
-    const { loading } = this.state
+    const { loading, disabled } = this.state
 
-    if ((triggerId && btn.uuid !== triggerId) || loading) return
+    if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return
 
     if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
       notification.warning({
@@ -156,7 +165,13 @@
         duration: 5
       })
       return
+    } else if (type === 'linkbtn' && selectedData && selectedData.length === 1) {
+      if (record[0].$Index !== selectedData[0].$Index) {
+        return
+      }
     }
+
+    this.setState({autoMatic: type === 'autoMatic'})
 
     let _this = this
     let data = record || selectedData || []
@@ -231,14 +246,15 @@
       return
     }
 
+    this.setState({
+      selines: data
+    })
+    
     if (btn.OpenType === 'formSubmit') {
-      this.setState({
-        tabledata: data
-      })
       MKEmitter.emit('mkFormSubmit', btn.uuid)
       return
     } else if (btn.OpenType === 'prompt') {
-      this.updateStatus('start')
+      this.setState({loading: true})
       confirm({
         title: this.state.dict['main.action.confirm.tip'],
         onOk() {
@@ -247,22 +263,20 @@
           })
         },
         onCancel() {
-          _this.updateStatus('over')
+          _this.setState({loading: false})
         }
       })
     } else if (btn.OpenType === 'exec') {
-      this.updateStatus('start')
+      this.setState({loading: true})
       this.execSubmit(data, () => { this.setState({loading: false})})
     } else if (btn.OpenType === 'pop') {
-      this.updateStatus('start')
-
       let modal = this.state.btnconfig
       if (!modal && btn.modal) {
         modal = this.handleModelConfig(btn.modal)
       }
 
       this.setState({
-        tabledata: data,
+        loading: true,
         btnconfig: modal
       }, () => {
         this.improveAction()
@@ -310,6 +324,9 @@
           param.$callbacksql = callbacksql
         } else {
           param.LText = getSysDefaultSql(btn, setting, '', param, data[0], columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions) // 鏁版嵁婧�
+          if (btn.output) {
+            param.key_back_type = 'Y'
+          }
         }
 
         if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
@@ -352,6 +369,9 @@
             param.$callbacksql = callbacksql
           } else {
             param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions) // 鏁版嵁婧�
+            if (btn.output) {
+              param.key_back_type = 'Y'
+            }
           }
           
           if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
@@ -384,6 +404,9 @@
             param.$callbacksql = callbacksql
           } else {
             param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions) // 鏁版嵁婧�
+            if (btn.output) {
+              param.key_back_type = 'Y'
+            }
           }
           
           if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
@@ -419,6 +442,10 @@
 
       param.menuname = btn.logLabel
 
+      if (window.GLOB.probation) {
+        param.s_debug_type = 'Y'
+      }
+
       if (check_param) {
         check_param.menuname = btn.logLabel
         this.setState({checkParam: check_param})
@@ -446,6 +473,9 @@
             param.$callbacksql = callbacksql
           } else {
             param.LText = getSysDefaultSql(btn, setting, '', param, cell, columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions, Utils.getAllSearchOptions) // 鏁版嵁婧�
+            if (btn.output) {
+              param.key_back_type = 'Y'
+            }
           }
           
           if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
@@ -479,6 +509,9 @@
               param.$callbacksql = callbacksql
             } else {
               param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions) // 鏁版嵁婧�
+              if (btn.output) {
+                param.key_back_type = 'Y'
+              }
             }
             
             if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
@@ -502,6 +535,9 @@
               param.$callbacksql = callbacksql
             } else {
               param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions) // 鏁版嵁婧�
+              if (btn.output) {
+                param.key_back_type = 'Y'
+              }
             }
             
             if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
@@ -525,6 +561,9 @@
 
         if (param.func === 'sPC_TableData_InUpDe') {
           param.menuname = btn.logLabel
+          if (window.GLOB.probation) {
+            param.s_debug_type = 'Y'
+          }
         }
 
         return param
@@ -643,7 +682,18 @@
   }
 
   execRealSubmit = (data, _resolve, formdata) => {
-    const { setting, btn } = this.props
+    const { setting, btn, Tab, BID } = this.props
+
+    if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
+      notification.warning({
+        top: 92,
+        message: '闇�瑕佷笂绾т富閿�硷紒',
+        duration: 5
+      })
+      _resolve()
+      return
+    }
+
     if (btn.intertype === 'system' || btn.intertype === 'inner') { // 绯荤粺鎺ュ彛
       let params = []
 
@@ -654,14 +704,41 @@
       }
 
       if (params.length <= 20) {
-        let deffers = params.map(param => {
+        let deffers = params.map((param, i) => {
           return new Promise(resolve => {
-            Api.genericInterface(param).then(res => {
-              resolve(res)
-            }, () => {
-              this.updateStatus('over')
-              _resolve()
-            })
+            setTimeout(() => {
+              let _param = null
+              if (btn.preFunc) {
+                _param = fromJS(param).toJS()
+                param.func = btn.preFunc
+              }
+              Api.genericInterface(param).then(res => {
+                if (btn.preFunc && res.status && res.ErrCode !== '-1') {
+                  _param = {..._param, ...res}
+
+                  delete _param.status
+                  delete _param.ErrCode
+                  delete _param.ErrMesg
+                  delete _param.message
+
+                  setTimeout(() => {
+                    Api.genericInterface(_param).then(result => {
+                      if (!result.status) {
+                        notification.warning({
+                          top: 92,
+                          message: result.message,
+                          duration: 5
+                        })
+                      }
+                    })
+                  }, 600)
+                }
+                resolve(res)
+              }, () => {
+                this.updateStatus()
+                _resolve()
+              })
+            }, 100 * i)
           })
         })
         Promise.all(deffers).then(result => {
@@ -813,7 +890,7 @@
                 }
                 resolve()
               }, () => {
-                _this.updateStatus('over')
+                _this.updateStatus()
                 resolve()
                 _resolve()
               })
@@ -830,7 +907,7 @@
         _resolve()
       }
     }, () => {
-      this.updateStatus('over')
+      this.updateStatus()
       _resolve()
     })
   }
@@ -1041,6 +1118,10 @@
       param.LText = Utils.formatOptions(param.LText)
       param.menuname = btn.logLabel
 
+      if (window.GLOB.probation) {
+        param.s_debug_type = 'Y'
+      }
+
       if (this.props.menuType === 'HS') { // 鍑芥暟 sPC_TableData_InUpDe 浜戠楠岃瘉
         param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
       }
@@ -1078,7 +1159,7 @@
         _resolve()
       }
     }, () => {
-      this.updateStatus('over')
+      this.updateStatus()
       _resolve()
     })
   }
@@ -1093,8 +1174,35 @@
       loadingNumber: params.length || ''
     })
 
+    let _param = null
+
+    if (btn.preFunc) {
+      _param = fromJS(param).toJS()
+      param.func = btn.preFunc
+    }
+
     Api.genericInterface(param).then(res => {
       if (res.status) {
+        if (btn.preFunc && res.ErrCode !== '-1') {
+          _param = {..._param, ...res}
+  
+          delete _param.status
+          delete _param.ErrCode
+          delete _param.ErrMesg
+          delete _param.message
+  
+          setTimeout(() => {
+            Api.genericInterface(_param).then(result => {
+              if (!result.status) {
+                notification.warning({
+                  top: 92,
+                  message: result.message,
+                  duration: 5
+                })
+              }
+            })
+          }, 600)
+        }
         if (params.length === 0) {
           this.execSuccess(res)
           _resolve()
@@ -1106,7 +1214,7 @@
         _resolve()
       }
     }, () => {
-      this.updateStatus('over')
+      this.updateStatus()
       _resolve()
     })
   }
@@ -1159,7 +1267,7 @@
             _resolve()
           }
         }, () => {
-          this.updateStatus('over')
+          this.updateStatus()
           _resolve()
         })
       } else {
@@ -1265,9 +1373,9 @@
    */
   execSuccess = (res) => {
     const { btn } = this.props
-    const { btnconfig } = this.state
+    const { btnconfig, autoMatic } = this.state
 
-    if (res && res.ErrCode === 'S') { // 鎵ц鎴愬姛
+    if ((res && res.ErrCode === 'S') || autoMatic) { // 鎵ц鎴愬姛
       notification.success({
         top: 92,
         message: res.ErrMesg || this.state.dict['main.action.confirm.success'],
@@ -1281,7 +1389,14 @@
 
     }
     
-    if (btn.OpenType !== 'pop' || !btnconfig || btnconfig.setting.finish !== 'unclose') {
+    if (autoMatic) {
+      this.setState({
+        loading: false,
+        visible: false
+      })
+      MKEmitter.emit('autoExecOver', btn.uuid, 'success')
+      return
+    } else if (btn.OpenType !== 'pop' || !btnconfig || btnconfig.setting.finish !== 'unclose') {
       this.setState({
         loading: false,
         visible: false
@@ -1292,8 +1407,44 @@
       this.sendMessage()
     }
 
-    if (btn.execSuccess !== 'never') {
-      MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess || '', btn)
+    let id = ''
+    if (btn.output) {
+      id = res.mk_b_id || res[btn.output] || ''
+    }
+
+    if (btn.execSuccess === 'closetab') {
+      MKEmitter.emit('closeTabView', btn.$MenuID)
+    } else if (btn.execSuccess === 'closepoptab') {
+      MKEmitter.emit('popclose')
+    } else if (btn.execSuccess !== 'never') {
+      MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, id, this.state.selines)
+    }
+
+    if (btn.refreshTab && btn.refreshTab.length > 0) {
+      MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], 'table')
+    }
+    if (btn.switchTab && btn.switchTab.length > 0) {
+      let id = btn.switchTab[btn.switchTab.length - 1]
+      let node = document.getElementById('tab' + id)
+      node && node.click()
+    }
+
+    if (btn.openmenu && btn.openmenu.length > 0 && btn.MenuID) {
+      let newtab = {
+        MenuID: btn.MenuID,
+        MenuName: btn.MenuName,
+        MenuNo: btn.MenuNo,
+        type: btn.tabType,
+        param: {
+          $BID: id
+        }
+      }
+
+      if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) {
+        MKEmitter.emit('modifyTabs', newtab, 'replace')
+      } else {
+        MKEmitter.emit('modifyTabs', newtab, 'plus', true)
+      }
     }
   }
 
@@ -1413,12 +1564,13 @@
    */
   execError = (res) => {
     const { btn } = this.props
+    const { btnconfig, autoMatic } = this.state
 
-    if (res.ErrCode === 'E') {
+    if (res.ErrCode === 'E' && !autoMatic) {
       Modal.error({
         title: res.message || res.ErrMesg,
       })
-    } else if (res.ErrCode === 'N') {
+    } else if (res.ErrCode === 'N' || autoMatic) {
       notification.error({
         top: 92,
         message: res.message || res.ErrMesg,
@@ -1433,6 +1585,16 @@
       })
     } else if (res.ErrCode === 'NM') {
       message.error(res.message || res.ErrMesg)
+    }
+
+    if (autoMatic) {
+      this.setState({
+        loading: false,
+        loadingNumber: '',
+        visible: false
+      })
+      MKEmitter.emit('autoExecOver', btn.uuid, 'error')
+      return
     }
     
     this.setState({
@@ -1469,7 +1631,7 @@
               visible: false
             })
             if (btn.execError !== 'never') {
-              MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn)
+              MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn, '', this.state.selines)
             }
           }
         })
@@ -1482,8 +1644,14 @@
       }
     }
 
-    if (btn.execError !== 'never') {
-      MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn)
+    if (btnconfig && btnconfig.setting && btnconfig.setting.errFocus) {
+      MKEmitter.emit('mkFC', 'focus', btnconfig.setting.errFocus)
+    }
+
+    if (btn.execError === 'closepoptab') {
+      MKEmitter.emit('popclose')
+    } else if (btn.execError !== 'never') {
+      MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn, '', this.state.selines)
     }
   }
 
@@ -1526,10 +1694,10 @@
    */
   improveAction = () => {
     const { btn } = this.props
-    const { btnconfig } = this.state
+    const { btnconfig, autoMatic } = this.state
 
     if (btnconfig) {
-      if (btnconfig.setting.display === 'prompt') { // 濡傛灉琛ㄥ崟浠ユ槸鍚︽灞曠ず
+      if (!autoMatic && (btnconfig.setting.display === 'prompt' || btnconfig.setting.display === 'exec')) { // 濡傛灉琛ㄥ崟浠ユ槸鍚︽灞曠ず
         this.modelconfirm()
       } else {
         this.setState({
@@ -1558,14 +1726,14 @@
             message: res.message,
             duration: 5
           })
-          this.updateStatus('over')
+          this.setState({ loading: false })
         } else if (!_LongParam || (btn.OpenType === 'pop' && _LongParam.type !== 'Modal')) {
           notification.warning({
             top: 92,
             message: '鏈幏鍙栧埌鎸夐挳閰嶇疆淇℃伅锛�',
             duration: 5
           })
-          this.updateStatus('over')
+          this.setState({ loading: false })
         } else {
           _LongParam = updateForm(_LongParam)
           _LongParam = this.handleModelConfig(_LongParam)
@@ -1573,7 +1741,7 @@
           this.setState({
             btnconfig: _LongParam
           }, () => {
-            if (_LongParam.setting.display === 'prompt') { // 濡傛灉琛ㄥ崟浠ユ槸鍚︽灞曠ず
+            if (!autoMatic && (_LongParam.setting.display === 'prompt' || _LongParam.setting.display === 'exec')) { // 濡傛灉琛ㄥ崟浠ユ槸鍚︽灞曠ず
               this.modelconfirm()
             } else {
               this.setState({
@@ -1590,16 +1758,11 @@
    * @description 妯℃�佹锛堣〃鍗曪級锛岀‘璁�
    */
   handleOk = () => {
+    if (!this.formRef) return
     this.formRef.handleConfirm().then(res => {
-      this.setState({
-        confirmLoading: true
-      })
+      this.setState({ confirmLoading: true })
 
-      this.execSubmit(this.state.tabledata, () => {
-        this.setState({
-          confirmLoading: false
-        })
-      }, res)
+      this.execSubmit(this.state.selines, () => { this.setState({ confirmLoading: false }) }, res)
     })
   }
 
@@ -1608,15 +1771,15 @@
    */
   handleCancel = () => {
     this.setState({
+      loading: false,
       visible: false,
       confirmLoading: false
     })
-    this.updateStatus('over')
   }
 
   modelconfirm = () => {
     const { BData } = this.props
-    const { btnconfig, tabledata } = this.state
+    const { btnconfig, selines } = this.state
     let _this = this
 
     let result = []
@@ -1631,8 +1794,8 @@
 
       if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) {
         _initval = BData[item.field]
-      } else if (_readin && tabledata[0] && tabledata[0].hasOwnProperty(item.field)) {
-        _initval = tabledata[0][item.field]
+      } else if (_readin && selines[0] && selines[0].hasOwnProperty(item.field)) {
+        _initval = selines[0][item.field]
       } else if (item.type === 'date' && _initval) {
         _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD')
       } else if (item.type === 'datemonth' && _initval) {
@@ -1656,12 +1819,30 @@
 
       if (['date', 'datemonth', 'datetime'].includes(_type) && item.declareType === 'nvarchar(50)') {
         _type = 'text'
+      } else if (item.type === 'rate') {
+        item.rateCount = item.rateCount || 5
+        let allowHalf = item.allowHalf === 'true'
+
+        if (allowHalf) {
+          _initval = parseFloat(_initval)
+          if (_initval % 0.5 !== 0) {
+            _initval = parseInt(_initval)
+          }
+        } else {
+          _initval = parseInt(_initval)
+        }
+
+        if (isNaN(_initval) || _initval < 0) {
+          _initval = 0
+        } else if (_initval > item.rateCount) {
+          _initval = item.rateCount
+        }
       }
 
       result.push({
         key: item.field,
         readonly: item.readonly === 'true',
-        readin: _readin,
+        readin: item.readin !== 'false' && item.readin !== 'top',
         fieldlen: _fieldlen,
         writein: item.writein !== 'false',
         type: _type,
@@ -1669,24 +1850,28 @@
       })
     })
 
-    confirm({
-      title: this.state.dict['main.action.confirm.tip'],
-      onOk() {
-        return new Promise(resolve => {
-          _this.execSubmit(tabledata, resolve, result)
-        })
-      },
-      onCancel() {
-        _this.updateStatus('over')
-      }
-    })
+    if (btnconfig.setting.display === 'exec') {
+      this.execSubmit(selines, () => {}, result)
+    } else {
+      confirm({
+        title: this.state.dict['main.action.confirm.tip'],
+        onOk() {
+          return new Promise(resolve => {
+            _this.execSubmit(selines, resolve, result)
+          })
+        },
+        onCancel() {
+          _this.setState({ loading: false })
+        }
+      })
+    }
   }
 
   /**
    * @description 鏄剧ず妯℃�佹
    */
   getModels = () => {
-    const { setting, BID, btn } = this.props
+    const { setting, BID, btn, BData } = this.props
     const { btnconfig, visible } = this.state
 
     if (!btnconfig || !btnconfig.setting) return null
@@ -1719,17 +1904,17 @@
             menuType={this.props.menuType}
             action={btnconfig}
             inputSubmit={this.handleOk}
-            data={this.state.tabledata[0]}
-            BData={this.props.BData}
+            data={this.state.selines[0]}
+            BData={BData}
             wrappedComponentRef={(inst) => this.formRef = inst}
           />
-          <div style={{ position: 'absolute', zIndex: 1, right: 0, bottom: 0, width: '100%', borderTop: '1px solid #e9e9e9', padding: '10px 16px', background: '#fff', textAlign: 'right'}}>
+          <div className="ant-drawer-footer" style={{ position: 'absolute', zIndex: 1, right: 0, bottom: 0, width: '100%', borderTop: '1px solid #e9e9e9', padding: '10px 16px', background: '#fff', textAlign: 'right'}}>
             <Button onClick={this.handleCancel} style={{ marginRight: 8 }}>
-              鍙栨秷
+              {btnconfig.setting.formType !== 'check' ? '鍙栨秷' : '鍏抽棴'}
             </Button>
-            <Button onClick={this.handleOk} loading={this.state.confirmLoading} type="primary">
+            {btnconfig.setting.formType !== 'check' ? <Button onClick={this.handleOk} loading={this.state.confirmLoading} type="primary">
               纭畾
-            </Button>
+            </Button> : null}
           </div>
         </Drawer>
       )
@@ -1762,8 +1947,8 @@
             menuType={this.props.menuType}
             action={btnconfig}
             inputSubmit={this.handleOk}
-            data={this.state.tabledata[0]}
-            BData={this.props.BData}
+            data={this.state.selines[0]}
+            BData={BData}
             wrappedComponentRef={(inst) => this.formRef = inst}
           />
         </Modal>
@@ -1773,7 +1958,9 @@
 
   render() {
     const { btn, show, style } = this.props
-    const { loadingNumber, loading, disabled } = this.state
+    const { loadingNumber, loading, disabled, hidden } = this.state
+
+    if (hidden) return null
 
     if (show === 'actionList') {
       return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
@@ -1788,7 +1975,7 @@
         {this.getModels()}
       </div>
     } else if (show && show.indexOf('plus') > -1) {
-      return <div className="mk-btn-wrap">
+      return <div style={{display: 'inline-block'}}>
         <Button
           type="link"
           loading={loading}
@@ -1806,11 +1993,10 @@
         label = btn.label
         icon = btn.icon || ''
       } else if (show === 'link') {
-        label = <span>{btn.label}{btn.icon ? <Icon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span>
+        label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span>
         icon = ''
       } else if (show === 'icon') {
         icon = btn.icon || ''
-      // } else if (show === 'text') {
       } else {
         label = btn.label
       }
@@ -1833,7 +2019,6 @@
 
 const mapStateToProps = (state) => {
   return {
-    tabviews: state.tabviews,
     menuType: state.editLevel
   }
 }

--
Gitblit v1.8.0