king
2020-03-17 5c8860f3cd8921e7eb0da7749628e9dc669b3203
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
  }
}