From 89e7167a83e0d8409ca87698e4c08651a37cc26e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 12 六月 2020 18:19:35 +0800
Subject: [PATCH] 2020-06-12

---
 src/tabviews/commontable/index.jsx |  742 +++++++++++++++++----------------------------------------
 1 files changed, 221 insertions(+), 521 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index 37488e6..b378b02 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -11,20 +11,22 @@
 import Utils from '@/utils/utils.js'
 import asyncComponent from '@/utils/asyncComponent'
 import asyncSpinComponent from '@/utils/asyncSpinComponent'
-import {refreshTabView, modifyTabview} from '@/store/action'
+import { refreshTabView } from '@/store/action'
 
-import MainTable from '@/tabviews/zshare/normalTable'
 import MainSearch from '@/tabviews/zshare/topSearch'
 import NotFount from '@/components/404'
 import './index.scss'
 
+// 閫氱敤缁勪欢
 const MainAction = asyncSpinComponent(() => import('@/tabviews/zshare/actionList'))
-const VerifyCard = asyncComponent(() => import('@/tabviews/zshare/verifycard'))
+const MainTable = asyncSpinComponent(() => import('@/tabviews/zshare/normalTable'))
+const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent'))
 const SubTable = asyncSpinComponent(() => import('@/tabviews/subtable'))
-const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable'))
-const FormTab = asyncComponent(() => import('@/tabviews/formtab'))
 const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent'))
 const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent'))
+
+// 鑷畾涔夋爣绛�
+const SecretKeyTable = asyncSpinComponent(() => import('./secretKeyTable'))
 
 const { TabPane } = Tabs
 const { TreeNode } = Tree
@@ -41,13 +43,11 @@
   state = {
     dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     ContainerId: Utils.getuuid(), // 鑿滃崟澶栧眰html Id
-    view: 'commontable',  // 褰撳墠椤甸潰榛樿涓轰富琛�
     loadingview: true,    // 椤甸潰鍔犺浇涓�
     viewlost: false,      // 椤甸潰涓㈠け锛�1銆佹湭鑾峰彇鍒伴厤缃�-椤甸潰涓㈠け锛�2銆侀〉闈㈡湭鍚敤
     lostmsg: '',          // 椤甸潰涓㈠け鏃剁殑鎻愮ず淇℃伅
     config: {},           // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷寜閽�佹悳绱€�佹樉绀哄垪銆佹爣绛剧瓑
     userConfig: null,     // 鐢ㄦ埛鑷畾涔夎缃�
-    userParam: null,      // 淇濆瓨鐢ㄦ埛缂栬緫涓殑閰嶇疆
     searchlist: null,     // 鎼滅储鏉′欢
     actions: null,        // 鎸夐挳闆�
     columns: null,        // 鏄剧ず鍒�
@@ -55,6 +55,8 @@
     arr_field: '',        // 浣跨敤 sPC_Get_TableData 鏃剁殑鏌ヨ瀛楁闆�
     setting: null,        // 椤甸潰鍏ㄥ眬璁剧疆锛氭暟鎹簮銆佹寜閽強鏄剧ず鍒楀浐瀹氥�佷富閿瓑
     data: null,           // 鍒楄〃鏁版嵁闆�
+    selectedData: [],     // 宸查�夎〃鏍兼暟鎹�
+    resetTable: false,    // 琛ㄦ牸閲嶇疆锛屽�煎湪true涓巉alse涔嬮棿鍒囨崲锛屽垏鎹㈡椂琛ㄦ牸閲嶇疆
     total: 0,             // 鎬绘暟
     loading: false,       // 鍒楄〃鏁版嵁鍔犺浇涓�
     pageIndex: 1,         // 椤电爜
@@ -63,16 +65,8 @@
     search: '',           // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞�
     BIDs: {},             // 涓婄骇琛╥d
     pickup: false,        // 涓昏〃鏁版嵁闅愯棌鏄剧ず鍒囨崲
-    popAction: false,     // 寮规椤甸潰锛屾寜閽俊鎭�
-    popData: null,        // 寮规椤甸潰锛屾墍閫夌殑琛ㄦ牸鏁版嵁
-    visible: false,       // 寮规鏄剧ず闅愯棌鎺у埗
     treevisible: false,   // 鑿滃崟缁撴瀯鏍戝脊妗嗘樉绀洪殣钘忔帶鍒�
-    tabBtn: null,         // 琛ㄥ崟鏍囩鎸夐挳
-    tabParam: null,       // 琛ㄥ崟鏍囩鍙傛暟
     refreshtabs: null,    // 闇�瑕佸埛鏂扮殑鏍囩闆�
-    confirmLoading: false,// 鑷畾涔夎缃ā鎬佹鍔犺浇涓�
-    revertLoading: false, // 鎭㈠榛樿璁剧疆
-    settingVisible: false,// 鑷畾涔夎缃ā鎬佹
     triggerBtn: null,     // 鐐瑰嚮琛ㄦ牸涓垨蹇嵎閿Е鍙戠殑鎸夐挳
     tabActive: null,      // 鏍囩椤靛睍寮�鎺у埗
     chartId: ''           // 灞曞紑鍥捐〃ID
@@ -102,7 +96,8 @@
         config = ''
       }
       
-      if (result.LongParamUser) {
+      // HS涓嶄娇鐢ㄨ嚜瀹氫箟璁剧疆
+      if (result.LongParamUser && this.props.menuType !== 'HS') {
         try { // 閰嶇疆淇℃伅瑙f瀽
           userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser)))
           _curUserConfig = userConfig[this.props.MenuID]
@@ -154,27 +149,33 @@
       let chartId = ''
       if (!config.charts) {
         config.expand = true
-        config.charts = [{
-          uuid: Utils.getuuid(),
-          label: '',
-          title: '',
-          chartType: 'table',
-          icon: 'table',
-          Hide: 'false',
-          blacklist: []
-        }]
+        config.charts = [{ uuid: Utils.getuuid(), label: '', title: '', chartType: 'table', icon: 'table', Hide: 'false', blacklist: [] }]
       } else if (config.charts.length === 1) {
         config.expand = true
       }
       chartId = config.charts[0].uuid
 
       // 鏉冮檺杩囨护
-      config.action = config.action.filter(item => permAction[item.uuid])
-      config.tabgroups.forEach(group => {
-        group.sublist = group.sublist.filter(tab => permAction[tab.linkTab])
-      })
+      if (this.props.menuType !== 'HS') {
+        config.action = config.action.filter(item => permAction[item.uuid])
+        config.tabgroups.forEach(group => {
+          group.sublist = group.sublist.filter(tab => permAction[tab.linkTab])
+        })
+      }
       // 鍘婚櫎绌鸿鏍囩
       config.tabgroups = config.tabgroups.filter(group => group.sublist.length > 0)
+
+      // HS涓嬭嚜瀹氫箟澶勭悊鐨勬爣绛�
+      if (this.props.menuType === 'HS') {
+        config.tabgroups.forEach(group => {
+          group.sublist = group.sublist.map(tab => {
+            if (tab.linkTab === '1586577325055l2ng7t75g7i4ek2ng8o') {
+              tab.type = 'SecretKeyTable'
+            }
+            return tab
+          })
+        })
+      }
 
       // 瑙嗗浘鏉冮檺
       config.charts = config.charts.filter(item => {
@@ -224,6 +225,9 @@
           return true
         }
       })
