king
2020-01-16 1a67732f77de8afd138b6e75235edcc4c0e9a166
src/tabviews/subtabtable/index.jsx
@@ -1,5 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { notification, Spin} from 'antd'
import moment from 'moment'
@@ -13,7 +14,7 @@
import Utils from '@/utils/utils.js'
import './index.scss'
export default class NormalTable extends Component {
class SubTabModalTable extends Component {
  static propTpyes = {
    BID: PropTypes.string,         // 上级数据ID
    MenuID: PropTypes.string,      // 菜单Id
@@ -46,6 +47,8 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { permAction } = this.props
    let param = {
      func: 'sPC_Get_LongParam',
      MenuID: this.props.MenuID
@@ -85,6 +88,9 @@
      let _hideCol = []      // 隐藏及合并列中字段的uuid集
      let colMap = new Map()
      // 权限过滤
      config.action = config.action.filter(item => permAction[item.uuid])
      // 1、筛选字段集,2、过滤隐藏列及合并列中的字段uuid
      config.columns.forEach(col => {
        if (col.field) {
@@ -117,16 +123,15 @@
        }
      })
      // 添加操作列(存在时)(未经过权限过滤)
      if (config.gridBtn && config.gridBtn.display) {
      let _actions = config.action.filter(item => item.position === 'toolbar') // 过滤工具栏按钮
      let _operations = config.action.filter(item => item.position === 'grid')  // 添加操作列(存在时)
      if (config.gridBtn && config.gridBtn.display && _operations.length > 0) {
        _columns.push({
          ...config.gridBtn,
          operations: config.action.filter(item => item.position === 'grid')
          operations: _operations
        })
      }
      // 过滤工具栏按钮(未经过权限过滤)
      let _actions = config.action.filter(item => item.position === 'toolbar')
      this.setState({
        loadingview: false,
@@ -173,6 +178,11 @@
      if (item.resourceType === '1' && item.dataSource) {
        let arrfield = item.valueField + ',' + item.valueText
        if (item.valueField === item.valueText) { // value 与 text 字段相同时
          arrfield = item.valueField
        }
        if (item.type === 'link') {
          arrfield = arrfield + ',' + item.linkField
        }
@@ -571,4 +581,16 @@
      </div>
    )
  }
}
}
const mapStateToProps = (state) => {
  return {
    permAction: state.permAction
  }
}
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(SubTabModalTable)