king
2020-12-04 d441fa1e1cc80f4ea462a750a42a2b25c1f2b202
src/tabviews/commontable/index.jsx
@@ -68,7 +68,8 @@
    tabActive: null,      // 标签页展开控制
    chartId: '',          // 展开图表ID
    statFields: [],       // 合计字段
    statFValue: []        // 合计值
    statFValue: [],       // 合计值
    debug: sessionStorage.getItem('debug') === 'true'
  }
  /**
@@ -138,20 +139,12 @@
      // 去除空行标签
      config.tabgroups = config.tabgroups.filter(group => group.sublist.length > 0)
      let roleId = sessionStorage.getItem('role_id') || '' // 角色ID
      // 视图权限
      config.charts = config.charts.filter(item => {
        if (item.Hide === 'true') return false
        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 || item.Hide === 'true') {
          return false
        } else {
          return true
        }
        return item.blacklist.filter(v => roleId.indexOf(v) > -1).length === 0
      })
      if (config.charts.length <= 1) {
@@ -173,12 +166,7 @@
        }
        if (!item.blacklist || item.blacklist.length === 0) return item
        let _black = item.blacklist.filter(v => {
          return this.props.permRoles.indexOf(v) !== -1
        })
        if (_black.length > 0) {
        if (item.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
          item.Hide = 'true'
        }
@@ -186,13 +174,8 @@
      })
      config.columns = config.columns.map(col => {
        if (!col.field || !col.blacklist || col.blacklist.length === 0 || config.setting.primaryKey === col.field) return col
        let _black = col.blacklist.filter(v => {
          return this.props.permRoles.indexOf(v) !== -1
        })
        if (_black.length > 0) {
        if (!col.field || !col.blacklist || col.blacklist.length === 0) return col
        if (col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
          col.Hide = 'true'
        }
@@ -228,7 +211,7 @@
          config.setting.dataresource = '(' + config.setting.dataresource + ') tb'
        }
  
        if (this.props.dataManager) { // 数据权限
        if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
          config.setting.dataresource = config.setting.dataresource.replace(/\$@/ig, '/*')
          config.setting.dataresource = config.setting.dataresource.replace(/@\$/ig, '*/')
          config.setting.customScript = config.setting.customScript.replace(/\$@/ig, '/*')
@@ -512,7 +495,7 @@
    })
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, this.props.dataManager)
    let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType)
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.MenuName || ''
@@ -552,7 +535,7 @@
    })
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, this.props.dataManager, id)
    let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, id)
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.MenuName || ''
@@ -608,7 +591,7 @@
    }
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getStatQueryDataParams(setting, statFields, search, _orderBy, BID, this.props.menuType, this.props.dataManager)
    let param = UtilsDM.getStatQueryDataParams(setting, statFields, search, _orderBy, BID, this.props.menuType)
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.MenuName || ''
@@ -930,7 +913,7 @@
  render() {
    const { menuType, MenuName } = this.props
    const { BID, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, userConfig, tabActive, chartId, search, selectedData } = this.state
    const { debug, BID, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, userConfig, tabActive, chartId, search, selectedData } = this.state
    return (
      <div className="commontable" id={this.state.ContainerId}>
@@ -941,7 +924,6 @@
            dict={this.state.dict}
            searchlist={searchlist}
            menuType={this.props.menuType}
            dataManager={this.props.dataManager}
            refreshdata={this.refreshbysearch}
          /> : null
        }
@@ -982,7 +964,6 @@
                      dict={this.state.dict}
                      MenuID={this.props.MenuID}
                      permAction={this.props.permAction}
                      permRoles={this.props.permRoles}
                      userConfig={this.state.userConfig}
                      reloadview={this.reloadview}
                    /> : null}
@@ -1079,7 +1060,7 @@
            </Tabs>)
          )
        }
        {options.sysType !== 'cloud' && menuType !== 'HS' ? <Button
        {debug && options.sysType !== 'cloud' && menuType !== 'HS' ? <Button
          icon="copy"
          shape="circle"
          className="common-table-copy"
@@ -1116,9 +1097,7 @@
    menuType: state.editLevel,
    tabviews: state.tabviews,
    permAction: state.permAction,
    permMenus: state.permMenus,
    permRoles: state.permRoles,
    dataManager: state.dataManager
    permMenus: state.permMenus
  }
}