提交 277a00bd authored 作者: chscls@163.com's avatar chscls@163.com

增加表格选择事件

上级 f5f29b85
...@@ -40,7 +40,8 @@ export default class TableList extends React.Component { ...@@ -40,7 +40,8 @@ export default class TableList extends React.Component {
} }
render() { render() {
return <FormList return <FormList
onSelectRow={this.props.value.onSelectRow}
istableCom={true} istableCom={true}
showHeader={this.props.showHeader} showHeader={this.props.showHeader}
get={this.props.get} get={this.props.get}
......
...@@ -626,6 +626,9 @@ class FormList extends React.Component { ...@@ -626,6 +626,9 @@ class FormList extends React.Component {
}; };
handleSelectRows = rows => { handleSelectRows = rows => {
if(this.props.onSelectRow){
this.props.onSelectRow(rows)
}
this.setState({ this.setState({
selectedRows: rows, selectedRows: rows,
}); });
...@@ -1063,7 +1066,7 @@ class FormList extends React.Component { ...@@ -1063,7 +1066,7 @@ class FormList extends React.Component {
(!istableCom)||(this.props.value&&this.props.value.columns)? (!istableCom)||(this.props.value&&this.props.value.columns)?
<StandardTable <StandardTable
showHeader={this.props.showHeader!=null?this.props.showHeader:true} showHeader={this.props.showHeader!=null?this.props.showHeader:true}
noSelectRow={rights==null|| !rights.includes('delete') } noSelectRow={this.props.onSelectRow==null&&( rights==null|| !rights.includes('delete')) }
rowKey="id" rowKey="id"
data={data} data={data}
isHiddenPage={this.props.isHiddenPage!=null?this.props.isHiddenPage:false} isHiddenPage={this.props.isHiddenPage!=null?this.props.isHiddenPage:false}
...@@ -1093,7 +1096,7 @@ class FormList extends React.Component { ...@@ -1093,7 +1096,7 @@ class FormList extends React.Component {
{ {
showDiv&&<StandardTable showDiv&&<StandardTable
showHeader={this.props.showHeader!=null?this.props.showHeader:true} showHeader={this.props.showHeader!=null?this.props.showHeader:true}
noSelectRow={rights==null|| !rights.includes('delete') } noSelectRow={this.props.onSelectRow==null&&( rights==null|| !rights.includes('delete')) }
rowKey="id" rowKey="id"
data={data} data={data}
columns={this.columns} columns={this.columns}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论