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

调整表格自适应

上级 e05212c8
...@@ -883,7 +883,7 @@ class FormList extends React.Component { ...@@ -883,7 +883,7 @@ class FormList extends React.Component {
showMobileDiv, showMobileDiv,
isView isView
} = this.state } = this.state
let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度 let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度
let isMobile = scrollWidth < 1200 let isMobile = scrollWidth < 1200
...@@ -891,7 +891,6 @@ class FormList extends React.Component { ...@@ -891,7 +891,6 @@ class FormList extends React.Component {
isMobile = true isMobile = true
} }
let showDiv = document.querySelector('#mobelDiv')&&document.querySelector('#mobelDiv')?.parentNode.clientWidth let showDiv = document.querySelector('#mobelDiv')&&document.querySelector('#mobelDiv')?.parentNode.clientWidth
console.log(showDiv)
const parentMethods = { const parentMethods = {
handleAdd: this.handleAdd, handleAdd: this.handleAdd,
handleModalVisible: this.handleModalVisible, handleModalVisible: this.handleModalVisible,
...@@ -1037,7 +1036,7 @@ class FormList extends React.Component { ...@@ -1037,7 +1036,7 @@ class FormList extends React.Component {
<div <div
id='mobelDiv' id='mobelDiv'
style={{ style={{
overflow:'auto', overflow:'hidden',
width: isMobile?showMobileDiv:showDiv, width: isMobile?showMobileDiv:showDiv,
height: '100%' height: '100%'
}} }}
...@@ -1045,9 +1044,10 @@ class FormList extends React.Component { ...@@ -1045,9 +1044,10 @@ class FormList extends React.Component {
<div <div
> >
<StandardTable {
showHeader={this.props.showHeader!=null?this.props.showHeader:true} showDiv&&<StandardTable
noSelectRow={rights==null|| !rights.includes('delete') } showHeader={this.props.showHeader!=null?this.props.showHeader:true}
noSelectRow={rights==null|| !rights.includes('delete') }
rowKey="id" rowKey="id"
data={data} data={data}
columns={this.columns} columns={this.columns}
...@@ -1058,6 +1058,7 @@ class FormList extends React.Component { ...@@ -1058,6 +1058,7 @@ class FormList extends React.Component {
onChange={this.handleStandardTableChange} onChange={this.handleStandardTableChange}
loading={this.props.loading} loading={this.props.loading}
/> />
}
</div> </div>
</div> </div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论