mirror of https://github.com/openspug/spug
U 优化表格分页支持调整pageSize
parent
30c0dfe146
commit
56df2145a2
|
@ -17,6 +17,7 @@ class ComTable extends React.Component {
|
||||||
groupMap: {}
|
groupMap: {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
store.fetchRecords();
|
store.fetchRecords();
|
||||||
if (groupStore.records.length === 0) {
|
if (groupStore.records.length === 0) {
|
||||||
|
@ -65,7 +66,17 @@ class ComTable extends React.Component {
|
||||||
data = data.filter(item => item['name'].toLowerCase().includes(store.f_name.toLowerCase()))
|
data = data.filter(item => item['name'].toLowerCase().includes(store.f_name.toLowerCase()))
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,17 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
{store.formVisible && <ComForm/>}
|
{store.formVisible && <ComForm/>}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|
|
@ -91,7 +91,17 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
{store.formVisible && <ComForm/>}
|
{store.formVisible && <ComForm/>}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|
|
@ -66,7 +66,17 @@ class ComTable extends React.Component {
|
||||||
data = data.filter(item => item['name'].toLowerCase().includes(store.f_name.toLowerCase()))
|
data = data.filter(item => item['name'].toLowerCase().includes(store.f_name.toLowerCase()))
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,17 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
{store.formVisible && <ComForm/>}
|
{store.formVisible && <ComForm/>}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|
|
@ -66,7 +66,17 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
{store.formVisible && <ComForm/>}
|
{store.formVisible && <ComForm/>}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|
|
@ -64,7 +64,17 @@ class Record extends React.Component {
|
||||||
title={`${store.env.name} - 更改历史记录`}
|
title={`${store.env.name} - 更改历史记录`}
|
||||||
onCancel={() => store.recordVisible = false}
|
onCancel={() => store.recordVisible = false}
|
||||||
footer={null}>
|
footer={null}>
|
||||||
<Table rowKey="id" loading={loading} dataSource={records} columns={this.columns} />
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={loading}
|
||||||
|
dataSource={records}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,18 @@ class TableView extends React.Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Table size="small" rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
size="small"
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
{store.formVisible && <ComForm/>}
|
{store.formVisible && <ComForm/>}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|
|
@ -134,6 +134,12 @@ class ComTable extends React.Component {
|
||||||
loading={store.isFetching}
|
loading={store.isFetching}
|
||||||
dataSource={data}
|
dataSource={data}
|
||||||
expandedRowRender={this.expandedRowRender}
|
expandedRowRender={this.expandedRowRender}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
columns={this.columns}/>
|
columns={this.columns}/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,17 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,17 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
{store.formVisible && <ComForm/>}
|
{store.formVisible && <ComForm/>}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|
|
@ -84,7 +84,17 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
{store.formVisible && <ComForm/>}
|
{store.formVisible && <ComForm/>}
|
||||||
{store.importVisible && <ComImport/>}
|
{store.importVisible && <ComImport/>}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|
|
@ -147,7 +147,17 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
{store.formVisible && <ComForm/>}
|
{store.formVisible && <ComForm/>}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|
|
@ -48,7 +48,17 @@ class Record extends React.Component {
|
||||||
title={`任务执行记录 - ${store.record.name}`}
|
title={`任务执行记录 - ${store.record.name}`}
|
||||||
onCancel={() => store.recordVisible = false}
|
onCancel={() => store.recordVisible = false}
|
||||||
footer={null}>
|
footer={null}>
|
||||||
<Table rowKey="id" columns={this.columns} dataSource={this.state.records} loading={this.state.loading}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
columns={this.columns}
|
||||||
|
dataSource={this.state.records}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
loading={this.state.loading}/>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,17 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
{store.formVisible && <ComForm/>}
|
{store.formVisible && <ComForm/>}
|
||||||
{store.infoVisible && <Info/>}
|
{store.infoVisible && <Info/>}
|
||||||
{store.recordVisible && <Record/>}
|
{store.recordVisible && <Record/>}
|
||||||
|
|
|
@ -116,7 +116,17 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
{store.formVisible && <ComForm/>}
|
{store.formVisible && <ComForm/>}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
|
|
|
@ -64,7 +64,17 @@ class ComTable extends React.Component {
|
||||||
data = data.filter(item => item['name'].toLowerCase().includes(store.f_name.toLowerCase()))
|
data = data.filter(item => item['name'].toLowerCase().includes(store.f_name.toLowerCase()))
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Table rowKey="id" loading={store.isFetching} dataSource={data} columns={this.columns}/>
|
<Table
|
||||||
|
rowKey="id"
|
||||||
|
loading={store.isFetching}
|
||||||
|
dataSource={data}
|
||||||
|
pagination={{
|
||||||
|
showSizeChanger: true,
|
||||||
|
showLessItems: true,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
pageSizeOptions: ['10', '20', '50', '100']
|
||||||
|
}}
|
||||||
|
columns={this.columns}/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue