Commit 7db17281 authored by chenqikuai's avatar chenqikuai

refactor: 修改变量名称,让其更好让其他开发人员理解

parent 6f8c53e0
...@@ -58,6 +58,7 @@ export const lang = { ...@@ -58,6 +58,7 @@ export const lang = {
blockReward: "区块奖励", blockReward: "区块奖励",
votingNode: "投票节点", votingNode: "投票节点",
packingNode: "打包节点", packingNode: "打包节点",
allNode: "全部节点",
timestamp: "时间戳", timestamp: "时间戳",
merkelgen: "默克尔根", merkelgen: "默克尔根",
stateHash: "状态哈希", stateHash: "状态哈希",
...@@ -105,6 +106,7 @@ export const lang = { ...@@ -105,6 +106,7 @@ export const lang = {
txRecord: "交易记录", txRecord: "交易记录",
consensusNode: "共识节点", consensusNode: "共识节点",
txTotal: "共找到{0}笔交易", txTotal: "共找到{0}笔交易",
consensusNodeTotal: "共找到{0}个共识节点",
receiveStatus: "接受状态", receiveStatus: "接受状态",
}, },
components: { components: {
......
...@@ -9,9 +9,11 @@ export default Vue.extend({ ...@@ -9,9 +9,11 @@ export default Vue.extend({
data() { data() {
return { return {
searchValue: "", searchValue: "",
focusedTab: "1", focusedTab: "txRecordTab",
txRecordFilterValue: "allTx",
consensusNodeFilterValue: "allNode",
selectedOption: "1",
overview: { overview: {
txCount: 0, txCount: 0,
blockTime: 0, blockTime: 0,
...@@ -75,9 +77,6 @@ export default Vue.extend({ ...@@ -75,9 +77,6 @@ export default Vue.extend({
}); });
return arr; return arr;
}, },
selectOption(v: string) {
this.selectedOption = v;
},
clickSearch(v: string) { clickSearch(v: string) {
console.log(v, " show search value"); console.log(v, " show search value");
}, },
...@@ -148,14 +147,30 @@ export default Vue.extend({ ...@@ -148,14 +147,30 @@ export default Vue.extend({
computed: { computed: {
tabList(): any[] { tabList(): any[] {
return [ return [
{ name: this.$t("lang.trade.txRecord"), value: "1" }, {
{ name: this.$t("lang.trade.consensusNode"), value: "2" }, name: this.$t("lang.trade.txRecord"),
value: "txRecordTab",
},
{
name: this.$t("lang.trade.consensusNode"),
value: "consensusNodeTab",
},
];
},
txRecordFilterOptionList() {
return [
{ name: this.$t("lang.trade.title"), value: "allTx" },
{ name: this.$t("lang.txDetail.transfer"), value: "transfer" },
{ name: this.$t("lang.txDetail.mining"), value: "mining" },
{ name: this.$t("lang.txDetail.callContract"), value: "callContract" },
{ name: this.$t("lang.txDetail.synchronize"), value: "synchronize" },
]; ];
}, },
optionList() { consensusNodeFilterOptionList() {
return [ return [
{ name: this.$t("lang.trade.txRecord"), value: "1" }, { name: this.$t("lang.block.allNode"), value: "allNode" },
{ name: this.$t("lang.trade.consensusNode"), value: "2" }, { name: this.$t("lang.block.packingNode"), value: "packingNode" },
{ name: this.$t("lang.block.votingNode"), value: "votingNode" },
]; ];
}, },
}, },
......
...@@ -19,17 +19,17 @@ ...@@ -19,17 +19,17 @@
:focusedTab="focusedTab" :focusedTab="focusedTab"
></TabList> ></TabList>
<DataFilter <DataFilter
v-if="focusedTab === '1'" v-if="focusedTab === 'txRecordTab'"
:optionList="optionList" :optionList="txRecordFilterOptionList"
:setValue="selectOption" :setValue="(v) => (txRecordFilterValue = v)"
:value="selectedOption" :value="txRecordFilterValue"
> >
<template #left> <template #left>
{{ $t('lang.trade.txTotal', [pages.total]) }} {{ $t('lang.trade.txTotal', [pages.total]) }}
</template> </template>
</DataFilter> </DataFilter>
<TradeTable <TradeTable
v-if="focusedTab === '1'" v-if="focusedTab === 'txRecordTab'"
:groupCellName="groupCellName" :groupCellName="groupCellName"
:Loading="loadingTable" :Loading="loadingTable"
:Trades="Trades" :Trades="Trades"
...@@ -37,6 +37,16 @@ ...@@ -37,6 +37,16 @@
:sizeChange="sizeChange" :sizeChange="sizeChange"
:pageChange="pageChange" :pageChange="pageChange"
></TradeTable> ></TradeTable>
<DataFilter
v-if="focusedTab === 'consensusNodeTab'"
:optionList="consensusNodeFilterOptionList"
:setValue="(v) => (consensusNodeFilterValue = v)"
:value="consensusNodeFilterValue"
>
<template #left>
{{ $t('lang.trade.consensusNodeTotal', [pages.total]) }}
</template>
</DataFilter>
</div> </div>
</template> </template>
......
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