From 6afdec0062dacbded57e166230eb22cc55ced0c1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 08 五月 2021 14:30:21 +0800
Subject: [PATCH] 2021-05-08

---
 src/tabviews/subtable/index.jsx |  996 +++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 563 insertions(+), 433 deletions(-)

diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx
index a1f212c..ade1f1d 100644
--- a/src/tabviews/subtable/index.jsx
+++ b/src/tabviews/subtable/index.jsx
@@ -3,23 +3,23 @@
 import {connect} from 'react-redux'
 import { is, fromJS } from 'immutable'
 import { notification, Spin, Switch, Row, Col, Icon, Tabs} from 'antd'
-import moment from 'moment'
 
 import Api from '@/api'
 import zhCN from '@/locales/zh-CN/main.js'
 import enUS from '@/locales/en-US/main.js'
 import Utils from '@/utils/utils.js'
 import options from '@/store/options.js'
-import { modifyTabview } from '@/store/action'
-
-import SubSearch from '@/tabviews/zshare/topSearch'
+import UtilsDM from '@/utils/utils-datamanage.js'
+import { updateSubTable } from '@/utils/utils-update.js'
 import asyncComponent from '@/utils/asyncComponent'
 import asyncSpinComponent from '@/utils/asyncSpinComponent'
 import NotFount from '@/components/404'
+import MKEmitter from '@/utils/events.js'
 
 import './index.scss'
 
 const { TabPane } = Tabs
+const SubSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch'))
 const SubAction = asyncComponent(() => import('@/tabviews/zshare/actionList'))
 const SubTable = asyncSpinComponent(() => import('@/tabviews/zshare/normalTable'))
 const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent'))
@@ -35,10 +35,6 @@
     mainSearch: PropTypes.any,       // 涓昏〃鎼滅储鏉′欢
     ContainerId: PropTypes.any,      // 涓夌骇鑿滃崟Container(html) ID
     handleTableId: PropTypes.func,   // 鎺у埗琛ㄦ牸鏁版嵁鍒囨崲鏃讹紝鏇存柊鍦ㄤ富琛ㄤ腑鐨刬d
