提交 ff62637b authored 作者: 徐立's avatar 徐立

修复滚动bug

上级 c401787e
...@@ -425,7 +425,7 @@ class FormList extends React.Component { ...@@ -425,7 +425,7 @@ class FormList extends React.Component {
this.columns = this.props.value.columns; this.columns = this.props.value.columns;
let cacheList = []; let cacheList = [];
let cacheChecked = []; let cacheChecked = [];
console.log(this.props.value.columns) console.log(this.props.value.columns);
// 表头筛选逻辑 // 表头筛选逻辑
Array.isArray(this.props.value.columns) && Array.isArray(this.props.value.columns) &&
this.props.value.columns.map(item => { this.props.value.columns.map(item => {
...@@ -436,7 +436,7 @@ class FormList extends React.Component { ...@@ -436,7 +436,7 @@ class FormList extends React.Component {
cacheChecked.push(item.dataIndex); cacheChecked.push(item.dataIndex);
}); });
this.checkList = cacheList; this.checkList = cacheList;
this.setState({ this.setState({
checkedList: cacheChecked, checkedList: cacheChecked,
cacheColumns: cloneDeep(this.props.value.columns), cacheColumns: cloneDeep(this.props.value.columns),
...@@ -1117,10 +1117,10 @@ class FormList extends React.Component { ...@@ -1117,10 +1117,10 @@ class FormList extends React.Component {
valueName, valueName,
notShowBack, notShowBack,
istableCom, // 是否有模板设计器调用 istableCom, // 是否有模板设计器调用
value:{btns}, value: { btns },
loading loading,
} = this.props; } = this.props;
const { showMobileDiv, isView } = this.state; const { showMobileDiv, isView } = this.state;
let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度 let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度
...@@ -1283,7 +1283,9 @@ class FormList extends React.Component { ...@@ -1283,7 +1283,9 @@ class FormList extends React.Component {
返回 返回
</Button> </Button>
)} )}
{btns&&btns.before&&btns.before.length>0?btns.before.map((r)=><Button {...r} loading={loading}/>):""} {btns && btns.before && btns.before.length > 0
? btns.before.map(r => <Button {...r} loading={loading} />)
: ''}
{rights && !rights.includes('add') ? ( {rights && !rights.includes('add') ? (
'' ''
) : ( ) : (
...@@ -1365,24 +1367,38 @@ class FormList extends React.Component { ...@@ -1365,24 +1367,38 @@ class FormList extends React.Component {
</Button> </Button>
</Popover> </Popover>
)} )}
{btns&&btns.after&&btns.after.length>0?btns.after.map((r)=><Button {...r} loading={loading}/>):""} {btns && btns.after && btns.after.length > 0
? btns.after.map(r => <Button {...r} loading={loading} />)
: ''}
</div> </div>
{!istableCom || (this.props.value && this.props.value.columns) ? ( {!istableCom || (this.props.value && this.props.value.columns) ? (
<StandardTable <div
showHeader={this.props.showHeader != null ? this.props.showHeader : true} id="mobelDiv"
noSelectRow={ style={{
this.props.onSelectRow == null && (rights == null || !rights.includes('delete')) overflow: 'hidden',
} width: isMobile ? showMobileDiv : showDiv,
rowKey="id" height: '100%',
data={data} }}
isHiddenPage={this.props.isHiddenPage != null ? this.props.isHiddenPage : false} >
columns={this.columns} {showDiv && (
scroll={this.props.value && this.props.value.columns ? {} : { x: AllWidth }} <StandardTable
selectedRows={selectedRows} showHeader={this.props.showHeader != null ? this.props.showHeader : true}
onSelectRow={this.handleSelectRows} noSelectRow={
onChange={this.handleStandardTableChange} this.props.onSelectRow == null &&
loading={this.props.loading} (rights == null || !rights.includes('delete'))
/> }
rowKey="id"
data={data}
isHiddenPage={this.props.isHiddenPage != null ? this.props.isHiddenPage : false}
columns={this.columns}
scroll={{ x: AllWidth }}
selectedRows={selectedRows}
onSelectRow={this.handleSelectRows}
onChange={this.handleStandardTableChange}
loading={this.props.loading}
/>
)}
</div>
) : ( ) : (
<div <div
id="mobelDiv" id="mobelDiv"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论