提交 85f3241f 编写于 作者: W wcy

修改顶部tab顺序添加事件账户搜索两个接口,添加参与方状态列

上级 224cd9e3
......@@ -14,6 +14,10 @@ const HeaderStore = types
path:'block',
name:'区块',
icon:'block',
},{
path:'user',
name:'用户',
icon:'user',
},{
path:'account',
name:'数据账户',
......@@ -26,10 +30,6 @@ const HeaderStore = types
path:'contract',
name:'合约',
icon:'profile',
},{
path:'user',
name:'用户',
icon:'user',
}],
selectMenu:[''],
}))
......
......@@ -135,6 +135,35 @@ const EventStore = types
).catch(error => {
});
},
searchEvent(ledger,param){
return fetchData(`${__HOST}/ledgers/${ledger}/events/accounts/search`,
self.setEventCount,
param,{
method: 'get',
headers: {
// accept: 'application/json',
cookie: document.cookie,
}
}
).catch(error => {
});
},
eventCountSearch(ledger,keyword){
return fetchData(`${__HOST}/ledgers/${ledger}/events/accounts/count/search`,
self.setEventCount,
{keyword:keyword},{
method: 'get',
headers: {
// accept: 'application/json',
cookie: document.cookie,
}
}
).catch(error => {
});
},
setEventCount(result) {
if (result && result.success) {
self.eventTotal = result.data || 0;
......
......@@ -87,22 +87,22 @@ export default class Header extends Component {
// 交易列表
@computed get tableColumns() {
return [{
title: '参与方ID',
title: 'ID',
dataIndex: 'id',
key:'id'
},
{
title: '参与方名字',
title: '名字',
dataIndex: 'name',
key:'name'
},
{
title: '参与方地址',
title: '地址',
dataIndex: 'address.value',
key:'address'
},
{
title: '参与方公钥',
title: '公钥',
dataIndex: 'pubKey',
key:'pubKey'
},
......@@ -113,6 +113,11 @@ export default class Header extends Component {
render: (text, record, index) => nj `
${tranBase58(text)}
`()
},
{
title: '状态',
dataIndex: 'participantNodeState',
key:'participantNodeState'
}];
}
// 交易列表
......
......@@ -38,6 +38,7 @@ export default class Event extends Component {
onInputChange = e => {
this.eventAddress = e.target.value;
console.log(this.eventAddress);
}
componentDidMount() {
......@@ -76,13 +77,48 @@ export default class Event extends Component {
})
}
onSearchEvent = () => {
const { store: { common, event } } = this.props;
const closeLoading = Message.loading('正在获取数据...', 0);
let leaders = common.getDefaultLedger(),
keyword = this.eventAddress,
param = {
fromIndex: (event.accountcurrent - 1) * this.pageSize,
count: this.pageSize,
};
Promise.all([
event.eventCountSearch(leaders, keyword)
]).then(() => {
if (event.accountcount > 0) {
Promise.all([event.searchEvent(leaders,
param
),
]).then(() => {
closeLoading();
});
}
else {
closeLoading();
}
});
}
@autobind
onPageChange(page, pageSize) {
const { store: { event } } = this.props;
event.setCurrent(page);
this.onSearch();
}
@autobind
SerchInfo() {
console.log(this.eventAddress);
if (this.eventAddress.trim() != '') {
this.onSearchEvent();
}
else {
this.onSearch()
}
}
showEvent = (record, index) => {
const { store: { common, event } } = this.props;
......
......@@ -5,7 +5,7 @@
</h2>
<div style="margin-bottom:20px;" #show={!show}>
<ant-Input style="width:200px;margin-right:20px" value={eventAddress} onChange={onInputChange}/>
<ant-Button style="margin-right:20px" icon="search" type="primary" class="{styles.btn}" onClick={onSearch}>查询</ant-Button>
<ant-Button style="margin-right:20px" icon="search" type="primary" class="{styles.btn}" onClick={SerchInfo}>查询</ant-Button>
</div>
<div class="{styles.datapanel}" #show={!show}>
<ant-Table
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册