-    handleMainTable: PropTypes.func, // 鍒锋柊涓昏〃
-    refreshtabs: PropTypes.any,      // 鏍囩鍒锋柊鎺у埗
-    userConfig: PropTypes.any,       // 鐢ㄦ埛鑷畾涔夎缃�
-    triggerBtn: PropTypes.any        // 蹇嵎閿垨鐐瑰嚮琛屾寜閽Е鍙戜簨浠�
   }
 
   state = {
@@ -50,12 +46,10 @@
     searchlist: null,     // 鎼滅储鏉′欢
     actions: null,        // 鎸夐挳闆�
     columns: null,        // 鏄剧ず鍒�
-    logcolumns: null,     // 鏃ュ織涓樉绀虹殑鍒椾俊鎭� (澧炲姞鑷冲叏閮ㄥ垪锛岄櫎鍘诲悎骞跺垪)
     arr_field: '',        // 浣跨敤 sPC_Get_TableData 鏃剁殑鏌ヨ瀛楁闆�
     setting: null,        // 椤甸潰鍏ㄥ眬璁剧疆锛氭暟鎹簮銆佹寜閽強鏄剧ず鍒楀浐瀹氥�佷富閿瓑
-    data: null,           // 鍒楄〃鏁版嵁闆�
+    data: [],             // 鍒楄〃鏁版嵁闆�
     selectedData: [],     // 宸查�夎〃鏍兼暟鎹�
-    resetTable: false,    // 琛ㄦ牸閲嶇疆锛屽�煎湪true涓巉alse涔嬮棿鍒囨崲锛屽垏鎹㈡椂琛ㄦ牸閲嶇疆
     total: 0,             // 鎬绘暟
     loading: false,       // 鍒楄〃鏁版嵁鍔犺浇涓�
     pageIndex: 1,         // 椤电爜
@@ -63,40 +57,31 @@
     orderBy: '',          // 鎺掑簭
     search: [],           // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞�
     pickup: false,        // 瀛愯〃鏁版嵁闅愯棌鏄剧ず鍒囨崲
-    triggerBtn: null,     // 鎸夐挳瑙﹀彂
-    chartId: ''           // 灞曞紑鍥捐〃ID
+    chartId: '',          // 灞曞紑鍥捐〃ID
+    statFields: [],       // 鍚堣瀛楁
+    statFValue: [],       // 鍚堣鍊�
+    absFields: [],        // 缁濆鍊煎瓧娈�
+    loadCustomApi: true,  // 鍔犺浇澶栭儴璧勬簮
+    hasReqFields: false
   }
 
   /**
    * @description 涓婄骇鑿滃崟id鍙樺寲鏃讹紝鍒锋柊鏁版嵁
    */
   UNSAFE_componentWillReceiveProps(nextProps) {
-    if (this.state.config && this.props.Tab.supMenu && !is(fromJS(this.props.BID), fromJS(nextProps.BID))) {
+    const { config, setting } = this.state
+
+    if (config && setting && this.props.Tab.supMenu && !is(fromJS(this.props.BID), fromJS(nextProps.BID))) {
+      MKEmitter.emit('resetTable', this.props.MenuID + this.props.Tab.uuid) // 鍒楄〃閲嶇疆
       this.setState({
-        pageIndex: 1,
-        selectedData: [],
-        resetTable: !this.state.resetTable,
+        pageIndex: 1
       }, () => {
-        if (this.state.setting) {
-          this.loadmaindata(nextProps.BID, 'refresh')
-        }
+        this.loadData()
       })
-    } else if (this.state.config && nextProps.refreshtabs && nextProps.refreshtabs.includes(this.props.Tab.uuid)) {
-      this.reloadtable()
-    } else if (nextProps.triggerBtn && !is(fromJS(this.props.triggerBtn), fromJS(nextProps.triggerBtn)) && nextProps.triggerBtn.parentId === this.props.Tab.uuid) {
-      let trigger = nextProps.triggerBtn
-
-      trigger.parentId = this.props.MenuID
-
-      this.setState({
-        triggerBtn: trigger
+    } else if (setting && !this.props.Tab.supMenu && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
+      this.setState({}, () => {
+        this.loadData()
       })
-    } else if (!this.props.Tab.supMenu && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
-      if (this.state.setting) {
-        this.setState({}, () => {
-          this.loadmaindata()
-        })
-      }
     }
   }
 
@@ -104,7 +89,7 @@
    * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅
    */
   async loadconfig () {
-    const { permAction, permMenus, Tab, BID, userConfig } = this.props
+    const { permAction, permMenus, Tab, BID } = this.props
 
     let param = {
       func: 'sPC_Get_LongParam',
@@ -116,6 +101,7 @@
 
       try { // 閰嶇疆淇℃伅瑙f瀽
         config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
+        config.setting.MenuName = Tab.label
       } catch (e) {
         console.warn('Parse Failure')
         config = ''
@@ -142,69 +128,33 @@
 
       let _arrField = []     // 瀛楁闆�
       let _columns = []      // 鏄剧ず鍒�
-      let _logcolumns = []   // 鏃ュ織鏄剧ず鍒�
       let _hideCol = []      // 闅愯棌鍙婂悎骞跺垪涓瓧娈电殑uuid闆�
       let colMap = new Map()
+      let statFields = []    // 鍚堣瀛楁淇℃伅
+      let absFields = []     // 缁濆鍊煎瓧娈�
 
-      // 鏃х増鏈吋瀹�
-      if (!config.version || config.version < '1.0') {
-        // 鍏煎鍥捐〃
-        if (!config.charts) {
-          config.expand = true
-          config.charts = [{ uuid: Utils.getuuid(), label: '', title: '', chartType: 'table', icon: 'table', Hide: 'false', blacklist: [] }]
-        } else {
-          config.charts.forEach(card => {
-            if (card.chartType === 'card') {
-              card.details = card.details.map(_cell => {
-                _cell.fontSize = _cell.fontSize || 14
-                if (!_cell.width) {
-                  _cell.width = 100
-                } else if (_cell.width === 'helf') {
-                  _cell.width = 50
-                } else if (_cell.width === 'third') {
-                  _cell.width = 33
-                }
-                if (!_cell.fontWeight && _cell.bold === 'true') {
-                  _cell.fontWeight = 'normal'
-                }
-                _cell.height = _cell.height || 1
-  
-                return _cell
-              })
-            }
-          })
-        }
-      }
+      // 鐗堟湰鍏煎
+      config = updateSubTable(config)
 
       // 鏉冮檺杩囨护
       if (this.props.menuType !== 'HS') {
         config.action = config.action.filter(item => permAction[item.uuid])
       }
 
+      let roleId = sessionStorage.getItem('role_id') || '' // 瑙掕壊ID
       // 瀛楁鏉冮檺榛戝悕鍗�
       config.search = config.search.map(item => {
         item.oriInitval = item.initval
         if (!item.blacklist || item.blacklist.length === 0) return item
-
-        let _black = item.blacklist.filter(v => {
-          return this.props.permRoles.indexOf(v) !== -1
-        })
-
-        if (_black.length > 0) {
+        if (item.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
           item.Hide = 'true'
         }
-
         return item
       })
 
       config.columns = config.columns.map(col => {
-        if (!col.field || !col.blacklist || col.blacklist.length === 0 || config.setting.primaryKey === col.field) return col
-
-        let _black = col.blacklist.filter(v => {
-          return this.props.permRoles.indexOf(v) !== -1
-        })
-
-        if (_black.length > 0) {
+        if (!col.blacklist || col.blacklist.length === 0) return col
+        if (col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
           col.Hide = 'true'
         }
 
@@ -215,16 +165,7 @@
       config.charts = config.charts.filter(item => {
         if (item.Hide === 'true') return false
         if (!item.blacklist || item.blacklist.length === 0) return true
-
-        let _black = item.blacklist.filter(v => {
-          return this.props.permRoles.indexOf(v) !== -1
-        })
-
-        if (_black.length > 0 || item.Hide === 'true') {
-          return false
-        } else {
-          return true
-        }
+        return item.blacklist.filter(v => roleId.indexOf(v) > -1).length === 0
       })
 
       if (config.charts.length <= 1) {
@@ -233,46 +174,28 @@
 
       let chartId = config.charts[0] ? config.charts[0].uuid : ''
 
-      if (userConfig) {
-        config.setting.tableType = userConfig.setting.tableType
-
-        config.action = config.action.map(item => {
-          if (userConfig.action[item.uuid]) {
-            delete userConfig.action[item.uuid].label
-            item = {...item, ...userConfig.action[item.uuid]}
-          }
-
-          if (item.execMode) {
-            item.OpenType = 'funcbutton'
-          }
-
-          if (item.OpenType === 'funcbutton' && item.funcType === 'print' && item.verify && item.printer) {
-            item.verify.defaultPrinter = item.printer.defaultPrinter || ''
-            if (item.verify.printerTypeList && item.printer.printerList) {
-              item.verify.printerTypeList = item.verify.printerTypeList.map(cell => {
-                cell.printer = item.printer.printerList[cell.Value] || ''
-                
-                return cell
-              })
-            }
-          }
-
-          return item
-        })
-      }
-
       // 1銆佺瓫閫夊瓧娈甸泦锛�2銆佽繃婊ら殣钘忓垪鍙婂悎骞跺垪涓殑瀛楁uuid
       config.columns.forEach(col => {
         if (col.field) {
           _arrField.push(col.field)
-          _logcolumns.push(col)
+
+          if (col.linkmenu && col.linkmenu.length > 0) {
+            let menu_id = col.linkmenu.slice(-1)[0]
+            col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || ''
+          } else {
+            col.linkThdMenu = ''
+          }
 
           col.nameField && _arrField.push(col.nameField) // 閾炬帴鍚嶅瓧娈�
+          if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') {
+            statFields.push(col)
+          }
+          if (col.format === 'abs') {
+            absFields.push(col.field)
+          }
         }
         if (col.type === 'colspan' && col.sublist) { // 绛涢�夐殣钘忓垪
           _hideCol = _hideCol.concat(col.sublist)
-        } else if (col.Hide === 'true') {
-          _hideCol.push(col.uuid)
         }
         colMap.set(col.uuid, col)
       })
@@ -281,22 +204,24 @@
       config.columns.forEach((col, index) => {
         if (_hideCol.includes(col.uuid)) return
 
-        if (col.linkThdMenu && !permMenus[col.linkThdMenu.MenuID]) {
-          col.linkThdMenu = ''
-        }
-
         col.sort = index
 
-        if (col.type === 'colspan' && col.sublist) {
-          let _col = JSON.parse(JSON.stringify(col))
-          let subColumn = []
-          _col.sublist.forEach(sub => {
+        if (col.type === 'colspan') {
+          if (col.unfold !== 'true') { // 涓嶅睍寮�涓烘棫鐗堝悎骞跺垪
+            col.type = 'old_colspan'
+          }
+
+          let _col = fromJS(col).toJS()
+          let subcols = []
+          _col.sublist && _col.sublist.forEach(sub => {
             if (colMap.has(sub)) {
-              subColumn.push(colMap.get(sub))
+              subcols.push(colMap.get(sub))
             }
           })
-          _col.subColumn = subColumn
-          _columns.push(_col)
+          if (subcols.length > 0) {
+            _col.subcols = subcols
+            _columns.push(_col)
+          }
         } else {
           _columns.push(col)
         }
@@ -306,10 +231,23 @@
       let _operations = []  // 鎿嶄綔鍒楁寜閽紙瀛樺湪鏃讹級
 
       config.action.forEach(item => {
-        if (item.execMode) {
-          item.OpenType = 'funcbutton'
-        }
+        item.logLabel = Tab.label + '-' + item.label // 鐢ㄤ簬sPC_TableData_InUpDe璁板綍鎿嶄綔鎸夐挳
+        item.$menuId = this.props.MenuID
 
+        if (item.OpenType === 'funcbutton' && item.funcType === 'print' && item.verify) { // 鎵撳嵃鏈鸿缃�
+          let _item = window.GLOB.UserCacheMap.get(Tab.uuid + item.uuid)
+
+          if (_item) {
+            item.verify.defaultPrinter = _item.printer || ''
+            if (item.verify.printerTypeList && _item.printerList) {
+              item.verify.printerTypeList = item.verify.printerTypeList.map(cell => {
+                cell.printer = _item.printerList[cell.Value] || ''
+  
+                return cell
+              })
+            }
+          }
+        }
         if (item.position === 'toolbar') {
           _actions.push(item)
         } else if (item.position === 'grid') {
@@ -323,44 +261,69 @@
       }
 
       let valid = true // 鎼滅储鏉′欢蹇呭~楠岃瘉
+      let hasReqFields = false
       config.search.forEach(field => {
-        if (field.required === 'true' && !field.initval) {
+        if (field.required !== 'true') return
+        hasReqFields = true
+        if (!field.initval) {
           valid = false
         }
       })
 
-      // 娣诲姞鐢ㄦ埛鏄剧ず鍒楄缃�
-      if (userConfig) {
-        _columns = _columns.map(item => {
-          if (userConfig.columns[item.uuid]) {
-            delete userConfig.columns[item.uuid].label
-            item = {...item, ...userConfig.columns[item.uuid]}
-          }
-
-          return item
-        })
-
-        _columns.sort((pre, next) => {
-          return pre.sort - next.sort
-        })
-      }
-
       config.setting.tabType = 'sub'
+      // 鏁版嵁婧愪俊鎭澶勭悊
+      config.setting.laypage = config.setting.laypage !== 'false'     // 鏄惁鍒嗛〉锛岃浆涓篵oolean 缁熶竴鏍煎紡
+      config.setting.execute = config.setting.default !== 'false'     // 榛樿sql鏄惁鎵ц锛岃浆涓篵oolean 缁熶竴鏍煎紡
+      config.setting.customScript = ''                                // 鑷畾涔夎剼鏈�
+
+      if (config.setting.interType === 'system' || (config.setting.interType === 'custom' && config.setting.requestMode === 'system')) {
+        if (config.setting.scripts && config.setting.scripts.length > 0) {
+          let _customScript = ''
+          config.setting.scripts.forEach(item => {
+            if (item.status === 'false') return
+            _customScript += `
+              ${item.sql}
+            `
+          })
+          config.setting.customScript = _customScript
+        }
+  
+        if (!config.setting.execute) { // 榛樿sql 涓嶆墽琛屾椂 缃┖
+          config.setting.dataresource = ''
+        } else {
+          config.setting.dataresource = config.setting.dataresource || ''
+        }
+        if (/\s/.test(config.setting.dataresource)) {
+          config.setting.dataresource = '(' + config.setting.dataresource + ') tb'
+        }
+  
+        if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
+          config.setting.dataresource = config.setting.dataresource.replace(/\$@/ig, '/*')
+          config.setting.dataresource = config.setting.dataresource.replace(/@\$/ig, '*/')
+          config.setting.customScript = config.setting.customScript.replace(/\$@/ig, '/*')
+          config.setting.customScript = config.setting.customScript.replace(/@\$/ig, '*/')
+        } else {
+          config.setting.dataresource = config.setting.dataresource.replace(/@\$|\$@/ig, '')
+          config.setting.customScript = config.setting.customScript.replace(/@\$|\$@/ig, '')
+        }
+      }
 
       this.setState({
         loadingview: false,
-        chartId: chartId,
-        config: config,
+        chartId,
+        config,
+        absFields,
+        statFields,
         setting: config.setting,
         searchlist: config.search,
         actions: _actions,
         columns: _columns,
-        logcolumns: _logcolumns,
         arr_field: _arrField.join(','),
-        search: Utils.initMainSearch(config.search) // 鎼滅储鏉′欢鍒濆鍖栵紙鍚湁鏃堕棿鏍煎紡锛岄渶瑕佽浆鍖栵級
+        search: Utils.initMainSearch(config.search), // 鎼滅储鏉′欢鍒濆鍖栵紙鍚湁鏃堕棿鏍煎紡锛岄渶瑕佽浆鍖栵級
+        hasReqFields
       }, () => {
         if (config.setting.onload !== 'false' && (!Tab.supMenu || BID || Tab.isTreeNode) && valid) { // 鍒濆鍖栧彲鍔犺浇
-          this.loadmaindata()
+          this.loadData()
         }
       })
     } else {
@@ -377,19 +340,23 @@
       })
     }
   }
+  
+  loadData = () => {
+    const { mainSearch, BID } = this.props
+    const { setting, search, loadCustomApi, hasReqFields } = this.state
 
-  /**
-   * @description 瀛愯〃鏁版嵁鍔犺浇
-   */
-  async loadmaindata (bid, type) {
-    const { setting, search } = this.state
-    let param = ''
-    let _BID = this.props.BID
+    let searches = fromJS(search).toJS()
+    if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
+      searches = [...mainSearch, ...searches]
+    }
 
-    let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0))
-    let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + '-' : ''
-
+    let requireFields = []
+    if (hasReqFields) {
+      requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0))
+    }
+    
     if (requireFields.length > 0) {
+      let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + '-' : ''
       let labels = requireFields.map(item => item.label)
       labels = Array.from(new Set(labels))
 
@@ -399,43 +366,256 @@
         duration: 3
       })
       return
+    } else if (this.props.Tab.supMenu && !BID) { // 涓昏〃ID涓嶅瓨鍦ㄦ椂锛屼笉鏌ヨ瀛愯〃
+      this.setState({
+        data: [],
+        selectedData: [],
+        statFValue: [],
+        total: 0
+      })
+      this.handleTableId()
+      return
+    } else if (window.GLOB.systemType === 'production' && setting.interType === 'custom' && !setting.proInterface) {
+      notification.warning({
+        top: 92,
+        message: '鏈缃寮忕郴缁熷湴鍧�!',
+        duration: 3
+      })
+      return
+    }
+
+    this.setState({
+      selectedData: []
+    })
+    this.handleTableId()
+
+    if (setting.interType === 'custom' && loadCustomApi) {
+      if (setting.execTime === 'once') {
+        this.setState({loadCustomApi: false})
+      }
+
+      this.loadOutResource(searches)
+      if (setting.execType === 'async') {
+        this.loadmaindata()
+      }
+    } else {
+      this.loadmaindata()
+    }
+  }
+
+  loadOutResource = (searches) => {
+    const { BID } = this.props
+    const { setting } = this.state
+
+    let param = UtilsDM.getPrevQueryParams(setting, searches, BID, this.props.menuType)
+
+    if (setting.execType === 'sync') {
+      this.setState({
+        loading: true
+      })
+    }
+
+    Api.genericInterface(param).then(res => {
+      if (res.status) {
+        if (res.mk_ex_invoke === 'false' || res.mk_ex_invoke === false) {
+          this.loadmaindata()
+        } else {
+          this.customOuterRequest(res)
+        }
+      } else {
+        this.setState({
+          loading: false
+        })
+        notification.error({
+          top: 92,
+          message: res.message,
+          duration: 10
+        })
+      }
+    }, () => {
+      this.setState({
+        loading: false
+      })
+    })
+  }
+
+  customOuterRequest = (result) => {
+    const { setting } = this.state
+    let url = ''
+
+    if (window.GLOB.systemType === 'production') {
+      url = setting.proInterface
+    } else {
+      url = setting.interface
+    }
+
+    let mkey = result.mk_api_key || ''
+
+    delete result.mk_ex_invoke
+    delete result.status
+    delete result.message
+    delete result.ErrCode
+    delete result.ErrMesg
+    delete result.mk_api_key
+
+    let param = {}
+
+    Object.keys(result).forEach(key => {
+      key = key.replace(/^mk_/ig, '')
+      param[key] = result[key]
+    })
+
+    Api.directRequest(url, setting.method, param, setting.cross).then(res => {
+      if (typeof(res) !== 'object' || Array.isArray(res)) {
+        let error = '鏈煡鐨勮繑鍥炵粨鏋滐紒'
+
+        if (typeof(res) === 'string') {
+          error = res.replace(/'/ig, '"')
+        }
+
+        let _result = {
+          mk_api_key: mkey,
+          $ErrCode: 'E',
+          $ErrMesg: error
+        }
+
+        this.customCallbackRequest(_result)
+      } else {
+        res.mk_api_key = mkey
+        this.customCallbackRequest(res)
+      }
+    }, (e) => {
+      let _result = {
+        mk_api_key: mkey,
+        $ErrCode: 'E',
+        $ErrMesg: e && e.statusText ? e.statusText : ''
+      }
+
+      this.customCallbackRequest(_result)
+    })
+  }
+
+  customCallbackRequest = (result) => {
+    const { setting } = this.state
+    let errSql = ''
+    if (result.$ErrCode === 'E') {
+      errSql = `
+        set @ErrorCode='E'
+        set @retmsg='${result.$ErrMesg}'
+      `
+      delete result.$ErrCode
+      delete result.$ErrMesg
+    }
+
+    let lines = UtilsDM.getCallBackSql(setting, result)
+    let param = {}
+
+    if (setting.callbackType === 'script') { // 浣跨敤鑷畾涔夎剼鏈�
+      let sql = lines.map(item => (`
+        ${item.insert}
+        ${item.selects.join(` union all
+        `)}
+      `))
+      sql = sql.join('')
+      
+      param = UtilsDM.getCallBackQueryParams(setting, sql, errSql)
+
+      if (this.props.BID) {
+        param.BID = this.props.BID
+      }
+
+      if (this.props.menuType === 'HS') { // 鍑芥暟 sPC_TableData_InUpDe 浜戠楠岃瘉
+        param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
+      }
+    } else {
+      param.func = 's_ex_result_back'
+      param.s_ex_result = lines.map((item, index) => ({
+        MenuID: this.props.MenuID,
+        MenuName: this.props.Tab.label,
+        TableName: item.table,
+        LongText: window.btoa(window.encodeURIComponent(`${item.insert}  ${item.selects.join(` union all `)}`)),
+        Sort: index + 1
+      }))
+
+      if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) {
+        let sql = lines.map(item => (`
+          ${item.insert}
+          ${item.selects.join(` union all
+          `)}
+        `))
+        sql = sql.join('')
+        console.info(sql.replace(/\n\s{10}/ig, '\n'))
+      }
+    }
+
+    Api.genericInterface(param).then(res => {
+      if (res.status) {
+        this.loadmaindata()
+      } else {
+        this.setState({
+          loading: false
+        })
+        notification.error({
+          top: 92,
+          message: res.message,
+          duration: 10
+        })
+      }
+    }, () => {
+      this.setState({
+        loading: false
+      })
+    })
+  }
+
+  /**
+   * @description 瀛愯〃鏁版嵁鍔犺浇
+   */
+  async loadmaindata () {
+    const { mainSearch, BID } = this.props
+    const { setting, arr_field, search, orderBy, pageIndex, pageSize, absFields } = this.state
+
+    let searches = fromJS(search).toJS()
+    if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
+      searches = [...mainSearch, ...searches]
     }
 
     this.setState({
       loading: true
     })
-    
-    if (type === 'refresh') {
-      _BID = bid
-      if (!bid) { // 涓昏〃ID涓嶅瓨鍦ㄦ椂锛屼笉鏌ヨ瀛愯〃
-        this.setState({
-          data: [],
-          total: 0,
-          loading: false
-        })
 
-        return
-      }
+    let _orderBy = orderBy || setting.order
+    let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType)
+
+    if (param.func === 'sPC_Get_TableData') {
+      param.menuname = this.props.Tab.label || ''
     }
-
-    if (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc)) {
-      param = this.getCustomParam(_BID)
-    } else {
-      param = this.getDefaultParam(_BID)
-    }
-
-    // 鏁版嵁绠$悊鏉冮檺
-    if (this.props.dataManager) {
-      param.dataM = 'Y'
-    }
-
-    this.handleTableId()
 
     let result = await Api.genericInterface(param)
+
+    this.getStatFieldsValue(searches)
+
     if (result.status) {
+      let start = 1
+      if (setting.laypage) {
+        start = pageSize * (pageIndex - 1) + 1
+      }
+
       this.setState({
         data: result.data.map((item, index) => {
+          if (absFields.length) {
+            absFields.forEach(field => {
+              if (!item[field]) return
+              if (isNaN(Math.abs(item[field]))) return
+
+              item[field] = Math.abs(item[field])
+            })
+          }
           item.key = index
+          item.$$uuid = item[setting.primaryKey] || ''
+          item.$$BID = BID || ''
+          item.$Index = start + index
+
           return item
         }),
         total: result.total,
@@ -443,6 +623,7 @@
         loading: false
       })
     } else {
+      let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + '-' : ''
       this.setState({
         loading: false
       })
@@ -456,172 +637,132 @@
   }
 
   /**
-   * @description 鑾峰彇鐢ㄦ埛鑷畾涔夊瓨鍌ㄨ繃绋嬩紶鍙�
-   */
-  getCustomParam = (BID) => {
-    const { mainSearch } = this.props
-    const { pageIndex, pageSize, orderBy, search, setting } = this.state
+   * @description 鑾峰彇鍗曡鏁版嵁
+   */ 
+  async loadmainLinedata (id) {
+    const { mainSearch, BID } = this.props
+    const { setting, arr_field, search, orderBy, pageIndex, pageSize, absFields } = this.state
 
-    let searches = search
+    let searches = fromJS(search).toJS()
     if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
-      searches = [...mainSearch, ...search]
+      searches = [...mainSearch, ...searches]
     }
 
-    let _search = Utils.formatCustomMainSearch(searches)
+    this.setState({
+      loading: true
+    })
 
-    let param = {
-      OrderCol: orderBy || setting.order,
-      BID: BID,
-      ..._search
+    let _orderBy = orderBy || setting.order
+    let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType, id)
+
+    if (param.func === 'sPC_Get_TableData') {
+      param.menuname = this.props.Tab.label || ''
     }
 
-    if (setting.laypage !== 'false') {
-      param.PageIndex = pageIndex
-      param.PageSize = pageSize
-    }
+    let result = await Api.genericInterface(param)
+    if (result.status) {
+      let data = fromJS(this.state.data).toJS()
+      let selectedData = fromJS(this.state.selectedData).toJS()
+      if (result.data && result.data[0]) {
+        let _data = result.data[0] || {}
 
-    if (setting.interType === 'inner') {
-      param.func = setting.innerFunc
+        if (absFields.length) {
+          absFields.forEach(field => {
+            if (!_data[field]) return
+            if (isNaN(Math.abs(_data[field]))) return
+            
+            _data[field] = Math.abs(_data[field])
+          })
+        }
+
+        _data.$$uuid = _data[setting.primaryKey] || ''
+        _data.$$BID = BID || ''
+
+        try {
+          data = data.map(item => {
+            if (item.$$uuid === _data.$$uuid) {
+              _data.key = item.key
+              _data.$Index = item.$Index
+              return _data
+            } else {
+              return item
+            }
+          })
+          selectedData = selectedData.map(item => {
+            if (_data.$$uuid === item.$$uuid) {
+              return _data
+            }
+            return item
+          })
+        } catch {
+          console.warn('鏁版嵁鏌ヨ閿欒')
+        }
+      }
+
+      this.setState({
+        data,
+        selectedData,
+        loading: false
+      })
     } else {
-      if (this.props.menuType === 'HS') {
-        if (setting.sysInterface === 'true' && options.cloudServiceApi) {
-          param.rduri = options.cloudServiceApi
-        } else if (setting.sysInterface !== 'true') {
-          param.rduri = setting.interface
-        }
-      } else {
-        if (setting.sysInterface === 'true' && window.GLOB.mainSystemApi) {
-          param.rduri = window.GLOB.mainSystemApi
-        } else if (setting.sysInterface !== 'true') {
-          param.rduri = setting.interface
-        }
-      }
-
-      if (setting.outerFunc) {
-        param.func = setting.outerFunc
-      }
+      this.setState({
+        loading: false
+      })
+      notification.error({
+        top: 92,
+        message: result.message,
+        duration: 10
+      })
     }
-
-    return param
   }
 
   /**
-   * @description 鑾峰彇绯荤粺瀛樺偍杩囩▼ sPC_Get_TableData 鐨勫弬鏁�
+   * @description 鑾峰彇鍚堣瀛楁鍊�
    */
-  getDefaultParam = (BID) => {
-    const { mainSearch } = this.props
-    const { arr_field, pageIndex, pageSize, orderBy, search, setting } = this.state
+  getStatFieldsValue = (searches) => {
+    const { BID } = this.props
+    const { setting, orderBy, statFields } = this.state
 
-    let searches = search
-    if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
-      searches = [...mainSearch, ...search]
-    }
-
-    let _search = Utils.joinMainSearchkey(searches)
-    _search = _search ? 'where ' + _search : ''
-
-    let param = {
-      func: 'sPC_Get_TableData',
-      obj_name: 'data',
-      arr_field: arr_field,
-      BID: BID,
-      custom_script: setting.customScript || '',
-      default_sql: setting.default || 'true'
-    }
+    if (statFields.length === 0 || !(setting.interType === 'system' || (setting.interType === 'custom' && setting.requestMode === 'system')) || !setting.dataresource) return
 
     let _orderBy = orderBy || setting.order
-    let _dataresource = setting.dataresource
+    let param = UtilsDM.getStatQueryDataParams(setting, statFields, searches, _orderBy, BID, this.props.menuType)
 
-    if (/\s/.test(_dataresource)) {
-      _dataresource = '(' + _dataresource + ') tb'
+    if (param.func === 'sPC_Get_TableData') {
+      param.menuname = this.props.Tab.label || ''
     }
+    
+    Api.genericInterface(param).then(res => {
+      if (res.status) {
+        let _data = res.data[0]
+        let values = []
 
-    if (this.props.dataManager) { // 鏁版嵁鏉冮檺
-      _dataresource = _dataresource.replace(/\$@/ig, '/*')
-      _dataresource = _dataresource.replace(/@\$/ig, '*/')
-      param.custom_script = param.custom_script.replace(/\$@/ig, '/*')
-      param.custom_script = param.custom_script.replace(/@\$/ig, '*/')
-    } else {
-      _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
-      param.custom_script = param.custom_script.replace(/@\$|\$@/ig, '')
-    }
-
-    let regoptions = null
-    if (setting.queryType === 'statistics' || param.custom_script) {
-      let allSearch = Utils.getAllSearchOptions(searches)
-
-      regoptions = allSearch.map(item => {
-        return {
-          reg: new RegExp('@' + item.key + '@', 'ig'),
-          value: `'${item.value}'`
+        if (_data) {
+          statFields.forEach(item => {
+            if (_data[item.field] || _data[item.field] === 0) {
+              let val = +_data[item.field]
+              if (isNaN(val)) {
+                val = 0
+              }
+              val = val.toFixed(item.decimal)
+              values.push({label: item.label, value: val})
+            }
+          })
         }
-      })
-    }
-
-    if (setting.queryType === 'statistics' && setting.default !== 'false') { // 缁熻鏁版嵁婧愶紝鍐呭鏇挎崲
-      regoptions.forEach(item => {
-        _dataresource = _dataresource.replace(item.reg, item.value)
-      })
-      _search = ''
-    }
-
-    let LText = ''
-    let DateCount = ''
-
-    if (setting.default !== 'false' && setting.laypage !== 'false') {
-      LText = ` select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows `
-      DateCount = `select count(1) as total from ${_dataresource} ${_search}`
-    } else if (setting.default !== 'false') {
-      LText = ` select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows `
-      DateCount = ''
-    }
-
-    if (param.custom_script) {
-      regoptions.push({
-        reg: new RegExp('@orderBy@', 'ig'),
-        value: _orderBy
-      })
-      if (setting.laypage !== 'false') {
-        regoptions.push({
-          reg: new RegExp('@pageSize@', 'ig'),
-          value: pageSize
-        }, {
-          reg: new RegExp('@pageIndex@', 'ig'),
-          value: pageIndex
+        this.setState({
+          statFValue: values
+        })
+      } else {
+        this.setState({
+          statFValue: []
+        })
+        notification.error({
+          top: 92,
+          message: res.message,
+          duration: 10
         })
       }
-
-      regoptions.forEach(item => {
-        param.custom_script = param.custom_script.replace(item.reg, item.value)
-      })
-
-      if (LText) {
-        LText += `
-          aaa:
-          if @ErrorCode!=''
-            insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ 
-        `
-      } else {
-        param.custom_script += `
-          aaa:
-          if @ErrorCode!=''
-            insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
-        `
-      }
-
-      param.custom_script = Utils.formatOptions(param.custom_script)
-    }
-
-    param.LText = Utils.formatOptions(LText)
-    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
-    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
-    param.DateCount = Utils.formatOptions(DateCount)
-
-    if (this.props.menuType === 'HS') { // 浜戠鏁版嵁楠岃瘉
-      param.open_key = Utils.encrypt(param.secretkey, param.timestamp, true)
-    }
-
-    return param
+    })
   }
 
   /**
@@ -629,13 +770,12 @@
    * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃�
    */
   refreshbysearch = (searches) => {
+    MKEmitter.emit('resetTable', this.props.MenuID + this.props.Tab.uuid) // 鍒楄〃閲嶇疆
     this.setState({
       pageIndex: 1,
       search: searches,
-      resetTable: !this.state.resetTable,
-      selectedData: [],
     }, () => {
-      this.loadmaindata()
+      this.loadData()
     })
   }
 
@@ -652,82 +792,51 @@
     }
 
     this.setState({
-      selectedData: [],
       pageIndex: pagination.current,
       pageSize: pagination.pageSize,
       orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : ''
     }, () => {
-      this.loadmaindata()
+      this.loadData()
     })
   }
 
   /**
    * @description 琛ㄦ牸鍒锋柊
    */
-  reloadtable = () => {
-    this.setState({
-      pageIndex: 1,
-      selectedData: [],
-      resetTable: !this.state.resetTable
-    }, () => {
-      this.loadmaindata()
-    })
-  }
-
-  /**
-   * @description 椤甸潰鍒锋柊锛岄噸鏂拌幏鍙栭厤缃�
-   */
-  reloadview = () => {
-    this.setState({ loadingview: true, viewlost: false, lostmsg: '', config: null, searchlist: null, actions: null,
-      columns: null, arr_field: '', setting: null, data: null, total: 0, loading: false, pageIndex: 1, pageSize: 10,
-      orderBy: '', search: [], triggerBtn: null
-    }, () => {
-      this.loadconfig()
-    })
-  }
-
-  /**
-   * @description 鎸夐挳鎿嶄綔瀹屾垚鍚庯紙鎴愬姛鎴栧け璐ワ級锛岄〉闈㈠埛鏂帮紝閲嶇疆椤电爜鍙婇�夋嫨椤�
-   */
-  refreshbyaction = (position) => {
-    const { Tab } = this.props
-
-    if (position === 'grid') {
-      this.reloadtable()
-    } else if (position === 'view') {
-      this.reloadview()
-    } else if (position === 'maingrid') {
-      if (Tab.isTreeNode) {
-        this.reloadtable()
-      }
-      this.props.handleMainTable('maingrid')
-    } else if (position === 'equaltab') {
-      this.reloadtable()
-      this.props.handleMainTable('equaltab')
-    } else if (position === 'mainline') {
-      this.reloadtable()
-      this.props.handleMainTable('mainline')
+  reloadtable = (btn) => {
+    if (!btn || btn.resetPageIndex !== 'false') {
+      MKEmitter.emit('resetTable', this.props.MenuID + this.props.Tab.uuid) // 鍒楄〃閲嶇疆
+      this.setState({
+        pageIndex: 1
+      }, () => {
+        this.loadData()
+      })
+    } else {
+      MKEmitter.emit('resetTable', this.props.MenuID + this.props.Tab.uuid, 'false') // 鍒楄〃閲嶇疆
+      this.loadData()
     }
   }
 
   /**
    * @description 瀵煎嚭Excel鏃讹紝鑾峰彇椤甸潰鎼滅储鎺掑簭绛夊弬鏁�
    */
-  getexceloutparam = () => {
-    const { Tab, mainSearch } = this.props
+  getexceloutparam = (menuId, btnId) => {
+    const { Tab, mainSearch, MenuID } = this.props
     const { arr_field, orderBy, search, setting} = this.state
+
+    if (MenuID !== menuId) return
 
     let searches = search
     if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
       searches = [...mainSearch, ...search]
     }
 
-    return {
+    MKEmitter.emit('execExcelout', MenuID, btnId, {
       arr_field: arr_field,
       orderBy: orderBy || setting.order,
       search: searches,
       menuName: Tab.label
-    }
+    })
   }
 
   /**
@@ -735,20 +844,6 @@
    */
   changeSelectedData = (selectedData) => {
     this.setState({selectedData})
-  }
-
-  /**
-   * @description 琛ㄦ牸涓紝鎸夐挳瑙﹀彂浜嬩欢浼犻��
-   */
-  buttonTrigger = (btn, record) => {
-    this.setState({
-      triggerBtn: {
-        uuid: new Date().getTime(),
-        parentId: this.props.MenuID,
-        button: btn,
-        data: record
-      }
-    })
   }
 
   /**
@@ -776,13 +871,64 @@
     this.setState({chartId: uuid})
   }
 
+  reloadData = (menuId, id) => { // Id瀛樺湪鏃讹紝鍒锋柊琛�
+    const { MenuID } = this.props
+
+    if (menuId.indexOf(MenuID) === -1) return
+    if (id === 'empty') return
+
+    if (!id) {
+      this.reloadtable()
+    } else {
+      this.loadmainLinedata(id)
+    }
+  }
+
+  /**
+   * @description 鎸夐挳鎵ц瀹屾垚鍚庨〉闈㈠埛鏂�
+   * @param {*} menuId     // 鑿滃崟Id
+   * @param {*} position   // 鍒锋柊浣嶇疆
+   * @param {*} btn        // 鎵ц鐨勬寜閽�
+   */
+  refreshByButtonResult = (menuId, position, btn) => {
+    const { MenuID } = this.props
+
+    if (MenuID !== menuId) return
+
+    const { Tab, SupMenuID, BID } = this.props
+
+    if (position === 'grid' || position === 'view') {
+      this.reloadtable(btn)
+    } else if (position === 'maingrid' || position === 'mainline') {
+      this.reloadtable(btn)
+      if (Tab.supMenu === 'mainTable') {
+        MKEmitter.emit('reloadData', SupMenuID, (BID || 'empty'))   // 涓昏〃閲嶇疆
+      } else if (Tab.supMenu) {
+        MKEmitter.emit('reloadData', Tab.supMenu, (BID || 'empty')) // 涓昏〃閲嶇疆
+      } else if (!Tab.supMenu && Tab.level === 0) {
+        MKEmitter.emit('reloadData', SupMenuID, (BID || 'empty'))   // 鏍戝舰缁撴瀯锛�0绾ф爣绛�
+      }
+    } else if (position === 'equaltab') {
+      this.reloadtable(btn)
+      if (Tab.equalTab && Tab.equalTab.length > 0) {
+        MKEmitter.emit('reloadData', Tab.equalTab.join(',')) // 鍚岀骇鏍囩閲嶇疆
+      }
+    }
+  }
+
   UNSAFE_componentWillMount() {
     // 缁勪欢鍔犺浇鏃讹紝鑾峰彇鑿滃崟鏁版嵁
     this.loadconfig()
   }
 
-  shouldComponentUpdate (nextProps, nextState) { // handleMainTable 鍑芥暟鍒ゆ柇鏃朵笉鐩哥瓑
-    return !is(fromJS({...this.props, handleMainTable: '', handleTableId: ''}), fromJS({...nextProps, handleMainTable: '', handleTableId: ''})) || !is(fromJS(this.state), fromJS(nextState))
+  shouldComponentUpdate (nextProps, nextState) { // handleTableId 鍑芥暟鍒ゆ柇鏃朵笉鐩哥瓑
+    return !is(fromJS({...this.props, handleTableId: ''}), fromJS({...nextProps, handleTableId: ''})) || !is(fromJS(this.state), fromJS(nextState))
+  }
+
+  componentDidMount () {
+    MKEmitter.addListener('reloadData', this.reloadData)
+    MKEmitter.addListener('getexceloutparam', this.getexceloutparam)
+    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
   }
 
   /**
@@ -792,23 +938,19 @@
     this.setState = () => {
       return
     }
+    MKEmitter.removeListener('reloadData', this.reloadData)
+    MKEmitter.removeListener('getexceloutparam', this.getexceloutparam)
+    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
   }
 
   render() {
-    const { config, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, triggerBtn, chartId, selectedData } = this.state
+    const { config, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, chartId, selectedData } = this.state
 
     return (
       <div className="subtable" id={'subtable' + this.props.MenuID}>
         {loadingview && <Spin />}
-        {searchlist && searchlist.length > 0 ?
-          <SubSearch
-            BID={this.props.BID}
-            dict={this.state.dict}
-            searchlist={searchlist}
-            menuType={this.props.menuType}
-            dataManager={this.props.dataManager}
-            refreshdata={this.refreshbysearch}
-          /> : null
+        {searchlist && searchlist.length ?
+          <SubSearch BID={this.props.BID} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
         }
         {config ? <Row className="chart-view" gutter={16}>
           {/* 瑙嗗浘缁� */}
@@ -827,39 +969,35 @@
                     <SubAction
                       setting={setting}
                       actions={actions}
+                      columns={columns}
                       Tab={this.props.Tab}
                       BID={this.props.BID}
-                      triggerBtn={triggerBtn}
                       BData={this.props.BData}
                       MenuID={this.props.MenuID}
                       selectedData={selectedData}
-                      logcolumns={this.state.logcolumns}
-                      refreshdata={this.refreshbyaction}
                       ContainerId={this.props.ContainerId}
-                      operations={config.gridBtn.operations || []}
-                      getexceloutparam={this.getexceloutparam}
                     />
                   </div>
                   <div className="subtable-box">
                     {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && this.state.data && this.state.data.length > 0 ?
-                      <Switch title="鏀惰捣" className="subtable-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={pickup} onChange={this.pickupChange} /> : null
+                      <Switch title="鏀惰捣" className="subtable-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" checked={pickup} onChange={this.pickupChange} /> : null
                     }
                     <SubTable
                       tableId={this.props.Tab.uuid}
                       pickup={pickup}
-                      config={config}
                       setting={setting}
                       columns={columns}
                       pageSize={pageSize}
                       dict={this.state.dict}
                       data={this.state.data}
+                      BData={this.props.BData}
                       total={this.state.total}
                       MenuID={this.props.MenuID}
                       loading={this.state.loading}
+                      statFValue={this.state.statFValue}
+                      ContainerId={this.props.ContainerId}
                       refreshdata={this.refreshbytable}
-                      buttonTrigger={this.buttonTrigger}
                       handleTableId={this.handleTableId}
-                      resetTable={this.state.resetTable}
                       chgSelectData={this.changeSelectedData}
                     />
                   </div>
@@ -867,10 +1005,11 @@
               )
             } else if (item.chartType === 'card') {
               return (
-                <Col span={item.width} key={item.uuid}>
+                <Col className="card-view" span={item.width} key={item.uuid}>
                   <CardComponent
                     plot={item}
                     config={config}
+                    columns={columns}
                     Tab={this.props.Tab}
                     BID={this.props.BID}
                     BData={this.props.BData}
@@ -878,10 +1017,7 @@
                     MenuID={this.props.MenuID}
                     loading={this.state.loading}
                     tableId={this.props.Tab.uuid}
-                    logcolumns={this.state.logcolumns}
-                    refreshdata={this.refreshbyaction}
                     handleTableId={this.handleTableId}
-                    getexceloutparam={this.getexceloutparam}
                   />
                 </Col>
               )
@@ -894,7 +1030,6 @@
                     BID={this.props.BID}
                     Tab={this.props.Tab}
                     data={this.state.data}
-                    getexceloutparam={this.getexceloutparam}
                     loading={this.state.loading}
                   />
                 </Col>
@@ -910,19 +1045,14 @@
 
 const mapStateToProps = (state) => {
   return {
-    tabviews: state.tabviews,
     menuType: state.editLevel,
     permAction: state.permAction,
-    permRoles: state.permRoles,
     permMenus: state.permMenus,
-    dataManager: state.dataManager,
   }
 }
 
-const mapDispatchToProps = (dispatch) => {
-  return {
-    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews))
-  }
+const mapDispatchToProps = () => {
+  return {}
 }
 
 export default connect(mapStateToProps, mapDispatchToProps)(SubTabViewTable)
\ No newline at end of file

--
Gitblit v1.8.0