king
2020-02-09 6d0137932fcc8f9848123743c1aad5cff8172d8a
src/tabviews/commontable/index.jsx
@@ -4,17 +4,19 @@
import { is, fromJS } from 'immutable'
import { BackTop, notification, Spin, Tabs, Icon, Switch, Modal, Button} from 'antd'
import moment from 'moment'
import Api from '@/api'
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/asyncLoadComponent'
import {refreshTabView, modifyTabview} from '@/store/action'
import MainTable from './mainTable'
import MainAction from '@/tabviews/tableshare/actionList'
import MainSearch from '@/tabviews/tableshare/topSearch'
import SubTable from '@/tabviews/subtable'
import NotFount from '@/components/404'
import asyncComponent from '@/utils/asyncLoadComponent'
import {refreshTabView, modifyTabview} from '@/store/action'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import Utils from '@/utils/utils.js'
import './index.scss'
const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable'))
@@ -29,6 +31,7 @@
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    ContainerId: Utils.getuuid(), // 菜单外层html Id
    loadingview: true,    // 页面加载中
    viewlost: false,      // 页面丢失:1、未获取到配置-页面丢失;2、页面未启用
    lostmsg: '',          // 页面丢失时的提示信息
@@ -36,7 +39,7 @@
    searchlist: null,     // 搜索条件
    actions: null,        // 按钮集
    columns: null,        // 显示列
    logcolumns: null,     // 日志中显示的列信息
    logcolumns: null,     // 日志中显示的列信息 (增加至全部列,除去合并列)
    arr_field: '',        // 使用 sPC_Get_TableData 时的查询字段集
    setting: null,        // 页面全局设置:数据源、按钮及显示列固定、主键等
    data: null,           // 列表数据集
@@ -47,7 +50,6 @@
    orderColumn: '',      // 排序字段
    orderType: 'asc',     // 排序方式
    search: '',           // 搜索条件数组,使用时需分场景处理
    configMap: {},        // 页面配置信息:下拉、按钮等
    BIDs: {},             // 上级表id
    setsingle: false,     // 主表单选多选切换
    pickup: false,        // 主表数据隐藏显示切换
@@ -116,10 +118,7 @@
        if (col.field) {
          _arrField.push(col.field)
          // 筛选出日志中的显示列,取前四个
          if (col.Hide !== 'true' && _logcolumns.length < 4) {
            _logcolumns.push(col)
          }
          _logcolumns.push(col)
        }
        if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列
          _hideCol = _hideCol.concat(col.sublist)
@@ -542,7 +541,6 @@
      orderColumn: '',
      orderType: 'asc',
      search: '',
      configMap: {},
      BIDs: {},
      setsingle: false,
      pickup: false,
@@ -765,7 +763,7 @@
    const { setting, searchlist, actions, columns, loadingview, viewlost, setsingle, pickup, isLinkMain, config } = this.state
    return (
      <div className={'commontable ' + (isLinkMain ? 'pick-control' : '')} id={'commontable' + this.props.MenuID}>
      <div className={'commontable ' + (isLinkMain ? 'pick-control' : '')} id={this.state.ContainerId}>
        {loadingview && <Spin size="large" />}
        {searchlist && searchlist.length > 0 ?
          <MainSearch
@@ -781,9 +779,10 @@
            type="main"
            setting={setting}
            actions={actions}
            logcolumns={this.state.logcolumns}
            dict={this.state.dict}
            MenuID={this.props.MenuID}
            logcolumns={this.state.logcolumns}
            ContainerId={this.state.ContainerId}
            refreshdata={this.refreshbyaction}
            triggerPopview={this.triggerPopview}
            gettableselected={this.gettableselected}
@@ -833,6 +832,7 @@
                          Tab={_tab}
                          MenuID={_tab.linkTab}
                          SupMenuID={this.props.MenuID}
                          ContainerId={this.state.ContainerId}
                          BID={this.state.BIDs[_tab.supMenu] || ''}
                          BData={this.state.BIDs[_tab.supMenu + 'data'] || ''}
                          handleTableId={this.handleTableId}
@@ -857,7 +857,15 @@
          ]}
          destroyOnClose
        >
          {<SubTabTable SupMenuID={this.props.MenuID} MenuID={this.state.popAction.linkTab} BID={''} ID={this.state.popData ? this.state.popData[setting.primaryKey] : ''} refreshSupView={this.reloadtable} />}
          {<SubTabTable
            BID={''}
            SupMenuID={this.props.MenuID}
            MenuID={this.state.popAction.linkTab}
            BData={this.state.BIDs['mainTabledata'] || ''}
            ContainerId={this.state.ContainerId}
            ID={this.state.popData ? this.state.popData[setting.primaryKey] : ''}
            refreshSupView={this.reloadtable}
          />}
        </Modal>
        <BackTop>
          <div className="ant-back-top">