@@ -18,3 +18,3 @@ /** | ||
| // 提取父组件属性值,BBDTable主要是对以下几个参数做操作 | ||
| let { url, params, pageNum, pageSize, domain, localFilter, key } = this.props; | ||
| let { url, params, pageNum, pageSize, domain = '', localFilter, key } = this.props; | ||
@@ -107,3 +107,3 @@ // 组件的分页属性,分页属性不暴露给外部, 需要区别antd本身的pagination | ||
| this._resetHeight(); | ||
| // this._resetHeight(); | ||
| } | ||
@@ -118,10 +118,13 @@ | ||
| let { url, domain, params, pageSize, pageNum } = this.state; | ||
| domain = domain ? {domain} : ''; | ||
| let _data = Object.assign({}, params, {pageSize: pageSize, pageNum: pageNum}); | ||
| let self = this; | ||
| new CorsPromise({ | ||
| const request = { | ||
| url: url, | ||
| type: 'get', | ||
| data: _data, | ||
| domain: domain | ||
| }).then(res => { | ||
| ...domain | ||
| }; | ||
| new CorsPromise(request).then(res => { | ||
| // 解析网络数据 | ||
@@ -155,3 +158,3 @@ let { dataSource, _pagination } = this.state; | ||
| this._resetHeight(); | ||
| // this._resetHeight(); | ||
| }); | ||
@@ -257,7 +260,7 @@ } | ||
| render() { | ||
| let { _pagination, _key, pageSize, dataSource, tableStyle, scroll: scrollNew } = this.state; | ||
| const {style = tableStyle, scroll = scrollNew, rowKey} = this.props; | ||
| let { _pagination, _key, pageSize, dataSource, tableStyle } = this.state; | ||
| const {style, scroll, rowKey = 'id'} = this.props; | ||
| return (<div className="plutus-ui-table-root" ref={this._ComponentDomRef} key={_key}> | ||
| <Table className="table-table" style={style} {...this.props} loading={false} pagination={false} | ||
| rowKey={'id'} dataSource={dataSource} scroll={scroll} key={_key + 'table'}/> | ||
| rowKey={rowKey} dataSource={dataSource} scroll={scroll} key={_key + 'table'}/> | ||
| {this.state.pagination && <div className="table-pagination"> | ||
@@ -264,0 +267,0 @@ <Pagination className="pagination-content" total={_pagination.count} current={_pagination.curNum} onChange={this._changePage} |
+1
-1
@@ -44,3 +44,3 @@ { | ||
| }, | ||
| "version": "0.2.39" | ||
| "version": "0.2.40" | ||
| } |
43938
0.13%751
0.27%