Skip to content

Commit

Permalink
fix: fix paging selection error
Browse files Browse the repository at this point in the history
  • Loading branch information
wulianyougithub committed Dec 1, 2020
1 parent f5e9f53 commit 3e088c6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
8 changes: 4 additions & 4 deletions config/peer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
export default {
development: {
requestUrl: 'http://localhost:4096',
// requestUrl: 'http://106.15.227.133:8001',
requestUrl: 'http://peer.ddn.link:8000',
// requestUrl: 'http://localhost:4096',
},
test: {
requestUrl: 'http://localhost:8001',
requestUrl: 'http://116.62.219.11:8000',
},
production: {
requestUrl: 'http://106.15.227.133:8001',
requestUrl: 'http://peer.ddn.link:8000',
},
};
2 changes: 1 addition & 1 deletion src/pages/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class Home extends PureComponent {
action={
<span>
<span>{formatMessage({ id: 'app.home.unit' })}: </span>
<span>HBL</span>
<span>DDN</span>
</span>
}
loading={loading}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Transfer/Step3.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Step3 extends React.PureComponent {
<Col xs={24} sm={16}>
<a
// TODO:抽取为常量
href={`http://testnet.ddn.link/transactions/${data.transId}`}
href={`http://mainnet.ddn.link/transactions/${data.transId}`}
target="_blank"
rel="noreferrer noopener"
>
Expand Down
26 changes: 25 additions & 1 deletion src/pages/Vote/DelegatesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class DelegatesList extends PureComponent {
selectedRows: [],
selectedRowKeys: [],
selectedStandbyRows: [],
selectedStandbyRowsAll:[],
// selectedRowsAll:[],
selectedStandbyRowKeys: [],
visibleDelegate: false,
curDelegate: {},
Expand Down Expand Up @@ -104,16 +106,36 @@ class DelegatesList extends PureComponent {
};

handleSelectRows = (selectedRowKeys, selectedRows) => {
// let selectRows=[]
// if(selectedRows.length===selectedRowKeys.length){
// selectRows=selectedRows
// }else{
// selectRows= selectedRowKeys.map(key => (
// this.state.selectedRowsAll.find((row) => row.publicKey === key)
// || selectedRows.find((row) => row.publicKey === key) // 必在两者之中,加感叹号断言(js的去掉这个 "!")
// ))
// }
this.setState({
selectedRows,
selectedRowKeys,
// selectedRowsAll:[...this.state.selectedRowsAll,...selectRows]
});
};

handleSelectStandbyRows = (selectedStandbyRowKeys, selectedStandbyRows) => {
let selectRows=[]
if(selectedStandbyRows.length===selectedStandbyRowKeys.length){
selectRows=selectedStandbyRows
}else{
selectRows= selectedStandbyRowKeys.map(key => (
this.state.selectedStandbyRowsAll.find((row) => row.publicKey === key)
|| selectedStandbyRows.find((row) => row.publicKey === key) // 必在两者之中,加感叹号断言(js的去掉这个 "!")
))
}
this.setState({
selectedStandbyRows,
selectedStandbyRows:selectRows,
selectedStandbyRowKeys,
selectedStandbyRowsAll:[...this.state.selectedStandbyRowsAll,...selectedStandbyRows]
});
};

Expand Down Expand Up @@ -199,6 +221,8 @@ class DelegatesList extends PureComponent {
disabled: record.voted,
}),
};
console.log('selectrows,selectkeys',selectedStandbyRows,
selectedStandbyRowKeys,this.state.selectedStandbyRowsAll)

return (
<div>
Expand Down

0 comments on commit 3e088c6

Please sign in to comment.