From 5c8860f3cd8921e7eb0da7749628e9dc669b3203 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 17 三月 2020 10:19:16 +0800
Subject: [PATCH] 2020-03-17

---
 src/tabviews/subtabtable/index.jsx |   53 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 44 insertions(+), 9 deletions(-)

diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx
index 23910cf..c8c0d50 100644
--- a/src/tabviews/subtabtable/index.jsx
+++ b/src/tabviews/subtabtable/index.jsx
@@ -4,18 +4,22 @@
 import { is, fromJS } from 'immutable'
 import { notification, Spin} from 'antd'
 import moment from 'moment'
+
 import Api from '@/api'
-import asyncComponent from '@/utils/asyncComponent'
-import SubTable from '@/tabviews/subtable/subTable'
-import SubSearch from '@/tabviews/tableshare/topSearch'
-import NotFount from '@/components/404'
 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 asyncComponent from '@/utils/asyncComponent'
+import SubTable from '@/tabviews/subtable/subTable'
+import SubAction from '@/tabviews/tableshare/actionList'
+import SubSearch from '@/tabviews/tableshare/topSearch'
+import NotFount from '@/components/404'
+
 import './index.scss'
 
-const SubAction = asyncComponent(() => import('@/tabviews/tableshare/actionList'))
+// const SubAction = asyncComponent(() => import('@/tabviews/tableshare/actionList'))
 
 class SubTabModalTable extends Component {
   static propTpyes = {
@@ -100,6 +104,35 @@
       // 鏉冮檺杩囨护
       if (this.props.menuType !== 'HS') {
         config.action = config.action.filter(item => permAction[item.uuid])
+
+        // 瀛楁鏉冮檺榛戝悕鍗�
+        config.search = config.search.filter(item => {
+          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) {
+            return false
+          } else {
+            return true
+          }
+        })
+  
+        config.columns = config.columns.filter(col => {
+          if (!col.field || !col.blacklist || col.blacklist.length === 0) return true
+  
+          let _black = col.blacklist.filter(v => {
+            return this.props.permRoles.indexOf(v) !== -1
+          })
+  
+          if (_black.length > 0) {
+            return false
+          } else {
+            return true
+          }
+        })
       }
 
       // 1銆佺瓫閫夊瓧娈甸泦锛�2銆佽繃婊ら殣钘忓垪鍙婂悎骞跺垪涓殑瀛楁uuid
@@ -615,7 +648,7 @@
           /> : null
         }
         {actions ?
-          <div style={{minHeight: '45px'}}>
+          <div style={{minHeight: '25px'}}>
             <SubAction
               ref="subtabButton"
               type="subtab"
@@ -623,11 +656,12 @@
               setting={setting}
               actions={actions}
               BID={this.props.BID}
-              BData={this.props.BData}
               dict={this.state.dict}
+              BData={this.props.BData}
               MenuID={this.props.SupMenuID}
-              ContainerId={this.props.ContainerId}
+              permRoles={this.props.permRoles}
               refreshdata={this.refreshbyaction}
+              ContainerId={this.props.ContainerId}
               gettableselected={this.gettableselected}
             />
           </div> : null
@@ -656,7 +690,8 @@
 
 const mapStateToProps = (state) => {
   return {
-    permAction: state.permAction
+    permAction: state.permAction,
+    permRoles: state.permRoles
   }
 }
 

--
Gitblit v1.8.0