king
2021-05-25 2f95e9ca3984bba9bfe602596c2401e98e84f323
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { notification } from 'antd'
import { notification, Collapse } from 'antd'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -18,6 +18,8 @@
const MainAction = asyncComponent(() => import('@/tabviews/zshare/actionList'))
const MainTable = asyncComponent(() => import('@/tabviews/custom/components/share/normalTable'))
const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader'))
const { Panel } = Collapse
class NormalTable extends Component {
  static propTpyes = {
@@ -101,6 +103,10 @@
    }
    if (setting.fontSize) {
      setting.style.fontSize = setting.fontSize
    }
    if (_config.wrap.collapse === 'true') {
      _config.wrap.title = _config.wrap.title || ' '
    }
    this.setState({
@@ -553,33 +559,64 @@
    return (
      <div className="custom-normal-table" style={config.style}>
        <NormalHeader config={config}/>
        {searchlist && searchlist.length ?
          <MainSearch BID={BID} setting={config.wrap} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
        }
        <MainAction
          BID={BID}
          setting={setting}
          actions={actions}
          BData={this.state.BData}
          columns={config.columns}
          selectedData={selectedData}
        />
        <div className={'main-table-box ' + (!actions || actions.length === 0 ? 'no-action' : '')}>
          <MainTable
        {config.wrap.collapse === 'true' ? <Collapse bordered={false} defaultActiveKey="1" expandIconPosition="right">
          <Panel forceRender={true} header={<NormalHeader config={config}/>} key="1">
            {searchlist && searchlist.length ?
              <MainSearch BID={BID} setting={config.wrap} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
            }
            <MainAction
              BID={BID}
              setting={setting}
              actions={actions}
              BData={this.state.BData}
              columns={config.columns}
              selectedData={selectedData}
            />
            <div className={'main-table-box ' + (!actions || actions.length === 0 ? 'no-action' : '')}>
              <MainTable
                setting={setting}
                columns={columns}
                MenuID={config.uuid}
                data={this.state.data}
                fields={config.columns}
                total={this.state.total}
                lineMarks={config.lineMarks}
                loading={this.state.loading}
                refreshdata={this.refreshbytable}
                statFValue={this.state.statFValue}
                chgSelectData={(selects) => this.setState({selectedData: selects})}
              />
            </div>
          </Panel>
        </Collapse> : <>
          <NormalHeader config={config}/>
          {searchlist && searchlist.length ?
            <MainSearch BID={BID} setting={config.wrap} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
          }
          <MainAction
            BID={BID}
            setting={setting}
            columns={columns}
            MenuID={config.uuid}
            data={this.state.data}
            fields={config.columns}
            total={this.state.total}
            lineMarks={config.lineMarks}
            loading={this.state.loading}
            refreshdata={this.refreshbytable}
            statFValue={this.state.statFValue}
            chgSelectData={(selects) => this.setState({selectedData: selects})}
            actions={actions}
            BData={this.state.BData}
            columns={config.columns}
            selectedData={selectedData}
          />
        </div>
          <div className={'main-table-box ' + (!actions || actions.length === 0 ? 'no-action' : '')}>
            <MainTable
              setting={setting}
              columns={columns}
              MenuID={config.uuid}
              data={this.state.data}
              fields={config.columns}
              total={this.state.total}
              lineMarks={config.lineMarks}
              loading={this.state.loading}
              refreshdata={this.refreshbytable}
              statFValue={this.state.statFValue}
              chgSelectData={(selects) => this.setState({selectedData: selects})}
            />
          </div>
        </>}
      </div>
    )
  }