king
2020-03-17 5c8860f3cd8921e7eb0da7749628e9dc669b3203
src/tabviews/commontable/index.jsx
@@ -9,17 +9,18 @@
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import Utils from '@/utils/utils.js'
import asyncComponent from '@/utils/asyncComponent'
// import asyncComponent from '@/utils/asyncComponent'
import asyncLoadComponent from '@/utils/asyncLoadComponent'
import {refreshTabView, modifyTabview} from '@/store/action'
import MainTable from './mainTable'
import MainAction from '@/tabviews/tableshare/actionList'
import VerifyCard from '@/tabviews/tableshare/verifycard'
import MainSearch from '@/tabviews/tableshare/topSearch'
import NotFount from '@/components/404'
import './index.scss'
const MainAction = asyncComponent(() => import('@/tabviews/tableshare/actionList'))
// const MainAction = asyncComponent(() => import('@/tabviews/tableshare/actionList'))
const SubTable = asyncLoadComponent(() => import('@/tabviews/subtable'))
const SubTabTable = asyncLoadComponent(() => import('@/tabviews/subtabtable'))
const FormTab = asyncLoadComponent(() => import('@/tabviews/formtab'))
@@ -80,6 +81,7 @@
      MenuID: this.props.MenuID
    }
    let result = await Api.getSystemCacheConfig(param)
    if (result.status) {
      let config = ''
      let userConfig = ''
@@ -125,6 +127,35 @@
        if (!config[group]) return
        config[group] = config[group].filter(tab => permAction[tab.linkTab])
      })
      // 字段权限黑名单
      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
        }
      })
      if (userConfig) {
@@ -176,10 +207,6 @@
      config.columns.forEach(col => {
        if (col.field) {
          _arrField.push(col.field)
          // if () { // 权限黑名单
          //   col.Hide = 'true'
          // }
          _logcolumns.push(col)
        }
@@ -262,11 +289,12 @@
      
      let istrigger = false
      actions.forEach(item => {
        if (!item.shortcut || istrigger) return
        if (!item.shortcut || typeof(item.shortcut) !== 'object' || istrigger) return
        if (preKey === item.shortcut && keyCode === item.shortcutkey) {
        if (preKey === item.shortcut[0] && keyCode === item.shortcut[1]) {
          e.preventDefault()
          istrigger = true
          this.refs.mainButton.actionTrigger(item)
        }
      })
@@ -897,6 +925,9 @@
        this.setState({
          settingVisible: false,
          confirmLoading: false
        }, () => {
          window.GLOB.CacheMap = new Map()
          this.reloadview()
        })
      })
    })
@@ -946,7 +977,7 @@
            /> : null
          }
          {actions && setting.onload !== 'false' ?
            <div style={{minHeight: '45px'}}>
            <div style={{minHeight: '25px'}}>
              <MainAction
                ref="mainButton"
                BID=""
@@ -956,6 +987,7 @@
                actions={actions}
                dict={this.state.dict}
                MenuID={this.props.MenuID}
                permRoles={this.props.permRoles}
                logcolumns={this.state.logcolumns}
                ContainerId={this.state.ContainerId}
                refreshdata={this.refreshbyaction}
@@ -1101,7 +1133,8 @@
  return {
    tabviews: state.tabviews,
    refreshTab: state.refreshTab,
    permAction: state.permAction
    permAction: state.permAction,
    permRoles: state.permRoles
  }
}