Commit 246bf10e authored by chenqikuai's avatar chenqikuai

fix

parent 871807ee
...@@ -55,6 +55,7 @@ export const lang = { ...@@ -55,6 +55,7 @@ export const lang = {
time: "Block Age", time: "Block Age",
hash: "Block Hash", hash: "Block Hash",
txCount: "Txns", txCount: "Txns",
txCount_single: "Txn",
blockRevenue: "Block Revenue", blockRevenue: "Block Revenue",
mineRevenue: "Mining Income", mineRevenue: "Mining Income",
packingAddress: "Pack Addr", packingAddress: "Pack Addr",
...@@ -94,6 +95,10 @@ export const lang = { ...@@ -94,6 +95,10 @@ export const lang = {
}, },
trade: { trade: {
title: "All Txns", title: "All Txns",
filterSucceedTx: "查看成功的交易",
filterFailedTx: "查看失败的交易",
filterSentTx: "查看发出的交易",
filterReceivedTx: "查看接收的交易",
count: "Txns", count: "Txns",
totalTip: "All", totalTip: "All",
tip: "show the last 100,000 entries", tip: "show the last 100,000 entries",
......
...@@ -55,6 +55,7 @@ export const lang = { ...@@ -55,6 +55,7 @@ export const lang = {
time: "块龄", time: "块龄",
hash: "区块哈希", hash: "区块哈希",
txCount: "交易数量", txCount: "交易数量",
txCount_single: "交易数量",
blockRevenue: "区块收益", blockRevenue: "区块收益",
mineRevenue: "挖矿收益", mineRevenue: "挖矿收益",
packingAddress: "打包地址", packingAddress: "打包地址",
...@@ -94,6 +95,10 @@ export const lang = { ...@@ -94,6 +95,10 @@ export const lang = {
}, },
trade: { trade: {
title: "全部交易", title: "全部交易",
filterSucceedTx: "查看成功的交易",
filterFailedTx: "查看失败的交易",
filterSentTx: "查看发出的交易",
filterReceivedTx: "查看接收的交易",
count: "条交易", count: "条交易",
totalTip: "全部", totalTip: "全部",
tip: "显示最近10万条", tip: "显示最近10万条",
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
{{ txCount }} {{ txCount }}
</div> </div>
<div class="text-xs font-bold text-footer-color-light"> <div class="text-xs font-bold text-footer-color-light">
{{ $t('lang.block.txCount') }} {{ txCount === 1 ? $t('lang.block.txCount_single') : $t('lang.block.txCount') }}
</div> </div>
</div> </div>
<div class="msgBox flex-shrink-0 flex-grow mt-3.5 ml-2"> <div class="msgBox flex-shrink-0 flex-grow mt-3.5 ml-2">
......
import { import {
getAddressTxCount, getAddressTxCountOrigin,
getAddrTxList, getAddrTxList_another,
getMakerAddr, getMakerAddr,
getMakerAddrCount, getMakerAddrCount,
getVoterAddr, getVoterAddr,
...@@ -44,6 +44,7 @@ export default Vue.extend({ ...@@ -44,6 +44,7 @@ export default Vue.extend({
packList: [] as iPack[], packList: [] as iPack[],
loadingVote: false, loadingVote: false,
loadingPack: false, loadingPack: false,
selectedTxRecordFilterValue: "all",
}; };
}, },
watch: { watch: {
...@@ -53,6 +54,10 @@ export default Vue.extend({ ...@@ -53,6 +54,10 @@ export default Vue.extend({
this.getMaker(); this.getMaker();
this.getVoter(); this.getVoter();
}, },
selectedTxRecordFilterValue(newValue) {
this.pages.currentPage = 1;
this.getTxList();
},
}, },
mounted() { mounted() {
this.getAllExecBalance(); this.getAllExecBalance();
...@@ -61,6 +66,30 @@ export default Vue.extend({ ...@@ -61,6 +66,30 @@ export default Vue.extend({
this.getVoter(); this.getVoter();
}, },
computed: { computed: {
txRecordFilterOptionList() {
return [
{
name: this.$t("lang.trade.title"),
value: "all",
},
{
name: this.$t("lang.trade.filterSucceedTx"),
value: "filterSucceedTx",
},
{
name: this.$t("lang.trade.filterFailedTx"),
value: "filterFailedTx",
},
{
name: this.$t("lang.trade.filterSentTx"),
value: "filterSentTx",
},
{
name: this.$t("lang.trade.filterReceivedTx"),
value: "filterReceivedTx",
},
];
},
tabList() { tabList() {
return [ return [
{ {
...@@ -107,6 +136,108 @@ export default Vue.extend({ ...@@ -107,6 +136,108 @@ export default Vue.extend({
} }
)?.account?.frozen; )?.account?.frozen;
}, },
txRecordReqParams(): any {
switch (this.selectedTxRecordFilterValue) {
case "all":
return [
{
match_one: [
{
key: "from",
value: this.$route.query.address as string,
},
{
key: "to",
value: this.$route.query.address as string,
},
],
match: [],
},
];
case "filterSucceedTx":
return [
{
match_one: [
{
key: "from",
value: this.$route.query.address as string,
},
{
key: "to",
value: this.$route.query.address as string,
},
],
match: [
{
query: {
match_one: [
{
key: "is_para",
value: true,
},
{
key: "success",
value: true,
},
],
},
},
],
},
];
case "filterFailedTx":
return [
{
match_one: [
{
key: "from",
value: this.$route.query.address as string,
},
{
key: "to",
value: this.$route.query.address as string,
},
],
match: [
{
key: "success",
value: false,
},
{
key: "is_para",
value: false,
},
],
},
];
case "filterSentTx":
return [
{
match_one: [
{
key: "from",
value: this.$route.query.address as string,
},
],
match: [],
},
];
case "filterReceivedTx":
return [
{
match_one: [
{
key: "to",
value: this.$route.query.address as string,
},
],
match: [],
},
];
default:
return [];
}
},
}, },
methods: { methods: {
getAllExecBalance() { getAllExecBalance() {
...@@ -140,15 +271,15 @@ export default Vue.extend({ ...@@ -140,15 +271,15 @@ export default Vue.extend({
}, },
getTxList() { getTxList() {
this.loadingTxRecordTable = true; this.loadingTxRecordTable = true;
getAddressTxCount(this.$route.query.address as string).then((res) => { getAddressTxCountOrigin(this.txRecordReqParams).then((res) => {
if (res.error === null) { if (res.error === null) {
this.total1 = res.result; this.total1 = res.result;
this.pages.total = res.result; this.pages.total = res.result;
// this.pages.total = res.result > 10000 ? 10000 : res.result; // this.pages.total = res.result > 10000 ? 10000 : res.result;
getAddrTxList( getAddrTxList_another(
this.$route.query.address as string,
this.pages.currentPage, this.pages.currentPage,
this.pages.pageSize this.pages.pageSize,
this.txRecordReqParams[0]
).then((res) => { ).then((res) => {
if (res.error === null) { if (res.error === null) {
this.txRecordList = this.checkGroup(res.result); this.txRecordList = this.checkGroup(res.result);
...@@ -214,10 +345,10 @@ export default Vue.extend({ ...@@ -214,10 +345,10 @@ export default Vue.extend({
pageChange(page: number) { pageChange(page: number) {
this.pages.currentPage = page; this.pages.currentPage = page;
this.loadingTxRecordTable = true; this.loadingTxRecordTable = true;
getAddrTxList( getAddrTxList_another(
this.$route.query.address as string,
this.pages.currentPage, this.pages.currentPage,
this.pages.pageSize this.pages.pageSize,
this.txRecordReqParams[0]
).then((res) => { ).then((res) => {
if (res.error === null) { if (res.error === null) {
this.txRecordList = this.checkGroup(res.result); this.txRecordList = this.checkGroup(res.result);
......
...@@ -175,7 +175,7 @@ export function statSearch(times: number[]) { ...@@ -175,7 +175,7 @@ export function statSearch(times: number[]) {
}); });
} }
export function getAddressTxCount(addr: string) { export function getAddressTxCount(addr: string, matches = [] as any[]) {
return axios(expandApi, { return axios(expandApi, {
method: "post", method: "post",
params: { params: {
...@@ -193,13 +193,24 @@ export function getAddressTxCount(addr: string) { ...@@ -193,13 +193,24 @@ export function getAddressTxCount(addr: string) {
value: addr, value: addr,
}, },
], ],
match: [], match: matches,
}, },
], ],
}, },
}); });
} }
export function getAddressTxCountOrigin(params: any) {
return axios(expandApi, {
method: "post",
params: {
id: 1,
method: "Tx.TxCount",
params,
},
});
}
export function getAllPos33TicketCount() { export function getAllPos33TicketCount() {
return axios(yccApi, { return axios(yccApi, {
method: "post", method: "post",
...@@ -255,6 +266,27 @@ export function getAddrTxList(addr: string, number: number, size: number) { ...@@ -255,6 +266,27 @@ export function getAddrTxList(addr: string, number: number, size: number) {
}); });
} }
export function getAddrTxList_another(
number: number,
size: number,
objContainMatchOneAndMatch: any
) {
return axios(expandApi, {
method: "post",
params: {
id: 1,
method: "Tx.TxList",
params: [
{
...objContainMatchOneAndMatch,
sort: [{ key: "height", ascending: false }],
page: { number, size },
},
],
},
});
}
export function getMakerAddrCount(addr: string) { export function getMakerAddrCount(addr: string) {
return axios(expandApi, { return axios(expandApi, {
method: "post", method: "post",
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
:frozen="frozen" :frozen="frozen"
></m-address-overview> ></m-address-overview>
<div <div
class="rounded-twoPx overflow-hidden shadow-shadow1" class="rounded-twoPx shadow-shadow1 bg-white"
style="margin-top: 15px;" style="margin-top: 15px;"
> >
<m-tabs <m-tabs
...@@ -19,6 +19,13 @@ ...@@ -19,6 +19,13 @@
:tabList="tabList" :tabList="tabList"
></m-tabs> ></m-tabs>
<div v-if="focusedTab === 'txRecord'"> <div v-if="focusedTab === 'txRecord'">
<div>
<Select
:selectedValue="selectedTxRecordFilterValue"
:optionList="txRecordFilterOptionList"
@change="(v) => (selectedTxRecordFilterValue = v)"
></Select>
</div>
<!-- <div class="bg-white text-text-color pl-3.5"> --> <!-- <div class="bg-white text-text-color pl-3.5"> -->
<!-- {{ $t('lang.trade.txTotal', [total1]) }} --> <!-- {{ $t('lang.trade.txTotal', [total1]) }} -->
<!-- ({{ $t('lang.trade.tip2') }}) --> <!-- ({{ $t('lang.trade.tip2') }}) -->
...@@ -108,6 +115,8 @@ import address from '@/mixin/address' ...@@ -108,6 +115,8 @@ import address from '@/mixin/address'
import VueTypedMixins from 'vue-typed-mixins' import VueTypedMixins from 'vue-typed-mixins'
import MAddressOverview from './components/m-address-overview/index.vue' import MAddressOverview from './components/m-address-overview/index.vue'
import MTxItem from '@/components/mobile/m-txItem.vue' import MTxItem from '@/components/mobile/m-txItem.vue'
import Select from '@/components/pc/Select.vue'
export default VueTypedMixins(address).extend({ export default VueTypedMixins(address).extend({
components: { components: {
MChainSearch, MChainSearch,
...@@ -115,6 +124,7 @@ export default VueTypedMixins(address).extend({ ...@@ -115,6 +124,7 @@ export default VueTypedMixins(address).extend({
MTabs, MTabs,
MPageContainer, MPageContainer,
MVotePack, MVotePack,
Select,
MTxItem, MTxItem,
}, },
}) })
......
...@@ -27,10 +27,9 @@ ...@@ -27,10 +27,9 @@
></TabList> ></TabList>
<DataFilter <DataFilter
v-if="focusedTab === 'txRecord'" v-if="focusedTab === 'txRecord'"
:optionList="optionList" :optionList="txRecordFilterOptionList"
:setValue="(v) => (selectedOption = v)" :setValue="(v) => (selectedTxRecordFilterValue = v)"
:hideSelect="true" :value="selectedTxRecordFilterValue"
:value="selectedOption"
> >
<template #left> <template #left>
{{ $t('lang.trade.txTotal', [total1]) }} {{ $t('lang.trade.txTotal', [total1]) }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment