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/subtable/index.jsx | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 44 insertions(+), 9 deletions(-) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 5a14bc9..afbeaf9 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -4,20 +4,24 @@ import { is, fromJS } from 'immutable' import { notification, Spin, Modal, Button, Switch} from 'antd' import moment from 'moment' + import Api from '@/api' -import SubTable from './subTable' -import SubSearch from '@/tabviews/tableshare/topSearch' -import asyncLoadComponent from '@/utils/asyncLoadComponent' -import asyncComponent from '@/utils/asyncComponent' -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 SubTable from './subTable' +import SubAction from '@/tabviews/tableshare/actionList' +import SubSearch from '@/tabviews/tableshare/topSearch' +import asyncLoadComponent from '@/utils/asyncLoadComponent' +// import asyncComponent from '@/utils/asyncComponent' +import NotFount from '@/components/404' + import './index.scss' const SubTabTable = asyncLoadComponent(() => import('@/tabviews/subtabtable')) -const SubAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) +// const SubAction = asyncComponent(() => import('@/tabviews/tableshare/actionList')) class SubTabViewTable extends Component { static propTpyes = { @@ -120,6 +124,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 @@ -664,7 +697,7 @@ /> : null } {actions ? - <div style={{minHeight: '45px'}}> + <div style={{minHeight: '25px'}}> <SubAction ref="subButton" type="sub" @@ -676,9 +709,10 @@ BData={this.props.BData} dict={this.state.dict} MenuID={this.props.SupMenuID} + permRoles={this.props.permRoles} logcolumns={this.state.logcolumns} - ContainerId={this.props.ContainerId} refreshdata={this.refreshbyaction} + ContainerId={this.props.ContainerId} triggerPopview={this.triggerPopview} getexceloutparam={this.getexceloutparam} gettableselected={this.gettableselected} @@ -737,7 +771,8 @@ const mapStateToProps = (state) => { return { - permAction: state.permAction + permAction: state.permAction, + permRoles: state.permRoles } } -- Gitblit v1.8.0