Commit f2fbe67d authored by zhangwenshuai's avatar zhangwenshuai

兼容分页

parent cd9565a6
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
flex-direction: row; flex-direction: row;
border: 1px solid @borderColor; border: 1px solid @borderColor;
overflow: hidden; overflow: hidden;
&.scroll {
height: 100%; height: 100%;
.loading { .loading {
position: absolute; position: absolute;
...@@ -14,7 +13,6 @@ ...@@ -14,7 +13,6 @@
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
z-index: 10; z-index: 10;
} }
}
.leftSideContainer { .leftSideContainer {
box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15); box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.15);
position: absolute; position: absolute;
......
...@@ -449,13 +449,9 @@ export default class AirTable extends Component<TableProps, TableState> { ...@@ -449,13 +449,9 @@ export default class AirTable extends Component<TableProps, TableState> {
{({ onScroll, scrollLeft, scrollTop }: any) => { {({ onScroll, scrollLeft, scrollTop }: any) => {
return ( return (
<div <div
className={ className={styles.tableContainer}
this.props.onScroll
? classNames(styles.tableContainer, styles.scroll)
: styles.tableContainer
}
style={{ style={{
paddingRight: this.props.onScroll ? paddingRight : 0, paddingRight,
}} }}
id={`apolloTable_${tableId}`} id={`apolloTable_${tableId}`}
> >
......
@import '../common'; @import '../common';
.container { .container {
//overflow: hidden;
//height: 100%;
width: 100%; width: 100%;
position: relative; position: relative;
&.scroll {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: calc(100vh - 92px); height: calc(100vh - 92px);
}
.operateContainer { .operateContainer {
} }
.tableContainer { .tableContainer {
position: relative; position: relative;
box-shadow: @boxShadow; box-shadow: @boxShadow;
//min-height: 600px;
&.scroll {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
}
.tableOperateContainer { .tableOperateContainer {
height: 38px; height: 38px;
overflow: hidden; overflow: hidden;
......
...@@ -102,19 +102,11 @@ class AirTable extends React.Component<CommonProps, CommonState> { ...@@ -102,19 +102,11 @@ class AirTable extends React.Component<CommonProps, CommonState> {
return ( return (
<Provider value={{ locale: this.getContext() }}> <Provider value={{ locale: this.getContext() }}>
<div <div
className={ className={classNames(styles.container, className)}
onScroll
? classNames(styles.container, styles.scroll, className)
: classNames(styles.container, className)
}
> >
{operateConfig && <OperateConfig columns={columns} operateConfig={operateConfig} />} {operateConfig && <OperateConfig columns={columns} operateConfig={operateConfig} />}
<div <div
className={ className={classNames(styles.tableContainer, tableClassName)}
onScroll
? classNames(styles.tableContainer, styles.scroll, tableClassName)
: classNames(styles.tableContainer, tableClassName)
}
> >
{tableOperateConfig && ( {tableOperateConfig && (
<div className={styles.tableOperateContainer}> <div className={styles.tableOperateContainer}>
...@@ -128,7 +120,7 @@ class AirTable extends React.Component<CommonProps, CommonState> { ...@@ -128,7 +120,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
dataSource={dataSource} dataSource={dataSource}
rowStyle={rowStyle} rowStyle={rowStyle}
rowClassName={rowClassName} rowClassName={rowClassName}
onScroll={this.onScroll} onScroll={onScroll ? this.onScroll : undefined}
distanceToLoad={distanceToLoad} distanceToLoad={distanceToLoad}
cellEditable={cellEditable} cellEditable={cellEditable}
emitChangeCell={emitChangeCell} emitChangeCell={emitChangeCell}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment