king
2020-04-09 b9a0e8541f0959db5d848f7b893c8838851ce411
src/tabviews/subtable/index.jsx
@@ -10,6 +10,7 @@
import enUS from '@/locales/en-US/main.js'
import Utils from '@/utils/utils.js'
import options from '@/store/options.js'
import { modifyTabview } from '@/store/action'
import SubTable from '@/tabviews/zshare/normalTable'
import SubSearch from '@/tabviews/zshare/topSearch'
@@ -88,7 +89,7 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { permAction, Tab, BID, userConfig } = this.props
    const { permAction, permMenus, Tab, BID, userConfig } = this.props
    let param = {
      func: 'sPC_Get_LongParam',
@@ -207,8 +208,14 @@
      })
      // 生成显示列,处理合并列中的字段
      config.columns.forEach(col => {
      config.columns.forEach((col, index) => {
        if (_hideCol.includes(col.uuid)) return
        if (col.linkThdMenu && !permMenus[col.linkThdMenu.MenuID]) {
          col.linkThdMenu = ''
        }
        col.sort = index
        if (col.type === 'colspan' && col.sublist) {
          let _col = JSON.parse(JSON.stringify(col))
@@ -733,6 +740,34 @@
    })
  }
  linkTrigger = (menu) => {
    const { tabviews, SupMenuID } = this.props
    menu.selected = true
    let index = 0
    let isexit = false
    let tabs = tabviews.map((tab, i) => {
      tab.selected = false
      if (tab.MenuID === SupMenuID) {
        index = i
      } else if (tab.MenuID === menu.MenuID) {
        tab.param = menu.param
        tab.selected = true
        isexit = true
      }
      return tab
    })
    if (!isexit) {
      tabs.splice(index + 1, 0, menu)
    }
    this.props.modifyTabview(tabs)
  }
  popclose = () => {
    this.setState({
      visible: false
@@ -812,6 +847,7 @@
              loading={this.state.loading}
              refreshdata={this.refreshbytable}
              buttonTrigger={this.buttonTrigger}
              linkTrigger={this.linkTrigger}
              handleTableId={this.handleTableId}
            />
          </div> : null
@@ -847,13 +883,17 @@
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews,
    permAction: state.permAction,
    permRoles: state.permRoles
    permRoles: state.permRoles,
    permMenus: state.permMenus
  }
}
const mapDispatchToProps = () => {
  return {}
const mapDispatchToProps = (dispatch) => {
  return {
    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews))
  }
}
export default connect(mapStateToProps, mapDispatchToProps)(SubTabViewTable)