From 2f95e9ca3984bba9bfe602596c2401e98e84f323 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 25 五月 2021 10:49:10 +0800 Subject: [PATCH] 2021-05-25 --- src/tabviews/custom/components/table/normal-table/index.jsx | 89 +++++++++++++++++++++++++++++++------------- 1 files changed, 63 insertions(+), 26 deletions(-) diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index c147e6f..2547788 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/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> ) } -- Gitblit v1.8.0