king
2020-06-02 a181fc113d024ed34d6b488c65882961bd1de3f4
src/tabviews/commontable/index.jsx
@@ -173,6 +173,8 @@
      config.tabgroups.forEach(group => {
        group.sublist = group.sublist.filter(tab => permAction[tab.linkTab])
      })
      // 去除空行标签
      config.tabgroups = config.tabgroups.filter(group => group.sublist.length > 0)
      // 视图权限
      config.charts = config.charts.filter(item => {
@@ -255,7 +257,6 @@
      let _tabActive = {} // 筛选展开的tab页
      config.tabgroups.forEach(group => {
        if (group.sublist.length === 0) return
        _tabActive[group.uuid] = group.sublist[0].uuid
      })
@@ -928,9 +929,11 @@
  handleMainTable = (type, tab) => {
    if (type === 'maingrid' && tab.supMenu === 'mainTable') {
      this.reloadtable()
    } else if (type === 'maingrid' && tab.supMenu) {
    } else if (type === 'mainline' && tab.supMenu === 'mainTable') {
      this.reloadtable()
    } else if ((type === 'maingrid' || type === 'mainline') && tab.supMenu) {
      this.setState({
        refreshtabs: [tab.supMenu]
        refreshtabs: [type, tab.supMenu]
      }, () => {
        this.setState({
          refreshtabs: null
@@ -1445,41 +1448,37 @@
            })}
          </div> : null }
          {setting && setting.onload !== 'false' &&
            config.tabgroups.map(group => {
              if (group.sublist.length === 0) return null
              return (
                <Tabs activeKey={tabActive[group.uuid]} key={group.uuid} onChange={(key) => this.setState({tabActive: {...tabActive, [group.uuid]: key}})}>
                  {group.sublist.map(_tab => {
                    return (
                      <TabPane tab={
                        <span>
                          {_tab.icon ? <Icon type={_tab.icon} /> : null}
                          {_tab.label}
                        </span>
                      } key={_tab.uuid}>
                        {_tab.type === 'SubTable' ?
                          <SubTable
                            Tab={_tab}
                            menuType="main"
                            MenuID={_tab.linkTab}
                            mainSearch={_tab.searchPass === 'true' ? search : null}
                            userConfig={userConfig ? userConfig[_tab.uuid] : null}
                            triggerBtn={triggerBtn}
                            SupMenuID={this.props.MenuID}
                            refreshtabs={this.state.refreshtabs}
                            ContainerId={this.state.ContainerId}
                            BID={this.state.BIDs[_tab.supMenu] || ''}
                            BData={this.state.BIDs[_tab.supMenu + 'data'] || ''}
                            handleTableId={this.handleTableId}
                            handleMainTable={(type) => this.handleMainTable(type, _tab)}
                          /> : null}
                      </TabPane>
                    )
                  })}
                </Tabs>
              )
            })
            config.tabgroups.map(group => (
              <Tabs activeKey={tabActive[group.uuid]} key={group.uuid} onChange={(key) => this.setState({tabActive: {...tabActive, [group.uuid]: key}})}>
                {group.sublist.map(_tab => {
                  return (
                    <TabPane tab={
                      <span>
                        {_tab.icon ? <Icon type={_tab.icon} /> : null}
                        {_tab.label}
                      </span>
                    } key={_tab.uuid}>
                      {_tab.type === 'SubTable' ?
                        <SubTable
                          Tab={_tab}
                          menuType="main"
                          MenuID={_tab.linkTab}
                          mainSearch={_tab.searchPass === 'true' ? search : null}
                          userConfig={userConfig ? userConfig[_tab.uuid] : null}
                          triggerBtn={triggerBtn}
                          SupMenuID={this.props.MenuID}
                          refreshtabs={this.state.refreshtabs}
                          ContainerId={this.state.ContainerId}
                          BID={this.state.BIDs[_tab.supMenu] || ''}
                          BData={this.state.BIDs[_tab.supMenu + 'data'] || ''}
                          handleTableId={this.handleTableId}
                          handleMainTable={(type) => this.handleMainTable(type, _tab)}
                        /> : null}
                    </TabPane>
                  )
                })}
              </Tabs>)
            )
          }
          <Button
            icon="copy"