+
+      // 鏍囪涓婚〉闈紝鐢ㄤ簬鎸夐挳鍥哄畾鍙婅〃鍗曟寕杞借缃�
+      config.setting.tabType = 'main'
 
       if (_curUserConfig) {
         config.setting = {...config.setting, ..._curUserConfig.setting}
@@ -285,7 +289,6 @@
       config.columns.forEach(col => {
         if (col.field) {
           _arrField.push(col.field)
-
           _logcolumns.push(col)
         }
         if (col.type === 'colspan' && col.sublist) { // 绛涢�夐殣钘忓垪
@@ -320,15 +323,13 @@
           _columns.push(col)
         }
       })
-
+      
       if (config.gridBtn && config.gridBtn.display && _operations.length > 0) {
-        _columns.push({
-          ...config.gridBtn,
-          operations: _operations
-        })
+        config.gridBtn.operations = _operations
+        _columns.push(config.gridBtn)
       }
 
-      let valid = true // 鎼滅储鏉′欢蹇呭~楠岃瘉, 鍒濆鎼滅储鏉′欢
+      let valid = true // 鎼滅储鏉′欢蹇呭~楠岃瘉, 鍒濆鎼滅储鏉′欢, 濡傞�氳繃涓婄骇閫忚锛屽啓鍏ユ悳绱㈡潯浠�
       let initSearch = config.search.map(item => {
         let _item = JSON.parse(JSON.stringify(item))
         if (_item.type === 'text' && param && param.searchkey === _item.field) {
@@ -807,9 +808,9 @@
         this.loadmaindata()
       })
     } else {
-      this.refs.mainTable && this.refs.mainTable.resetTable()
-
       this.setState({
+        resetTable: !this.state.resetTable,
+        selectedData: [],
         pageIndex: 1,
         search: searches
       }, () => {
@@ -831,6 +832,7 @@
     }
 
     this.setState({
+      selectedData: [],
       pageIndex: pagination.current,
       pageSize: pagination.pageSize,
       orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : ''
@@ -843,8 +845,9 @@
    * @description 琛ㄦ牸鍒锋柊
    */
   reloadtable = () => {
-    this.refs.mainTable && this.refs.mainTable.resetTable()
     this.setState({
+      resetTable: !this.state.resetTable,
+      selectedData: [],
       pageIndex: 1
     }, () => {
       this.loadmaindata()
@@ -855,28 +858,9 @@
    * @description 椤甸潰鍒锋柊锛岄噸鏂拌幏鍙栭厤缃�
    */
   reloadview = () => {
-    this.setState({
-      view: 'commontable',
-      loadingview: true,
-      viewlost: false,
-      lostmsg: '',
-      config: {},
-      userConfig: null,
-      userParam: null,
-      searchlist: null,
-      actions: null,
-      columns: null,
-      arr_field: '',
-      setting: null,
-      data: null,
-      total: 0,
-      loading: false,
-      pageIndex: 1,
-      pageSize: 10,
-      orderBy: '',
-      search: '',
-      BIDs: {},
-      pickup: false
+    this.setState({ loadingview: true, viewlost: false, lostmsg: '', config: {}, userConfig: null, searchlist: null,
+      actions: null, columns: null, arr_field: '', setting: null, data: null, total: 0, loading: false, pageIndex: 1,
+      pageSize: 10, orderBy: '', search: '', BIDs: {}, pickup: false
     }, () => {
       this.loadconfig()
     })
@@ -885,37 +869,12 @@
   /**
    * @description 鎸夐挳鎿嶄綔瀹屾垚鍚庯紙鎴愬姛鎴栧け璐ワ級锛岄〉闈㈠埛鏂帮紝閲嶇疆椤电爜鍙婇�夋嫨椤�
    */
-  refreshbyaction = (btn, type) => {
-    if (btn.execSuccess === 'grid' && type === 'success') {
+  refreshbyaction = (position) => {
+    if (position === 'grid') {
       this.reloadtable()
-    } else if (btn.execError === 'grid' && type === 'error') {
-      this.reloadtable()
-    } else if (btn.execSuccess === 'view' && type === 'success') {
+    } else if (position === 'view') {
       this.reloadview()
-    } else if (btn.execError === 'view' && type === 'error') {
-      this.reloadview()
-    } else if (btn.popClose === 'view' && type === 'pop') {
-      this.reloadview()
-    } else if (btn.popClose === 'grid' && type === 'pop') {
-      this.reloadtable()
     }
-  }
-
-  /**
-   * @description 琛ㄥ崟鎿嶄綔瀹屾垚鍚庡埛鏂颁富椤甸潰
-   */
-  refreshbyformtab = (type) => {
-    this.setState({
-      view: 'commontable',
-      tabBtn: null,
-      tabParam: null
-    }, () => {
-      if (type === 'grid') {
-        this.reloadtable()
-      } else if (type === 'view') {
-        this.reloadview()
-      }
-    })
   }
 
   /**
@@ -961,14 +920,10 @@
   }
 
   /**
-   * @description 鑾峰彇琛ㄦ牸閫夋嫨椤�
+   * @description 琛ㄦ牸閫夋嫨椤瑰垏鎹�
    */
-  gettableselected = () => {
-    let data = []
-    this.refs.mainTable && this.refs.mainTable.state.selectedRowKeys.forEach(item => {
-      data.push(this.refs.mainTable.props.data[item])
-    })
-    return data
+  changeSelectedData = (selectedData) => {
+    this.setState({selectedData})
   }
 
   /**
@@ -1008,84 +963,6 @@
     this.setState({
       pickup: !pickup
     })
-  }
-
-  /**
-   * @description 瑙﹀彂鎸夐挳寮圭獥锛堟爣绛鹃〉锛�
-   */
-  triggerPopview = (btn, data) => {
-    const { setting } = this.state
-
-    let _primaryId = ''
-
-    if (data && data[0] && setting.primaryKey) {
-      _primaryId = data[0][setting.primaryKey] || ''
-    }
-
-    if (btn.OpenType === 'popview') {
-      this.setState({
-        popAction: btn,
-        popData: data[0] || null,
-        visible: true
-      })
-    } else if (btn.OpenType === 'tab') {
-      const { tabviews, MenuNo, MenuID } = this.props
-      let newtab = {
-        MenuNo: MenuNo,
-        MenuID: btn.uuid,
-        MenuName: btn.label,
-        type: btn.tabTemplate,
-        selected: true,
-        param: {
-          menuType: 'main',
-          parentId: this.props.MenuID,
-          btn: btn,
-          data: data[0] || null,
-          primaryId: btn.Ot !== 'notRequired' ? _primaryId : '',
-          arr_field: this.state.arr_field
-        }
-      }
-
-      let index = 0
-      let isexit = false
-      let tabs = tabviews.map((tab, i) => {
-        tab.selected = false
-
-        if (tab.MenuID === MenuID) {
-          index = i
-        } else if (tab.MenuID === btn.uuid) {
-          tab.selected = true
-          isexit = true
-        }
-
-        return tab
-      })
-
-      if (!isexit) {
-        tabs.splice(index + 1, 0, newtab)
-      }
-
-      this.props.modifyTabview(tabs)
-    } else if (btn.OpenType === 'blank') {
-      this.setState({
-        view: 'formtab',
-        tabBtn: btn,
-        tabParam: {
-          menuType: 'main',
-          btn: btn,
-          data: data[0] || null,
-          primaryId: btn.Ot !== 'notRequired' ? _primaryId : '',
-          arr_field: this.state.arr_field
-        }
-      })
-    }
-  }
-
-  popclose = () => {
-    this.setState({
-      visible: false
-    })
-    this.refreshbyaction(this.state.popAction, 'pop')
   }
 
   handleviewconfig = (e) => {
@@ -1147,127 +1024,6 @@
     })
   }
 
-  controlCustomSetting = () => {
-    this.setState({
-      settingVisible: true,
-      confirmLoading: false,
-      revertLoading: false
-    })
-  }
-
-  changeMenuParam = (param) => {
-    this.setState({userParam: param})
-  }
-
-  linkTrigger = (menu) => {
-    const { tabviews, MenuID } = this.props
-    
-    menu.selected = true
-
-    let index = 0
-    let isexit = false
-    let tabs = tabviews.map((tab, i) => {
-      tab.selected = false
-
-      if (tab.MenuID === MenuID) {
-        index = i
-      } else if (tab.MenuID === menu.MenuID) {
-        tab.param = menu.param
-        tab.selected = true
-        isexit = true
-      }
-
-      return tab
-    })
-
-    if (!isexit) {
-      tabs.splice(index + 1, 0, menu)
-    }
-
-    this.props.modifyTabview(tabs)
-  }
-
-  settingRevert = () => {
-    let param = {
-      func: 's_TrdMenu_UserParam_del',
-      MenuID: this.props.MenuID
-    }
-    this.setState({
-      revertLoading: true
-    })
-
-    Api.getSystemConfig(param).then(result => {
-      if (!result.status) {
-        this.setState({
-          revertLoading: false
-        })
-        notification.warning({
-          top: 92,
-          message: result.message,
-          duration: 5
-        })
-        return
-      }
-      this.setState({
-        settingVisible: false,
-        revertLoading: false
-      }, () => {
-        window.GLOB.CacheMap = new Map()
-        this.reloadview()
-      })
-    })
-  }
-
-  settingSubmit = () => {
-    const { userParam } = this.state
-    let _LongParam = ''
-
-    try {
-      _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(userParam)))
-    } catch (e) {
-      notification.warning({
-        top: 92,
-        message: '缂栬瘧閿欒',
-        duration: 5
-      })
-      return
-    }
-
-    let easyCode = userParam[this.props.MenuID] ? userParam[this.props.MenuID].easyCode : ''
-
-    let param = {
-      func: 'sPC_TrdMenu_UserParam',
-      MenuID: this.props.MenuID,
-      EasyCode: easyCode || '',
-      LongParam: _LongParam
-    }
-
-    this.setState({
-      confirmLoading: true
-    })
-
-    Api.getSystemConfig(param).then(result => {
-      if (!result.status) {
-        this.setState({
-          confirmLoading: false
-        })
-        notification.warning({
-          top: 92,
-          message: result.message,
-          duration: 5
-        })
-        return
-      }
-      this.setState({
-        settingVisible: false,
-        confirmLoading: false
-      }, () => {
-        window.GLOB.CacheMap = new Map()
-        this.reloadview()
-      })
-    })
-  }
-
   /**
    * @description 鍥捐〃瑙嗗浘鍒囨崲
    */
@@ -1298,7 +1054,6 @@
         if (item.type === 'text' && item.key === nextProps.param.searchkey) {
           item.value = nextProps.param.searchval
         }
-
         return item
       })
       this.refreshbysearch(search)
@@ -1320,238 +1075,184 @@
   }
 
   render() {
-    const { view, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, triggerBtn, userConfig, tabActive, chartId, search } = this.state
+    const { setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, triggerBtn, userConfig, tabActive, chartId, search, selectedData } = this.state
 
     return (
-      <div>
-        {view === 'commontable' ? <div className="commontable pick-control" id={this.state.ContainerId}>
-          {loadingview && <Spin size="large" />}
-          {searchlist && searchlist.length > 0 ?
-            <MainSearch
-              ref="mainSearch"
-              dict={this.state.dict}
-              searchlist={searchlist}
-              refreshdata={this.refreshbysearch}
-            /> : null
-          }
-          {setting && setting.onload !== 'false' ? <div className="chart-view">
-            {/* 瑙嗗浘缁� */}
-            {!config.expand ? <Tabs activeKey={chartId} onChange={this.changeChart}>
-              {config.charts.map(item => (
-                <TabPane tab={<Icon type={item.icon} />} key={item.uuid}></TabPane>
-              ))}
-            </Tabs> : null}
-            {config.charts.map(item => {
-              if (!config.expand && chartId !== item.uuid) return null
+      <div className="commontable pick-control" id={this.state.ContainerId}>
+        {loadingview && <Spin size="large" />}
+        {searchlist && searchlist.length > 0 ?
+          <MainSearch
+            dict={this.state.dict}
+            searchlist={searchlist}
+            refreshdata={this.refreshbysearch}
+          /> : null
+        }
+        {setting && setting.onload !== 'false' ? <div className="chart-view">
+          {/* 瑙嗗浘缁� */}
+          {!config.expand ? <Tabs activeKey={chartId} onChange={this.changeChart}>
+            {config.charts.map(item => (
+              <TabPane tab={<Icon type={item.icon} />} key={item.uuid}></TabPane>
+            ))}
+          </Tabs> : null}
+          {config.charts.map(item => {
+            if (!config.expand && chartId !== item.uuid) return null
 
-              if (item.chartType === 'table') {
-                return (
-                  <Col span={item.width || 24} key={item.uuid}>
-                    {config.charts.length > 1 && item.title ? <p className="chart-table chart-title">{item.title}</p> : null}
-                    <div style={{minHeight: '25px'}}>
-                      <MainAction
-                        type="main"
-                        menuType="main"
-                        setting={setting}
-                        actions={actions}
-                        triggerBtn={triggerBtn}
-                        dict={this.state.dict}
-                        MenuID={this.props.MenuID}
-                        logcolumns={this.state.logcolumns}
-                        ContainerId={this.state.ContainerId}
-                        refreshdata={this.refreshbyaction}
-                        triggerPopview={this.triggerPopview}
-                        getexceloutparam={this.getexceloutparam}
-                        gettableselected={this.gettableselected}
-                      />
-                    </div>
-                    <div className="main-table-box">
-                      <Icon className="custom-control" type="setting" onClick={this.controlCustomSetting} />
-                      {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && this.state.data && this.state.data.length > 0 ?
-                        <Switch title="鏀惰捣" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={pickup} onChange={this.pickupChange} /> : null
-                      }
-                      <MainTable
-                        ref="mainTable"
-                        tableId="mainTable"
-                        pickup={pickup}
-                        config={config}
-                        setting={setting}
-                        columns={columns}
-                        pageSize={pageSize}
-                        dict={this.state.dict}
-                        data={this.state.data}
-                        total={this.state.total}
-                        MenuID={this.props.MenuID}
-                        memberLevel={this.props.memberLevel}
-                        loading={this.state.loading}
-                        pagination={setting.laypage !== 'false'}
-                        refreshdata={this.refreshbytable}
-                        buttonTrigger={this.buttonTrigger}
-                        linkTrigger={this.linkTrigger}
-                        handleTableId={this.handleTableId}
-                      />
-                    </div>
-                  </Col>
-                )
-              } else if (item.chartType === 'card') {
-                return (
-                  <Col span={item.width} key={item.uuid}>
-                    <CardComponent
-                      plot={item}
+            if (item.chartType === 'table') {
+              return (
+                <Col span={item.width || 24} key={item.uuid}>
+                  {config.charts.length > 1 && item.title ? <p className="chart-table chart-title">{item.title}</p> : null}
+                  <div style={{minHeight: '25px'}}>
+                    <MainAction
+                      setting={setting}
+                      actions={actions}
+                      dict={this.state.dict}
+                      triggerBtn={triggerBtn}
+                      MenuID={this.props.MenuID}
+                      selectedData={selectedData}
+                      logcolumns={this.state.logcolumns}
+                      ContainerId={this.state.ContainerId}
+                      operations={config.gridBtn.operations || []}
+                      refreshdata={this.refreshbyaction}
+                      getexceloutparam={this.getexceloutparam}
+                    />
+                  </div>
+                  <div className="main-table-box">
+                    {this.props.menuType !== 'HS' ? <SettingComponent
                       config={config}
+                      columns={columns}
+                      dict={this.state.dict}
+                      MenuID={this.props.MenuID}
+                      MenuName={this.props.MenuName}
+                      permAction={this.props.permAction}
+                      permRoles={this.props.permRoles}
+                      userConfig={this.state.userConfig}
+                      reloadview={this.reloadview}
+                    /> : null}
+                    {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && this.state.data && this.state.data.length > 0 ?
+                      <Switch title="鏀惰捣" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={pickup} onChange={this.pickupChange} /> : null
+                    }
+                    <MainTable
                       tableId="mainTable"
-                      loading={this.state.loading}
+                      pickup={pickup}
+                      config={config}
+                      setting={setting}
+                      columns={columns}
+                      pageSize={pageSize}
+                      dict={this.state.dict}
                       data={this.state.data}
+                      total={this.state.total}
+                      MenuID={this.props.MenuID}
+                      loading={this.state.loading}
+                      refreshdata={this.refreshbytable}
                       buttonTrigger={this.buttonTrigger}
                       handleTableId={this.handleTableId}
+                      resetTable={this.state.resetTable}
+                      chgSelectData={this.changeSelectedData}
                     />
-                    <div style={{display: 'none'}}>
-                      <MainAction
-                        type="main"
-                        menuType="main"
-                        setting={setting}
-                        actions={actions}
-                        triggerBtn={triggerBtn}
-                        dict={this.state.dict}
-                        MenuID={this.props.MenuID}
-                        permRoles={this.props.permRoles}
-                        dataManager={this.props.dataManager}
-                        logcolumns={this.state.logcolumns}
-                        ContainerId={this.state.ContainerId}
-                        refreshdata={this.refreshbyaction}
-                        triggerPopview={this.triggerPopview}
-                        getexceloutparam={this.getexceloutparam}
-                        gettableselected={this.gettableselected}
-                      />
-                    </div>
-                  </Col>
-                )
-              } else {
-                return (
-                  <Col span={item.width} key={item.uuid}>
-                    <ChartComponent
-                      plot={item}
-                      config={config}
-                      data={this.state.data}
-                      loading={this.state.loading}
-                    />
-                  </Col>
-                )
-              }
-            })}
-          </div> : null }
-          {setting && setting.onload !== 'false' &&
-            config.tabgroups.map(group => (
-              <Tabs activeKey={tabActive[group.uuid]} key={group.uuid} onChange={(key) => this.setState({tabActive: {...tabActive, [group.uuid]: key}})}>
-                {group.sublist.map(_tab => {
-                  return (
-                    <TabPane tab={
-                      <span>
-                        {_tab.icon ? <Icon type={_tab.icon} /> : null}
-                        {_tab.label}
-                      </span>
-                    } key={_tab.uuid}>
-                      {_tab.type === 'SubTable' ?
-                        <SubTable
-                          Tab={_tab}
-                          menuType="main"
-                          MenuID={_tab.linkTab}
-                          mainSearch={_tab.searchPass === 'true' ? search : null}
-                          userConfig={userConfig ? userConfig[_tab.uuid] : null}
-                          triggerBtn={triggerBtn}
-                          SupMenuID={this.props.MenuID}
-                          refreshtabs={this.state.refreshtabs}
-                          ContainerId={this.state.ContainerId}
-                          BID={this.state.BIDs[_tab.supMenu] || ''}
-                          BData={this.state.BIDs[_tab.supMenu + 'data'] || ''}
-                          handleTableId={this.handleTableId}
-                          handleMainTable={(type) => this.handleMainTable(type, _tab)}
-                        /> : null}
-                    </TabPane>
-                  )
-                })}
-              </Tabs>)
-            )
-          }
-          <Button
-            icon="copy"
-            shape="circle"
-            className="common-table-copy"
-            onClick={this.handleviewconfig}
-          />
-          <Modal
-            className="popview-modal"
-            title={this.state.popAction.label}
-            width={'80vw'}
-            maskClosable={false}
-            visible={this.state.visible}
-            onCancel={this.popclose}
-            footer={[
-              <Button key="close" onClick={this.popclose}>{this.state.dict['main.close']}</Button>
-            ]}
-            destroyOnClose
-          >
-            {<SubTabTable 
-              BID={this.state.popData ? this.state.popData[setting.primaryKey] : ''}
-              menuType="main"
-              SupMenuID={this.props.MenuID}
-              MenuID={this.state.popAction.linkTab}
-              BData={this.state.popData || ''}
-              ContainerId={this.state.ContainerId}
-              refreshSupView={this.reloadtable}
-            />}
-          </Modal>
-          <Modal
-            className="menu-tree-modal"
-            title={'鑿滃崟缁撴瀯鏍�'}
-            width={'650px'}
-            maskClosable={false}
-            visible={this.state.treevisible}
-            onCancel={() => this.setState({treevisible: false})}
-            footer={[
-              <Button key="close" onClick={() => this.setState({treevisible: false})}>{this.state.dict['main.close']}</Button>
-            ]}
-            destroyOnClose
-          >
-            <div className="menu-header">
-              <span>鑿滃崟鍚嶇О锛歿this.props.MenuName}</span>
-              <span>鑿滃崟鍙傛暟锛歿<Paragraph copyable>{this.props.MenuNo}</Paragraph>}</span>
-            </div>
-            {this.state.treevisible ? <Tree defaultExpandAll showLine={true}>
-              {this.getTreeNode(config.funcs)}
-            </Tree> : null}
-          </Modal>
-          {/* 鎸夐挳浣跨敤绯荤粺瀛樺偍杩囩▼鏃讹紝楠岃瘉淇℃伅妯℃�佹 */}
-          <Modal
-            wrapClassName="common-table-custom-modal"
-            title={'鑷畾涔夎缃�'}
-            maskClosable={false}
-            width={950}
-            visible={this.state.settingVisible}
-            onCancel={() => { this.setState({ settingVisible: false }) }}
-            footer={[
-              <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>{this.state.dict['main.revert.default']}</Button>,
-              <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['main.cancel']}</Button>,
-              <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>{this.state.dict['main.submit']}</Button>
-            ]}
-            destroyOnClose
-          >
-            {this.state.settingVisible ?
-              <VerifyCard
-                MenuID={this.props.MenuID}
-                MenuName={this.props.MenuName}
-                permAction={this.props.permAction}
-                permRoles={this.props.permRoles}
-                config={this.state.config}
-                userConfig={this.state.userConfig}
-                columns={this.state.columns}
-                handleParam={this.changeMenuParam}
-              /> : null
+                  </div>
+                </Col>
+              )
+            } else if (item.chartType === 'card') {
+              return (
+                <Col span={item.width} key={item.uuid}>
+                  <CardComponent
+                    plot={item}
+                    config={config}
+                    tableId="mainTable"
+                    data={this.state.data}
+                    MenuID={this.props.MenuID}
+                    loading={this.state.loading}
+                    logcolumns={this.state.logcolumns}
+                    ContainerId={this.state.ContainerId}
+                    refreshdata={this.refreshbyaction}
+                    handleTableId={this.handleTableId}
+                  />
+                </Col>
+              )
+            } else {
+              return (
+                <Col span={item.width} key={item.uuid}>
+                  <ChartComponent
+                    plot={item}
+                    config={config}
+                    data={this.state.data}
+                    loading={this.state.loading}
+                  />
+                </Col>
+              )
             }
-          </Modal>
-          {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
-        </div> : null}
-        {view === 'formtab' ? <FormTab MenuID={this.state.tabBtn.uuid} param={this.state.tabParam} refresh={this.refreshbyformtab}/> : null}
+          })}
+        </div> : null }
+        {setting && setting.onload !== 'false' &&
+          config.tabgroups.map(group => (
+            <Tabs activeKey={tabActive[group.uuid]} key={group.uuid} onChange={(key) => this.setState({tabActive: {...tabActive, [group.uuid]: key}})}>
+              {group.sublist.map(_tab => {
+                return (
+                  <TabPane tab={
+                    <span>
+                      {_tab.icon ? <Icon type={_tab.icon} /> : null}
+                      {_tab.label}
+                    </span>
+                  } key={_tab.uuid}>
+                    {_tab.type === 'SubTable' ?
+                      <SubTable
+                        Tab={_tab}
+                        MenuID={_tab.linkTab}
+                        mainSearch={_tab.searchPass === 'true' ? search : null}
+                        userConfig={userConfig ? userConfig[_tab.uuid] : null}
+                        triggerBtn={triggerBtn}
+                        SupMenuID={this.props.MenuID}
+                        refreshtabs={this.state.refreshtabs}
+                        ContainerId={this.state.ContainerId}
+                        BID={this.state.BIDs[_tab.supMenu] || ''}
+                        BData={this.state.BIDs[_tab.supMenu + 'data'] || ''}
+                        handleTableId={this.handleTableId}
+                        handleMainTable={(type) => this.handleMainTable(type, _tab)}
+                      /> : null}
+                    {_tab.type === 'SecretKeyTable' ?
+                      <SecretKeyTable
+                        Tab={_tab}
+                        MenuID={_tab.linkTab}
+                        SupMenuID={this.props.MenuID}
+                        refreshtabs={this.state.refreshtabs}
+                        ContainerId={this.state.ContainerId}
+                        BID={this.state.BIDs[_tab.supMenu] || ''}
+                        BData={this.state.BIDs[_tab.supMenu + 'data'] || ''}
+                        handleMainTable={(type) => this.handleMainTable(type, _tab)}
+                      /> : null}
+                  </TabPane>
+                )
+              })}
+            </Tabs>)
+          )
+        }
+        <Button
+          icon="copy"
+          shape="circle"
+          className="common-table-copy"
+          onClick={this.handleviewconfig}
+        />
+        <Modal
+          className="menu-tree-modal"
+          title={'鑿滃崟缁撴瀯鏍�'}
+          width={'650px'}
+          maskClosable={false}
+          visible={this.state.treevisible}
+          onCancel={() => this.setState({treevisible: false})}
+          footer={[
+            <Button key="close" onClick={() => this.setState({treevisible: false})}>{this.state.dict['main.close']}</Button>
+          ]}
+          destroyOnClose
+        >
+          <div className="menu-header">
+            <span>鑿滃崟鍚嶇О锛歿this.props.MenuName}</span>
+            <span>鑿滃崟鍙傛暟锛歿<Paragraph copyable>{this.props.MenuNo}</Paragraph>}</span>
+          </div>
+          {this.state.treevisible ? <Tree defaultExpandAll showLine={true}>
+            {this.getTreeNode(config.funcs)}
+          </Tree> : null}
+        </Modal>
+        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
       </div>
     )
   }
@@ -1559,20 +1260,19 @@
 
 const mapStateToProps = (state) => {
   return {
+    menuType: state.editLevel,
     tabviews: state.tabviews,
     refreshTab: state.refreshTab,
     permAction: state.permAction,
     permMenus: state.permMenus,
     permRoles: state.permRoles,
-    memberLevel: state.memberLevel,
     dataManager: state.dataManager
   }
 }
 
 const mapDispatchToProps = (dispatch) => {
   return {
-    refreshTabView: (refreshTab) => dispatch(refreshTabView(refreshTab)),
-    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews))
+    refreshTabView: (refreshTab) => dispatch(refreshTabView(refreshTab))
   }
 }
 

--
Gitblit v1.8.0