Commit a6b78507 authored by wenglk's avatar wenglk

update

parent 9d30fb01
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@33cn/chain33-rpc-api": "^1.5.29",
"@33cn/chain33-transaction-parser": "^1.1.4", "@33cn/chain33-transaction-parser": "^1.1.4",
"@tailwindcss/line-clamp": "^0.2.0", "@tailwindcss/line-clamp": "^0.2.0",
"@tailwindcss/postcss7-compat": "^2.0.4", "@tailwindcss/postcss7-compat": "^2.0.4",
......
...@@ -47,6 +47,7 @@ export const lang = { ...@@ -47,6 +47,7 @@ export const lang = {
accountBalance: "Account Balance", accountBalance: "Account Balance",
votingRecord: "Voting", votingRecord: "Voting",
packingRecord: "Packing", packingRecord: "Packing",
nodeAdr: "Node"
}, },
block: { block: {
title: "All Blocks", title: "All Blocks",
...@@ -54,6 +55,8 @@ export const lang = { ...@@ -54,6 +55,8 @@ export const lang = {
height: "Height", height: "Height",
time: "Block Age", time: "Block Age",
hash: "Block Hash", hash: "Block Hash",
tx: "Txn",
txs: 'Txns',
txCount: "Txns", txCount: "Txns",
txCount_single: "Txn", txCount_single: "Txn",
blockRevenue: "Block Revenue", blockRevenue: "Block Revenue",
...@@ -111,8 +114,10 @@ export const lang = { ...@@ -111,8 +114,10 @@ export const lang = {
time: "Time", time: "Time",
token: "Token", token: "Token",
type: "Type", type: "Type",
pkgRewards: 'Rewards',
txAmount: "Txn Value", txAmount: "Txn Value",
txRecord: "Transaction", txRecord: "Transaction",
consensusRecord: 'Consensus',
consensusNode: "Consensus Node", consensusNode: "Consensus Node",
txTotal: "A total of {0} txns were found", txTotal: "A total of {0} txns were found",
consensusNodeTotal: "A total of {0} consensus nodes were found", consensusNodeTotal: "A total of {0} consensus nodes were found",
......
...@@ -47,6 +47,7 @@ export const lang = { ...@@ -47,6 +47,7 @@ export const lang = {
accountBalance: "账户余额", accountBalance: "账户余额",
votingRecord: "投票记录", votingRecord: "投票记录",
packingRecord: "打包记录", packingRecord: "打包记录",
nodeAdr: "节点地址"
}, },
block: { block: {
title: "全部区块", title: "全部区块",
...@@ -54,6 +55,8 @@ export const lang = { ...@@ -54,6 +55,8 @@ export const lang = {
height: "高度", height: "高度",
time: "块龄", time: "块龄",
hash: "区块哈希", hash: "区块哈希",
tx: "笔交易",
txs: '笔交易',
txCount: "交易数量", txCount: "交易数量",
txCount_single: "交易数量", txCount_single: "交易数量",
blockRevenue: "区块收益", blockRevenue: "区块收益",
...@@ -111,8 +114,10 @@ export const lang = { ...@@ -111,8 +114,10 @@ export const lang = {
time: "时间", time: "时间",
token: "代币", token: "代币",
type: "类型", type: "类型",
pkgRewards: '打包奖励',
txAmount: "交易金额", txAmount: "交易金额",
txRecord: "交易记录", txRecord: "交易记录",
consensusRecord: '共识记录',
consensusNode: "共识节点", consensusNode: "共识节点",
txTotal: "共找到{0}笔交易", txTotal: "共找到{0}笔交易",
consensusNodeTotal: "共找到{0}个共识节点", consensusNodeTotal: "共找到{0}个共识节点",
......
...@@ -3,18 +3,18 @@ ...@@ -3,18 +3,18 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from 'vue' import Vue from "vue";
import * as echarts from 'echarts/core' import * as echarts from "echarts/core";
import { LineChart, LineSeriesOption } from 'echarts/charts' import { LineChart, LineSeriesOption } from "echarts/charts";
import { TooltipComponent, GridComponent } from 'echarts/components' import { TooltipComponent, GridComponent } from "echarts/components";
import { CanvasRenderer } from 'echarts/renderers' import { CanvasRenderer } from "echarts/renderers";
import { numOfOnChainTx } from '@/service/api' import { numOfOnChainTx } from "@/service/api";
import moment from 'moment' import moment from "moment";
import { nFormatter } from '@/utils/common' import { nFormatter } from "@/utils/common";
type ECOption = echarts.ComposeOption<LineSeriesOption> type ECOption = echarts.ComposeOption<LineSeriesOption>;
echarts.use([TooltipComponent, GridComponent, LineChart, CanvasRenderer]) echarts.use([TooltipComponent, GridComponent, LineChart, CanvasRenderer]);
export default Vue.extend({ export default Vue.extend({
props: { props: {
...@@ -25,103 +25,103 @@ export default Vue.extend({ ...@@ -25,103 +25,103 @@ export default Vue.extend({
return { return {
xData: [], xData: [],
seriesData: [], seriesData: [],
} };
}, },
methods: { methods: {
generateD1() { generateD1() {
const list = [] const list = [];
for (let i = 0; i < 7; ++i) { for (let i = 1; i < 8; ++i) {
const m = moment().startOf('days').add(-i, 'days') const m = moment().startOf("days").add(-i, "days");
list.push(m) list.push(m);
} }
return list.map((i) => { return list.map((i) => {
return { return {
start: i.unix(), start: i.unix(),
format: i.format('YYYY.MM.DD'), format: i.format("YYYY.MM.DD"),
end: i.endOf('days').unix(), end: i.endOf("days").unix(),
} };
}) });
}, },
generateW1() { generateW1() {
const list = [] const list = [];
for (let i = 0; i < 7; ++i) { for (let i = 1; i < 8; ++i) {
const m = moment() const m = moment()
.hour(0) .hour(0)
.minute(0) .minute(0)
.second(0) .second(0)
.add(-i * 7, 'days') .add(-i * 7, "days");
list.push(m) list.push(m);
} }
return list.map((i) => { return list.map((i) => {
return { return {
start: moment(i).add(-1, 'weeks').unix(), start: moment(i).add(-1, "weeks").unix(),
end: moment(i).unix(), end: moment(i).unix(),
format: `${moment(i).add(-1, 'weeks').format('MMMDD')} - ${moment( format: `${moment(i).add(-1, "weeks").format("MMMDD")} - ${moment(
i, i
).format('MMMDD')}`, ).format("MMMDD")}`,
} };
}) });
}, },
generateM1() { generateM1() {
const list = [] const list = [];
for (let i = 0; i < 7; ++i) { for (let i = 1; i < 8; ++i) {
const m = moment().startOf('month').add(-i, 'month') const m = moment().startOf("month").add(-i, "month");
list.push(m) list.push(m);
} }
return list.map((i) => { return list.map((i) => {
return { return {
start: moment(i).unix(), start: moment(i).unix(),
end: moment(i).endOf('month').unix(), end: moment(i).endOf("month").unix(),
format: `${moment(i).format('MMM')}`, format: `${moment(i).format("MMM")}`,
} };
}) });
}, },
generateY1() { generateY1() {
const list = [] const list = [];
for (let i = 0; i < 7; ++i) { for (let i = 0; i < 7; ++i) {
const m = moment().hour(0).minute(0).second(0).add(-i, 'year') const m = moment().hour(0).minute(0).second(0).add(-i, "year");
list.push(m) list.push(m);
} }
return list.map((i) => { return list.map((i) => {
return { return {
start: i.startOf('year').unix(), start: i.startOf("year").unix(),
end: i.endOf('year').unix(), end: i.endOf("year").unix(),
format: `${i.format('YYYY')}`, format: `${i.format("YYYY")}`,
} };
}) });
}, },
generate() { generate() {
switch (this.scale) { switch (this.scale) {
case 'D1': case "D1":
return this.generateD1() return this.generateD1();
case 'W1': case "W1":
return this.generateW1() return this.generateW1();
case 'M1': case "M1":
return this.generateM1() return this.generateM1();
case 'Y1': case "Y1":
return this.generateY1() return this.generateY1();
} }
}, },
draw() { draw() {
// 接下来的使用就跟之前一样,初始化图表,设置配置项 // 接下来的使用就跟之前一样,初始化图表,设置配置项
// filters: ['D1', 'W1', 'M1', 'Y1'], // filters: ['D1', 'W1', 'M1', 'Y1'],
const times = this.generate() const times = this.generate();
times && times &&
numOfOnChainTx(times).then((ret) => { numOfOnChainTx(times).then((ret) => {
if (ret.error == null) { if (ret.error == null) {
this.xData = ret.result this.xData = ret.result;
var myChart = echarts.init(this.$refs.charts as HTMLElement) var myChart = echarts.init(this.$refs.charts as HTMLElement);
myChart.setOption({ myChart.setOption({
tooltip: { tooltip: {
trigger: 'axis', trigger: "axis",
}, },
xAxis: { xAxis: {
type: 'category', type: "category",
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: '#7c88ad', color: "#7c88ad",
}, },
}, },
axisTick: { axisTick: {
...@@ -129,47 +129,47 @@ export default Vue.extend({ ...@@ -129,47 +129,47 @@ export default Vue.extend({
}, },
data: times data: times
?.map((i) => { ?.map((i) => {
return i.format return i.format;
}) })
.reverse(), .reverse(),
}, },
yAxis: { yAxis: {
type: 'value', type: "value",
axisLabel: { axisLabel: {
formatter: (item: number) => { formatter: (item: number) => {
return nFormatter(item) return nFormatter(item);
}, },
textStyle: { textStyle: {
color: '#7c88ad', color: "#7c88ad",
}, },
}, },
}, },
series: [ series: [
{ {
type: 'line', type: "line",
data: this.xData.map((i: any) => i || 0).reverse(), data: this.xData.map((i: any) => i || 0).reverse(),
areaStyle: { areaStyle: {
color: 'red', color: "red",
normal: { normal: {
// 颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上 // 颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {
offset: 0, offset: 0,
color: '#2545CB', // 0% 处的颜色 color: "#2545CB", // 0% 处的颜色
}, },
{ {
offset: 0.6, offset: 0.6,
color: '#9FAEE9', // 40% 处的颜色 color: "#9FAEE9", // 40% 处的颜色
}, },
{ {
offset: 1, offset: 1,
color: 'white', // 100% 处的颜色 color: "white", // 100% 处的颜色
}, },
]), //背景渐变色 ]), //背景渐变色
lineStyle: { lineStyle: {
// 系列级个性化折线样式 // 系列级个性化折线样式
type: 'solid', type: "solid",
color: '#2545CB', //折线的颜色 color: "#2545CB", //折线的颜色
}, },
}, },
}, },
...@@ -179,23 +179,23 @@ export default Vue.extend({ ...@@ -179,23 +179,23 @@ export default Vue.extend({
}, },
], ],
grid: { ...this.grid }, grid: { ...this.grid },
} as ECOption) } as ECOption);
} }
}) });
}, },
}, },
mounted() { mounted() {
this.draw() this.draw();
}, },
watch: { watch: {
scale(v) { scale(v) {
this.draw() this.draw();
}, },
'$route.query.lang'() { "$route.query.lang"() {
this.draw() this.draw();
}, },
}, },
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.charts { .charts {
......
<template> <template>
<div class="blockItem bg-white flex pr-3.5"> <div class="blockItem bg-white flex pr-3.5">
<div class="txNumBox text-center flex-shrink-0"> <div class="txNumBox">
<div <router-link
class="text-footer-color text-base font-bold" :to="{
style="margin-top: 7px;" path: '/blockDetail',
query: {
height: height,
},
}"
> >
{{ txCount }} {{ height }}
</div> </router-link>
<div class="text-xs font-bold text-footer-color-light">
{{ txCount === 1 ? $t('lang.block.txCount_single') : $t('lang.block.txCount') }}
</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">
<div class="flex justify-between items-center w-full">
<div class="text-darkBlue font-bold text-sm">
<router-link
:to="{
path: '/blockDetail',
query: {
height: height,
},
}"
>
{{ height }}
</router-link>
</div>
<div class="text-text-color text-xs">
{{ blockTime | formatTime }}
</div>
</div>
<div> <div>
<span class="text-text-color text-xs"> <span class="text-text-color text-xs">
{{ $t('lang.block.packingAddress') }}: {{ $t("lang.block.hash") }}
</span>
<router-link
:to="{
path: '/blockDetail',
query: {
height: height,
},
}"
>
<span class="text-footer-color">
{{ hash | filterHash(9) }}
</span>
</router-link>
</div>
<div>
<span class="text-text-color text-xs" style="margin-right: 9px">
{{ $t("lang.block.packingAddress") }}:
</span> </span>
<span class="text-footer-color"> <span class="text-footer-color">
<router-link <router-link
...@@ -42,42 +43,48 @@ ...@@ -42,42 +43,48 @@
}, },
}" }"
> >
{{ packagingAddress | filterHash(12) }} {{ packagingAddress | filterHash(9) }}
</router-link> </router-link>
</span> </span>
</div> </div>
<div> <div class="flex justify-between items-center w-full">
<span class="text-text-color text-xs"> <div class="text-text-color text-xs">
{{ $t('lang.block.blockReward') }} {{ txCount }}
</span> {{ txCount === 1 ? $t("lang.block.tx") : $t("lang.block.txs") }}
<span class="text-black text-xs"> </div>
{{ height | filterBlockReward }} <div class="text-text-color text-xs">
</span> {{ blockTime | formatTime }}
</div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from 'vue' import Vue from "vue";
export default Vue.extend({ export default Vue.extend({
props: { props: {
txCount: Number, txCount: Number,
height: Number, height: Number,
blockTime: Number, blockTime: Number,
packagingAddress: String, packagingAddress: String,
hash: String,
}, },
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.blockItem { .blockItem {
height: 90px; height: 90px;
.txNumBox { .txNumBox {
margin-top: 18px; display: flex;
width: 62px; justify-content: center;
height: 54px; align-items: center;
background: rgba(37, 69, 203, 0.1); padding: 15px;
border-radius: 2px; margin: 15px 0 0 15px;
margin-left: 15px; width: fit-content;
height: 55px;
background: #e8ecfc;
border-radius: 4px;
color: #2545cb;
} }
border-bottom: 1px solid #f5f5ff; border-bottom: 1px solid #f5f5ff;
} }
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
v-for="(item, i) in list" v-for="(item, i) in list"
:key="i" :key="i"
class="h-1/4 pt-2.5" class="h-1/4 pt-2.5"
style="margin-left: 10px;" style="margin-left: 10px"
> >
<div class="text-text-color text-xs" style="margin-bottom: 2px;"> <div class="text-text-color text-xs" style="margin-bottom: 2px">
{{ item.name }} {{ item.name }}
</div> </div>
<div class="text-title-color text-sm font-bold"> <div class="text-title-color text-sm font-bold">
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { filterNum } from '@/utils/utils' import { filterNum } from "@/utils/utils";
import Vue from 'vue' import Vue from "vue";
export default Vue.extend({ export default Vue.extend({
props: { props: {
speed: Number, speed: Number,
...@@ -31,25 +31,25 @@ export default Vue.extend({ ...@@ -31,25 +31,25 @@ export default Vue.extend({
list(): { name: string; value: string | number }[] { list(): { name: string; value: string | number }[] {
return [ return [
{ {
name: this.$t('lang.chainPerf.speed') as string, name: this.$t("lang.chainPerf.speed") as string,
value: this.speed + 's', value: this.speed + "s",
}, },
{ {
name: this.$t('lang.chainPerf.tps') as string, name: this.$t("lang.chainPerf.tps") as string,
value: this.tps, value: 1000,
}, },
{ {
name: this.$t('lang.chainPerf.txNumber') as string, name: this.$t("lang.chainPerf.txNumber") as string,
value: filterNum(this.txNumber), value: filterNum(this.txNumber),
}, },
{ {
name: this.$t('lang.chainPerf.addressNumber') as string, name: this.$t("lang.chainPerf.addressNumber") as string,
value: filterNum(this.addressNumber), value: filterNum(this.addressNumber),
}, },
] ];
}, },
}, },
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.c-perf { .c-perf {
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<div class="c-latestBlocks"> <div class="c-latestBlocks">
<div class="top flex items-center justify-between px-3.5"> <div class="top flex items-center justify-between px-3.5">
<div class="text-darkBlue text-sm font-bold"> <div class="text-darkBlue text-sm font-bold">
{{ $t('lang.chainMsg.latestBlock') }} {{ $t("lang.chainMsg.latestBlock") }}
</div> </div>
<div class="text-footer-color text-xs" @click="$router.push('/block')"> <div class="text-footer-color text-xs" @click="$router.push('/block')">
{{ $t('lang.viewMore') }} {{ $t("lang.viewMore") }}
</div> </div>
</div> </div>
<m-block-item <m-block-item
...@@ -14,22 +14,23 @@ ...@@ -14,22 +14,23 @@
:key="i" :key="i"
:blockTime="item.blockTime" :blockTime="item.blockTime"
:height="item.height" :height="item.height"
:hash="item.hash"
:packagingAddress="item.minerHash" :packagingAddress="item.minerHash"
:txCount="item.txs && item.txs.length" :txCount="item.txs && item.txs.length"
></m-block-item> ></m-block-item>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue, { PropType } from 'vue' import Vue, { PropType } from "vue";
import mBlockItem from './m-blockItem.vue' import mBlockItem from "./m-blockItem.vue";
import { iBlockMsg } from 'ycc-api/dist/cmjs/service/home/types' import { iBlockMsg } from "ycc-api/dist/cmjs/service/home/types";
export default Vue.extend({ export default Vue.extend({
components: { mBlockItem }, components: { mBlockItem },
props: { props: {
latestBlocks: Array as PropType<iBlockMsg[]>, latestBlocks: Array as PropType<iBlockMsg[]>,
}, },
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.c-latestBlocks { .c-latestBlocks {
......
...@@ -10,10 +10,15 @@ ...@@ -10,10 +10,15 @@
v-if="txGroup && txGroup === 'isGroupItem'" v-if="txGroup && txGroup === 'isGroupItem'"
class="w-5 h-5 txGroupIcon" class="w-5 h-5 txGroupIcon"
/> />
<div class="flex justify-between items-center" style="margin-top: 14px;"> <div class="flex justify-between items-center" style="margin-top: 14px">
<div class="flex items-center"> <div class="flex items-center">
<div class="text-text-color text-xs" style="margin-right: 3px;"> <div class="text-text-color text-xs" style="margin-right: 3px">
{{ $t('lang.trade.txAmount') }} : {{
row.action_name == "miner"
? $t("lang.trade.pkgRewards")
: $t("lang.trade.txAmount")
}}
:
</div> </div>
<div class="text-darkBlue text-sm font-bold"> <div class="text-darkBlue text-sm font-bold">
{{ row | TradeValue }} {{ row | TradeValue }}
...@@ -25,11 +30,11 @@ ...@@ -25,11 +30,11 @@
</div> </div>
<div <div
class="flex items-center justify-between" class="flex items-center justify-between"
style="margin-top: 3px; margin-bottom: 3px;" style="margin-top: 3px; margin-bottom: 3px"
> >
<div class="flex items-center"> <div class="flex items-center">
<div class="text-text-color text-xs" style="margin-right: 3px;"> <div class="text-text-color text-xs" style="margin-right: 3px">
{{ $t('lang.txDetail.txHash') }} : {{ $t("lang.txDetail.txHash") }} :
</div> </div>
<div <div
class="text-xs" class="text-xs"
...@@ -52,7 +57,7 @@ ...@@ -52,7 +57,7 @@
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div> <div>
<span class="text-text-color text-xs"> <span class="text-text-color text-xs">
{{ $t('lang.trade.sender') }} : {{ $t("lang.trade.sender") }} :
</span> </span>
<span <span
class="text-xs" class="text-xs"
...@@ -72,7 +77,7 @@ ...@@ -72,7 +77,7 @@
</div> </div>
<div> <div>
<span class="text-text-color text-xs"> <span class="text-text-color text-xs">
{{ $t('lang.trade.receiver') }} : {{ $t("lang.trade.receiver") }} :
</span> </span>
<span <span
class="text-xs" class="text-xs"
...@@ -94,9 +99,9 @@ ...@@ -94,9 +99,9 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from 'vue' import Vue from "vue";
import TxStatus from '../pc/txStatus.vue' import TxStatus from "../pc/txStatus.vue";
import txGroupIcon from '@/assets/images/blockChainBrowser/tradeDetail/txGroupIcon.png' import txGroupIcon from "@/assets/images/blockChainBrowser/tradeDetail/txGroupIcon.png";
export default Vue.extend({ export default Vue.extend({
components: { components: {
TxStatus, TxStatus,
...@@ -118,20 +123,20 @@ export default Vue.extend({ ...@@ -118,20 +123,20 @@ export default Vue.extend({
data() { data() {
return { return {
txGroupIcon, txGroupIcon,
} };
}, },
computed: { computed: {
txGroup() { txGroup() {
if (this.tradeG === 1 || this.tradeG === 2) { if (this.tradeG === 1 || this.tradeG === 2) {
return 'isGroupItem' return "isGroupItem";
} else if (this.tradeG === 3) { } else if (this.tradeG === 3) {
return 'isGroupItemEnd' return "isGroupItemEnd";
} else { } else {
return '' return "";
} }
}, },
}, },
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.txItem { .txItem {
......
...@@ -6,18 +6,18 @@ ...@@ -6,18 +6,18 @@
alt="" alt=""
/> />
<div class="balance-label"> <div class="balance-label">
{{ $t('lang.address.balance') }} {{ $t("lang.address.balance") }}
</div> </div>
<div class="balance-value">{{ filterNum(balance / 1e8) }} YCC</div> <div class="balance-value">{{ filterNum(balance / 1e8) }} YCC</div>
<div class="text-sm text-white" style="margin-top: 10px;"> <div class="text-sm text-white" style="margin-top: 10px">
{{ $t('lang.address.freeze') }} {{ $t("lang.address.freeze") }}
<span class="ml-2"> <span class="ml-2">
{{ filterNum(frozen / 1e8) }} {{ filterNum(frozen / 1e8) }}
YCC YCC
</span> </span>
</div> </div>
<Select <Select
style="margin-top: 73px;" style="margin-top: 73px"
:selectedValue="selectedValue" :selectedValue="selectedValue"
:optionsList="optionsList" :optionsList="optionsList"
:searchPlaceholder="$t('lang.searchCurrency')" :searchPlaceholder="$t('lang.searchCurrency')"
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { filterNum } from '@/utils/utils' import { filterNum } from "@/utils/utils";
import VueTypedMixins from 'vue-typed-mixins' import VueTypedMixins from "vue-typed-mixins";
import Select from '../../CurrencySelect.vue' import Select from "../../CurrencySelect.vue";
export default VueTypedMixins().extend({ export default VueTypedMixins().extend({
components: { Select }, components: { Select },
props: { props: {
...@@ -42,7 +42,7 @@ export default VueTypedMixins().extend({ ...@@ -42,7 +42,7 @@ export default VueTypedMixins().extend({
methods: { methods: {
filterNum, filterNum,
}, },
}) });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -51,11 +51,11 @@ export default VueTypedMixins().extend({ ...@@ -51,11 +51,11 @@ export default VueTypedMixins().extend({
height: 360px; height: 360px;
background-color: #2545cb; background-color: #2545cb;
border-radius: 20px; border-radius: 20px;
background-image: url('../../../../assets/images/blockChainBrowser/address/balanceBg.png'); background-image: url("../../../../assets/images/blockChainBrowser/address/balanceBg.png");
background-position: right bottom; background-position: right bottom;
background-size: 281px 302px; background-size: 281px 302px;
background-repeat: no-repeat; background-repeat: no-repeat;
padding-top: 60px; padding-top: 30px;
padding-left: 28px; padding-left: 28px;
.yccIcon { .yccIcon {
...@@ -70,7 +70,7 @@ export default VueTypedMixins().extend({ ...@@ -70,7 +70,7 @@ export default VueTypedMixins().extend({
margin-top: 20px; margin-top: 20px;
} }
.balance-value { .balance-value {
font-size: 32px; font-size: 28px;
font-family: DINAlternate-Bold, DINAlternate; font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold; font-weight: bold;
color: #ffffff; color: #ffffff;
......
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
<div class="w-1/4 mt-10" v-for="(item, index) in list" :key="index"> <div class="w-1/4 mt-10" v-for="(item, index) in list" :key="index">
<div class="text-text-color">{{ item.name }}</div> <div class="text-text-color">{{ item.name }}</div>
<div <div
class="mt-4 text-title-color text-xl font-bold overflow-hidden overflow-ellipsis" class="
mt-4
text-title-color text-xl
font-bold
overflow-hidden overflow-ellipsis
"
> >
{{ item.value }} {{ item.value }}
</div> </div>
...@@ -12,8 +17,8 @@ ...@@ -12,8 +17,8 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { filterNum } from '@/utils/utils' import { filterNum } from "@/utils/utils";
import Vue from 'vue' import Vue from "vue";
export default Vue.extend({ export default Vue.extend({
props: { props: {
speed: Number, speed: Number,
...@@ -25,25 +30,25 @@ export default Vue.extend({ ...@@ -25,25 +30,25 @@ export default Vue.extend({
list(): { name: string; value: string | number }[] { list(): { name: string; value: string | number }[] {
return [ return [
{ {
name: this.$t('lang.chainPerf.speed') as string, name: this.$t("lang.chainPerf.speed") as string,
value: this.speed + 's', value: this.speed + "s",
}, },
{ {
name: this.$t('lang.chainPerf.tps') as string, name: this.$t("lang.chainPerf.tps") as string,
value: this.tps, value: 1000,
}, },
{ {
name: this.$t('lang.chainPerf.txNumber') as string, name: this.$t("lang.chainPerf.txNumber") as string,
value: filterNum(this.txNumber), value: filterNum(this.txNumber),
}, },
{ {
name: this.$t('lang.chainPerf.addressNumber') as string, name: this.$t("lang.chainPerf.addressNumber") as string,
value: filterNum(this.addressNumber), value: filterNum(this.addressNumber),
}, },
] ];
}, },
}, },
}) });
</script> </script>
<style scoped> <style scoped>
......
...@@ -7,20 +7,33 @@ ...@@ -7,20 +7,33 @@
:key="i" :key="i"
> >
<div <div
class="txNumberBox text-footer-color text-sm font-bold text-center flex-shrink-0 items-center flex" class="
txNumberBox
text-footer-color text-sm
font-bold
text-center
flex-shrink-0
items-center
flex
"
> >
<div class="flex-grow overflow-hidden overflow-ellipsis"> <div class="flex-grow overflow-hidden overflow-ellipsis">
{{ (item && item.txs && item.txs.length) || '' }} <router-link
{{ :to="{
item && item.txs && item.txs.length === 1 path: '/blockDetail',
? $t('lang.block.txCount_single') query: {
: $t('lang.block.txCount') height: item.height,
}} },
}"
>
{{ item.height }}
</router-link>
</div> </div>
</div> </div>
<div class="w-full ml-5"> <div class="w-full ml-5">
<div class="flex justify-between"> <div class="flex justify-between">
<div class="height"> <div>
<span class="graytxt"> {{ $t("lang.block.hash") }}</span>
<router-link <router-link
:to="{ :to="{
path: '/blockDetail', path: '/blockDetail',
...@@ -29,20 +42,28 @@ ...@@ -29,20 +42,28 @@
}, },
}" }"
> >
{{ item.height }} <span class="text-footer-color">
{{ item.hash | filterHash(9) }}
</span>
</router-link> </router-link>
</div> </div>
<div> <div>
<span class="graytxt">{{ $t('lang.block.blockReward') }}:</span> <!-- <span class="graytxt">{{ $t("lang.block.blockReward") }}:</span> -->
<span> <span>
{{ item.height | filterBlockReward }} {{ (item && item.txs && item.txs.length) || "" }}
{{
item && item.txs && item.txs.length === 1
? $t("lang.block.tx")
: $t("lang.block.txs")
}}
<!-- {{ item.height | filterBlockReward }} -->
</span> </span>
</div> </div>
</div> </div>
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<div> <div>
<span class="graytxt"> <span class="graytxt">
{{ $t('lang.block.packingAddress') }} {{ $t("lang.block.packingAddress") }}
</span> </span>
<router-link <router-link
:to="{ :to="{
...@@ -57,7 +78,7 @@ ...@@ -57,7 +78,7 @@
</span> </span>
</router-link> </router-link>
</div> </div>
<div class="text-text-color" style="font-size: 12px;"> <div class="text-text-color" style="font-size: 12px">
{{ item.blockTime | formatTime }} {{ item.blockTime | formatTime }}
</div> </div>
</div> </div>
...@@ -68,16 +89,16 @@ ...@@ -68,16 +89,16 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue, { PropType } from 'vue' import Vue, { PropType } from "vue";
import LatestContainer from '@/components/pc/BlockChainBrowser/LatestContainer.vue' import LatestContainer from "@/components/pc/BlockChainBrowser/LatestContainer.vue";
import { iBlockMsg } from 'ycc-api/dist/cmjs/service/home/types' import { iBlockMsg } from "ycc-api/dist/cmjs/service/home/types";
export default Vue.extend({ export default Vue.extend({
components: { LatestContainer }, components: { LatestContainer },
props: { props: {
latestBlocks: Array as PropType<iBlockMsg[]>, latestBlocks: Array as PropType<iBlockMsg[]>,
}, },
}) });
</script> </script>
<style scoped> <style scoped>
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
v-for="(item, i) in latestTxs" v-for="(item, i) in latestTxs"
:key="i" :key="i"
> >
<div class="left" style="line-height: 20px;"> <div class="left" style="line-height: 20px">
<div> <div>
<span class="graytxt">{{ $t('lang.trade.hash') }}</span> <span class="graytxt">{{ $t("lang.trade.hash") }}</span>
<span class="text-footer-color"> <span class="text-footer-color">
<router-link <router-link
:to="{ :to="{
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
</router-link> </router-link>
</span> </span>
</div> </div>
<div class="graytxt" style="font-size: 12px; margin-top: 6px;"> <div class="graytxt" style="font-size: 12px; margin-top: 6px">
{{ item.time_block | formatTime }} {{ item.time_block | formatTime }}
</div> </div>
</div> </div>
<div class="middle" style="line-height: 20px;"> <div class="middle" style="line-height: 20px">
<div> <div>
<span class="graytxt">{{ $t('lang.trade.sender') }}</span> <span class="graytxt">{{ $t("lang.trade.sender") }}</span>
<span class="text-footer-color"> <span class="text-footer-color">
<router-link <router-link
:to="{ :to="{
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
</router-link> </router-link>
</span> </span>
</div> </div>
<div class="graytxt" style="margin-top: 6px;"> <div class="graytxt" style="margin-top: 6px">
<span class="graytxt">{{ $t('lang.trade.receiver') }}</span> <span class="graytxt">{{ $t("lang.trade.receiver") }}</span>
<span class="text-footer-color"> <span class="text-footer-color">
<router-link <router-link
:to="{ :to="{
...@@ -58,9 +58,15 @@ ...@@ -58,9 +58,15 @@
</span> </span>
</div> </div>
</div> </div>
<div class="right text-right" style="line-height: 20px;"> <div class="right text-right" style="line-height: 20px">
<div class="graytxt">{{ $t('lang.trade.txAmount') }}</div> <div class="graytxt">
<div class="text-darkBlue" style="margin-top: 6px;"> {{
item.action_name == "miner"
? $t("lang.trade.pkgRewards")
: $t("lang.trade.txAmount")
}}
</div>
<div class="text-darkBlue" style="margin-top: 6px">
{{ item | filterTradeValue }} {{ item | filterTradeValue }}
</div> </div>
</div> </div>
...@@ -70,27 +76,27 @@ ...@@ -70,27 +76,27 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue, { PropType } from 'vue' import Vue, { PropType } from "vue";
import LatestContainer from '@/components/pc/BlockChainBrowser/LatestContainer.vue' import LatestContainer from "@/components/pc/BlockChainBrowser/LatestContainer.vue";
import { iAsset } from '@/types/trade' import { iAsset } from "@/types/trade";
export default Vue.extend({ export default Vue.extend({
components: { LatestContainer }, components: { LatestContainer },
props: { props: {
latestTxs: Array as PropType< latestTxs: Array as PropType<
{ {
hash: string hash: string;
time_block: number time_block: number;
from: string from: string;
to: string to: string;
amount: number amount: number;
assets: iAsset[] assets: iAsset[];
tx: { tx: {
execer?: string execer?: string;
} };
}[] }[]
>, >,
}, },
}) });
</script> </script>
<style scoped> <style scoped>
......
import { import {
getAddressTxCountOrigin, getAddressTxCountOrigin,
getAddrTxList_another, getAddrTxList_another,
getMakerAddr,
getMakerAddrCount,
getVoterAddr, getVoterAddr,
getVoterAddrCount, getVoterAddrCount,
yccApi, yccApi,
...@@ -51,7 +49,6 @@ export default Vue.extend({ ...@@ -51,7 +49,6 @@ export default Vue.extend({
"$route.query.address"() { "$route.query.address"() {
this.getAllExecBalance(); this.getAllExecBalance();
this.getTxList(); this.getTxList();
this.getMaker();
this.getVoter(); this.getVoter();
}, },
selectedTxRecordFilterValue(newValue) { selectedTxRecordFilterValue(newValue) {
...@@ -62,7 +59,6 @@ export default Vue.extend({ ...@@ -62,7 +59,6 @@ export default Vue.extend({
mounted() { mounted() {
this.getAllExecBalance(); this.getAllExecBalance();
this.getTxList(); this.getTxList();
this.getMaker();
this.getVoter(); this.getVoter();
}, },
computed: { computed: {
...@@ -97,13 +93,9 @@ export default Vue.extend({ ...@@ -97,13 +93,9 @@ export default Vue.extend({
value: "txRecord", value: "txRecord",
}, },
{ {
name: this.$t("lang.address.votingRecord"), name: this.$t("lang.trade.consensusRecord"),
value: "votingRecord", value: "consensus",
}, }
{
name: this.$t("lang.address.packingRecord"),
value: "packingRecord",
},
]; ];
}, },
optionList() { optionList() {
...@@ -152,6 +144,12 @@ export default Vue.extend({ ...@@ -152,6 +144,12 @@ export default Vue.extend({
}, },
], ],
match: [], match: [],
"not": [
{
"key": "action_name",
"value": "miner"
}
]
}, },
]; ];
case "filterSucceedTx": case "filterSucceedTx":
...@@ -183,6 +181,12 @@ export default Vue.extend({ ...@@ -183,6 +181,12 @@ export default Vue.extend({
}, },
}, },
], ],
"not": [
{
"key": "action_name",
"value": "miner"
}
]
}, },
]; ];
case "filterFailedTx": case "filterFailedTx":
...@@ -208,6 +212,12 @@ export default Vue.extend({ ...@@ -208,6 +212,12 @@ export default Vue.extend({
value: false, value: false,
}, },
], ],
"not": [
{
"key": "action_name",
"value": "miner"
}
]
}, },
]; ];
case "filterSentTx": case "filterSentTx":
...@@ -220,6 +230,12 @@ export default Vue.extend({ ...@@ -220,6 +230,12 @@ export default Vue.extend({
}, },
], ],
match: [], match: [],
"not": [
{
"key": "action_name",
"value": "miner"
}
]
}, },
]; ];
case "filterReceivedTx": case "filterReceivedTx":
...@@ -232,6 +248,12 @@ export default Vue.extend({ ...@@ -232,6 +248,12 @@ export default Vue.extend({
}, },
], ],
match: [], match: [],
"not": [
{
"key": "action_name",
"value": "miner"
}
]
}, },
]; ];
default: default:
...@@ -292,36 +314,14 @@ export default Vue.extend({ ...@@ -292,36 +314,14 @@ export default Vue.extend({
setValue(v: string) { setValue(v: string) {
this.value = v; this.value = v;
}, },
sizeChange3(size: number) {
this.pages3.pageSize = size;
this.pageChange3(1);
},
pageChange3(page: number) {
this.pages3.currentPage = page;
getMakerAddr(
this.$route.query.address as string,
this.pages3.currentPage,
this.pages3.pageSize
).then((res) => {
if (res.error === null) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.packList = res.result.map((i: any) => ({
...i,
sender: i.from,
receiver: i.to,
time: i.block_time,
}));
const txHashes = res.result.map((i: any) => i.hash);
this.setMakerReward(txHashes);
}
});
},
sizeChange2(size: number) { sizeChange2(size: number) {
this.pages2.pageSize = size; this.pages2.pageSize = size;
this.pageChange2(1); this.pageChange2(1);
}, },
pageChange2(page: number) { pageChange2(page: number) {
this.pages2.currentPage = page; this.pages2.currentPage = page;
console.log('page2');
getVoterAddr( getVoterAddr(
this.$route.query.address as string, this.$route.query.address as string,
this.pages2.currentPage, this.pages2.currentPage,
...@@ -335,6 +335,8 @@ export default Vue.extend({ ...@@ -335,6 +335,8 @@ export default Vue.extend({
receiver: i.to, receiver: i.to,
time: i.block_time, time: i.block_time,
})); }));
const txHashes = res.result.map((i: any) => i.hash);
// this.setVoteReward(txHashes);
} }
}); });
}, },
...@@ -401,60 +403,6 @@ export default Vue.extend({ ...@@ -401,60 +403,6 @@ export default Vue.extend({
this.voteList = [...this.voteList]; this.voteList = [...this.voteList];
}); });
}, },
setMakerReward(txHashes: string[]) {
getTxByHashes("ycc", yccApi, txHashes).then((txRes) => {
const list = txRes
.map((i: any, index: number) => {
return {
txHash: txHashes[index],
receipt: i.receipt,
};
})
.map((i: any) => {
const res = getConsensusList([i]);
return {
txHash: i.txHash,
reward: res
.filter((m) => m.type === "pack")
.reduce((p, c) => {
return p + c.reward;
}, 0),
};
});
list.forEach((item: { txHash: string; reward: number }) => {
const the = this.packList.find((i) => i.hash === item.txHash);
if (the) {
the.reward = item.reward;
}
});
this.packList = [...this.packList];
});
},
getMaker() {
getMakerAddrCount(this.$route.query.address as string).then((res) => {
if (res.error === null) {
this.pages3.total = res.result;
getMakerAddr(
this.$route.query.address as string,
this.pages3.currentPage,
this.pages3.pageSize
).then((res) => {
if (res.error === null) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const txHashes = res.result.map((i: any) => i.hash);
this.packList = res.result.map((i: any) => ({
...i,
sender: i.from,
receiver: i.to,
time: i.block_time,
}));
this.setMakerReward(txHashes);
}
});
}
});
},
getVoter() { getVoter() {
getVoterAddrCount(this.$route.query.address as string).then((res) => { getVoterAddrCount(this.$route.query.address as string).then((res) => {
if (res.error === null) { if (res.error === null) {
......
...@@ -2,6 +2,7 @@ import Vue from "vue"; ...@@ -2,6 +2,7 @@ import Vue from "vue";
import { getLatestBlock } from "ycc-api/dist/cmjs/service/home/index"; import { getLatestBlock } from "ycc-api/dist/cmjs/service/home/index";
import { iBlockMsg } from "ycc-api/dist/cmjs/service/home/types"; import { iBlockMsg } from "ycc-api/dist/cmjs/service/home/types";
import { getRpc } from "ycc-api/src/service/Rpc"; import { getRpc } from "ycc-api/src/service/Rpc";
import RPC from '../service/chain33rpc'
import Base64 from "@/utils/_base64"; import Base64 from "@/utils/_base64";
import moment from "moment"; import moment from "moment";
...@@ -30,7 +31,7 @@ export default Vue.extend({ ...@@ -30,7 +31,7 @@ export default Vue.extend({
latestHeight: NaN, latestHeight: NaN,
totalTx: NaN, totalTx: NaN,
value: "", value: "",
latestBlocks: [] as iBlockMsg[], latestBlocks: new Array(6).fill({}),
quoteChange: "", quoteChange: "",
price: "", price: "",
marketValue: 0, marketValue: 0,
...@@ -140,18 +141,16 @@ export default Vue.extend({ ...@@ -140,18 +141,16 @@ export default Vue.extend({
clickSearch(value: string) { clickSearch(value: string) {
console.log(value, "show value"); console.log(value, "show value");
}, },
getLatestBlockData() { async getLatestBlockData() {
this.latestBlocks = let blocks = [] as any
(this.latestBlocks.length && this.latestBlocks) || const res = await getLatestBlock("ycc", yccApi)
((" " const newHeight = (res as any)[0].height
.repeat(5) const { result } = await RPC.getHeaders(newHeight - 5, newHeight, false)
.split(" ") const hashes = result.items.reverse()
.map(() => ({})) as unknown) as iBlockMsg[]); blocks = res?.map((item, index) => {
return { ...item, ...hashes[index] }
return getLatestBlock("ycc", yccApi).then((ret) => { })
this.latestBlocks = ret || []; this.latestBlocks = blocks
return ret;
});
}, },
hexCharCodeToStr(hexCharCodeStr: string) { hexCharCodeToStr(hexCharCodeStr: string) {
const num = hexCharCodeStr; const num = hexCharCodeStr;
...@@ -194,7 +193,7 @@ export default Vue.extend({ ...@@ -194,7 +193,7 @@ export default Vue.extend({
this.quoteChange = data.range; this.quoteChange = data.range;
this.marketValue = Math.floor( this.marketValue = Math.floor(
Number(data.last) * Number(data.last) *
(100 * 1e8 + 30 * 725000 + 15 * (this.latestHeight - 725000)) (100 * 1e8 + 30 * 725000 + 15 * (this.latestHeight - 725000))
); );
} }
}); });
......
...@@ -201,6 +201,8 @@ export function getAddressTxCount(addr: string, matches = [] as any[]) { ...@@ -201,6 +201,8 @@ export function getAddressTxCount(addr: string, matches = [] as any[]) {
} }
export function getAddressTxCountOrigin(params: any) { export function getAddressTxCountOrigin(params: any) {
console.log(params, 123);
return axios(expandApi, { return axios(expandApi, {
method: "post", method: "post",
params: { params: {
...@@ -279,6 +281,12 @@ export function getAddrTxList_another( ...@@ -279,6 +281,12 @@ export function getAddrTxList_another(
params: [ params: [
{ {
...objContainMatchOneAndMatch, ...objContainMatchOneAndMatch,
"not": [
{
"key": "action_name",
"value": "miner"
}
],
sort: [{ key: "height", ascending: false }], sort: [{ key: "height", ascending: false }],
page: { number, size }, page: { number, size },
}, },
...@@ -319,6 +327,10 @@ export function getVoterAddrCount(addr: string) { ...@@ -319,6 +327,10 @@ export function getVoterAddrCount(addr: string) {
key: "voter_addr", key: "voter_addr",
value: addr, value: addr,
}, },
{
"key": "action_name",
"value": "miner"
}
], ],
}, },
], ],
...@@ -375,6 +387,10 @@ export function getVoterAddr(addr: string, number: number, size: number) { ...@@ -375,6 +387,10 @@ export function getVoterAddr(addr: string, number: number, size: number) {
key: "voter_addr", key: "voter_addr",
value: addr, value: addr,
}, },
{
"key": "action_name",
"value": "miner"
}
], ],
page: { page: {
number, number,
......
import Chain33Rpc from '@33cn/chain33-rpc-api'
export default new Chain33Rpc('/yccApi', null, (e: Error) => {
throw e
})
\ No newline at end of file
...@@ -66,6 +66,7 @@ export const getConsensusList = (txs: any[]): iRetTypeOfGetConItem[] => { ...@@ -66,6 +66,7 @@ export const getConsensusList = (txs: any[]): iRetTypeOfGetConItem[] => {
txs.forEach((tx) => { txs.forEach((tx) => {
tx && tx.receipt && tx.receipt.logs && logsList.push(...tx.receipt.logs); tx && tx.receipt && tx.receipt.logs && logsList.push(...tx.receipt.logs);
}); });
console.log(logsList);
return logsList return logsList
.filter((i) => i.ty === 8) .filter((i) => i.ty === 8)
......
...@@ -23,23 +23,23 @@ ...@@ -23,23 +23,23 @@
></Select> ></Select>
</div> </div>
<div class="text-white mt-3.5 text-xs"> <div class="text-white mt-3.5 text-xs">
{{ $t('lang.address.balance') }} {{ $t("lang.address.balance") }}
</div> </div>
<div class="text-white mt-1 text-3xl font-bold"> <div class="text-white mt-1 text-xl font-bold">
{{ filterNum(balance / 1e8) }}YCC {{ filterNum(balance / 1e8) }}YCC
</div> </div>
<div class="text-white text-xs" style="margin-top: 5px;"> <div class="text-white text-xs" style="margin-top: 5px">
{{ $t('lang.address.freeze') }} {{ $t("lang.address.freeze") }}
{{ filterNum(forzen / 1e8) }} YCC {{ filterNum(forzen / 1e8) }} YCC
</div> </div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import Select from '@/components/pc/CurrencySelect.vue' import Select from "@/components/pc/CurrencySelect.vue";
import balanceBg from '@/assets/images/blockChainBrowser/address/balanceBg-mobile.png' import balanceBg from "@/assets/images/blockChainBrowser/address/balanceBg-mobile.png";
import Vue from 'vue' import Vue from "vue";
import { filterNum } from '@/utils/utils' import { filterNum } from "@/utils/utils";
export default Vue.extend({ export default Vue.extend({
components: { components: {
Select, Select,
...@@ -57,9 +57,9 @@ export default Vue.extend({ ...@@ -57,9 +57,9 @@ export default Vue.extend({
data() { data() {
return { return {
balanceBg, balanceBg,
} };
}, },
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.c-address-blue-card { .c-address-blue-card {
......
<template> <template>
<div class="c-votePackTable"> <div class="c-votePackTable">
<el-table :data="list" v-loading="loading" stripe> <el-table :data="list" v-loading="loading" stripe>
<TableColumn label width="40"></TableColumn> <!-- <TableColumn label width="40"></TableColumn> -->
<TableColumn :label="$t('lang.txDetail.height')"> <TableColumn type="expand">
<template slot-scope="{ row }"> <template slot-scope="props">
<div class="text-footer-color"> <div
<router-link class="line"
:to="{ v-for="item in props.row.voter_addr"
path: '/blockDetail', :key="item.hash"
query: { >
height: row.height, <p class="adr">{{ item | filterHash(10) }}</p>
}, <span>投票节点</span>
}" <span> YCC</span>
>
{{ row.height }}
</router-link>
</div> </div>
</template> </template>
</TableColumn> </TableColumn>
...@@ -34,7 +31,7 @@ ...@@ -34,7 +31,7 @@
</div> </div>
</template> </template>
</TableColumn> </TableColumn>
<TableColumn :label="$t('lang.trade.sender')"> <TableColumn :label="$t('lang.address.nodeAdr')">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div class="text-footer-color"> <div class="text-footer-color">
<router-link <router-link
...@@ -45,38 +42,26 @@ ...@@ -45,38 +42,26 @@
}, },
}" }"
> >
{{ row.sender | filterHash }} {{ row.sender | filterHash(10) }}
</router-link> </router-link>
</div> </div>
</template> </template>
</TableColumn> </TableColumn>
<TableColumn label width="40"> <TableColumn :label="$t('lang.trade.type')" width="150" align="center">
<template slot-scope=""> <template>
<img :src="arrowRight" alt="" /> <div class="text-text-color">打包节点</div>
</template>
</TableColumn>
<TableColumn :label="$t('lang.trade.receiver')">
<template slot-scope="{ row }">
<div class="text-footer-color">
<router-link
:to="{
path: '/address',
query: {
address: row.receiver,
},
}"
>
{{ row.receiver | filterHash }}
</router-link>
</div>
</template> </template>
</TableColumn> </TableColumn>
<TableColumn :label="$t('lang.block.blockReward')"> <TableColumn
:label="$t('lang.block.blockReward')"
width="150"
align="center"
>
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div class="text-text-color">{{ row.reward | filterAmount }} YCC</div> <div class="text-text-color">{{ row.amount / 1e8 }} YCC</div>
</template> </template>
</TableColumn> </TableColumn>
<TableColumn :label="$t('lang.trade.time')" align="right"> <TableColumn :label="$t('lang.trade.time')" align="right" width="220">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div class="text-text-color"> <div class="text-text-color">
{{ row.time | formatTime }} {{ row.time | formatTime }}
...@@ -88,23 +73,31 @@ ...@@ -88,23 +73,31 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Table, TableColumn } from 'element-ui' import { Table, TableColumn } from "element-ui";
import arrowRight from '@/assets/images/blockChainBrowser/blockDetail/arrow-right-dark.png' import Vue from "vue";
import Vue from 'vue'
export default Vue.extend({ export default Vue.extend({
components: { components: {
'el-table': Table, "el-table": Table,
TableColumn, TableColumn,
}, },
props: { props: {
list: Array, list: Array,
loading: Boolean, loading: Boolean,
}, },
data() { });
return {
arrowRight,
}
},
})
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.line {
display: flex;
justify-items: center;
align-items: center;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
color: #1f3470;
line-height: 40px;
.adr {
margin-left: 355px;
width: 300px;
}
}
</style>
<template> <template>
<div <div
style="padding-top: 64px; padding-bottom: 60px;" style="padding-top: 64px; padding-bottom: 60px"
class="min-w-1200 md:w-bodySet mx-auto flow-root" class="min-w-1200 md:w-bodySet mx-auto flow-root"
> >
<chain-search <chain-search
:value="value" :value="value"
:setValue="setValue" :setValue="setValue"
style="margin-top: 30px;" style="margin-top: 30px"
></chain-search> ></chain-search>
<address-overview <address-overview
:balance="balance" :balance="balance"
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
:frozen="frozen" :frozen="frozen"
class="mt-7" class="mt-7"
></address-overview> ></address-overview>
<div <div style="margin-top: 30px; border-radius: 4px" class="shadow-shadow1">
style="margin-top: 30px; border-radius: 4px;"
class="shadow-shadow1 overflow-hidden"
>
<TabList <TabList
:setFocusedTab="(v) => (focusedTab = v)" :setFocusedTab="(v) => (focusedTab = v)"
:tabList="tabList" :tabList="tabList"
...@@ -32,7 +29,7 @@ ...@@ -32,7 +29,7 @@
:value="selectedTxRecordFilterValue" :value="selectedTxRecordFilterValue"
> >
<template #left> <template #left>
{{ $t('lang.trade.txTotal', [total1]) }} {{ $t("lang.trade.txTotal", [total1]) }}
<!-- ({{ $t('lang.trade.tip2') }}) --> <!-- ({{ $t('lang.trade.tip2') }}) -->
</template> </template>
</DataFilter> </DataFilter>
...@@ -44,20 +41,15 @@ ...@@ -44,20 +41,15 @@
:Trades="txRecordList" :Trades="txRecordList"
></TradeTable2> ></TradeTable2>
<vote-pack-table <vote-pack-table
v-if="focusedTab === 'votingRecord'" v-if="focusedTab === 'consensus'"
:list="voteList" :list="voteList"
:loading="loadingVote" :loading="loadingVote"
></vote-pack-table> ></vote-pack-table>
<vote-pack-table
v-if="focusedTab === 'packingRecord'"
:list="packList"
:loading="loadingPack"
></vote-pack-table>
</div> </div>
<div class="flex justify-end"> <div class="flex justify-end">
<page-container <page-container
v-if="focusedTab === 'txRecord'" v-if="focusedTab === 'txRecord'"
style="margin-top: 30px;" style="margin-top: 30px"
:currentPage="pages.currentPage" :currentPage="pages.currentPage"
:pageSize="pages.pageSize" :pageSize="pages.pageSize"
:total="pages.total" :total="pages.total"
...@@ -65,7 +57,7 @@ ...@@ -65,7 +57,7 @@
@pageChange="pageChange" @pageChange="pageChange"
></page-container> ></page-container>
<page-container <page-container
v-if="focusedTab === 'votingRecord'" v-if="focusedTab === 'consensus'"
@pageChange="pageChange2" @pageChange="pageChange2"
@sizeChange="sizeChange2" @sizeChange="sizeChange2"
:currentPage="pages2.currentPage" :currentPage="pages2.currentPage"
...@@ -73,29 +65,20 @@ ...@@ -73,29 +65,20 @@
:total="pages2.total" :total="pages2.total"
class="mt-5" class="mt-5"
></page-container> ></page-container>
<page-container
v-if="focusedTab === 'packingRecord'"
@pageChange="pageChange3"
@sizeChange="sizeChange3"
:currentPage="pages3.currentPage"
:pageSize="pages3.pageSize"
:total="pages3.total"
class="mt-5"
></page-container>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import ChainSearch from '@/components/pc/BlockChainBrowser/ChainSearch.vue' import ChainSearch from "@/components/pc/BlockChainBrowser/ChainSearch.vue";
import AddressOverview from '@/components/pc/BlockChainBrowser/AddressOverview/index.vue' import AddressOverview from "@/components/pc/BlockChainBrowser/AddressOverview/index.vue";
import VueTypedMixins from 'vue-typed-mixins' import VueTypedMixins from "vue-typed-mixins";
import address from '@/mixin/address' import address from "@/mixin/address";
import PageContainer from '@/components/pc/BlockChainBrowser/PageContainer.vue' import PageContainer from "@/components/pc/BlockChainBrowser/PageContainer.vue";
import TabList from '@/components/pc/BlockChainBrowser/TabList/index.vue' import TabList from "@/components/pc/BlockChainBrowser/TabList/index.vue";
import TradeTable2 from '@/components/pc/BlockChainBrowser/TradeTable2.vue' import TradeTable2 from "@/components/pc/BlockChainBrowser/TradeTable2.vue";
import DataFilter from '@/components/pc/BlockChainBrowser/DataFilter/index.vue' import DataFilter from "@/components/pc/BlockChainBrowser/DataFilter/index.vue";
import VotePackTable from './components/votePackTable.vue' import VotePackTable from "./components/votePackTable.vue";
export default VueTypedMixins(address).extend({ export default VueTypedMixins(address).extend({
components: { components: {
ChainSearch, ChainSearch,
...@@ -107,7 +90,7 @@ export default VueTypedMixins(address).extend({ ...@@ -107,7 +90,7 @@ export default VueTypedMixins(address).extend({
PageContainer, PageContainer,
}, },
computed: {}, computed: {},
}) });
</script> </script>
<style></style> <style></style>
<template> <template>
<div <div
class="block-detail min-w-1200 md:w-bodySet mx-auto flow-root" class="block-detail min-w-1200 md:w-bodySet mx-auto flow-root"
style="padding-bottom: 60px;" style="padding-bottom: 60px"
> >
<chain-search <chain-search
style="margin-top: 30px;" style="margin-top: 30px"
:clickSearch="clickSearch" :clickSearch="clickSearch"
:value="searchValue" :value="searchValue"
:setValue="setSearchValue" :setValue="setSearchValue"
></chain-search> ></chain-search>
<block-overview <block-overview
style="margin-top: 30px; margin-bottom: 30px;" style="margin-top: 30px; margin-bottom: 30px"
:data="overview" :data="overview"
:init="init" :init="init"
:loading="loadingOverview" :loading="loadingOverview"
:loadingRelativeBlockHeight="loadingRelativeNumber" :loadingRelativeBlockHeight="loadingRelativeNumber"
></block-overview> ></block-overview>
<!-- 记录表 -->
<div class="shadow-shadow1"> <div class="shadow-shadow1">
<TabList <TabList
:tabList="tabList" :tabList="tabList"
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
></TabList> ></TabList>
<DataFilter v-if="focusedTab === 'txRecordTab'" :hideSelect="true"> <DataFilter v-if="focusedTab === 'txRecordTab'" :hideSelect="true">
<template #left> <template #left>
{{ $t('lang.trade.txTotal', [pages.total]) }} {{ $t("lang.trade.txTotal", [pages.total]) }}
</template> </template>
</DataFilter> </DataFilter>
<TradeTable <TradeTable
...@@ -45,7 +46,7 @@ ...@@ -45,7 +46,7 @@
> >
<template #left> <template #left>
{{ {{
$t('lang.trade.consensusNodeTotal', [consensusNodeTableList.length]) $t("lang.trade.consensusNodeTotal", [consensusNodeTableList.length])
}} }}
</template> </template>
</DataFilter> </DataFilter>
...@@ -57,7 +58,7 @@ ...@@ -57,7 +58,7 @@
</div> </div>
<div <div
class="flex justify-end" class="flex justify-end"
style="margin-top: 30px;" style="margin-top: 30px"
v-if="focusedTab === 'txRecordTab'" v-if="focusedTab === 'txRecordTab'"
> >
<page-container <page-container
...@@ -72,15 +73,15 @@ ...@@ -72,15 +73,15 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import ChainSearch from '@/components/pc/BlockChainBrowser/ChainSearch.vue' import ChainSearch from "@/components/pc/BlockChainBrowser/ChainSearch.vue";
import BlockOverview from '@/components/pc/BlockChainBrowser/BlockOverview/index.vue' import BlockOverview from "@/components/pc/BlockChainBrowser/BlockOverview/index.vue";
import TabList from '@/components/pc/BlockChainBrowser/TabList/index.vue' import TabList from "@/components/pc/BlockChainBrowser/TabList/index.vue";
import DataFilter from '@/components/pc/BlockChainBrowser/DataFilter/index.vue' import DataFilter from "@/components/pc/BlockChainBrowser/DataFilter/index.vue";
import TradeTable from '@/components/pc/BlockChainBrowser/TradeTable/index.vue' import TradeTable from "@/components/pc/BlockChainBrowser/TradeTable/index.vue";
import PageContainer from '@/components/pc/BlockChainBrowser/PageContainer.vue' import PageContainer from "@/components/pc/BlockChainBrowser/PageContainer.vue";
import blockDetailMixin from '@/mixin/blockDetail' import blockDetailMixin from "@/mixin/blockDetail";
import VueTypedMixins from 'vue-typed-mixins' import VueTypedMixins from "vue-typed-mixins";
import ConsensusNodeTable from './components/consensusNodeTable.vue' import ConsensusNodeTable from "./components/consensusNodeTable.vue";
export default VueTypedMixins(blockDetailMixin).extend({ export default VueTypedMixins(blockDetailMixin).extend({
components: { components: {
...@@ -92,7 +93,7 @@ export default VueTypedMixins(blockDetailMixin).extend({ ...@@ -92,7 +93,7 @@ export default VueTypedMixins(blockDetailMixin).extend({
TradeTable, TradeTable,
ConsensusNodeTable, ConsensusNodeTable,
}, },
}) });
</script> </script>
<style scoped> <style scoped>
......
...@@ -5,6 +5,7 @@ const MomentLocalesPlugin = require("moment-locales-webpack-plugin"); ...@@ -5,6 +5,7 @@ const MomentLocalesPlugin = require("moment-locales-webpack-plugin");
module.exports = { module.exports = {
outputDir: "dist", outputDir: "dist",
publicPath: "./", publicPath: "./",
lintOnSave:false,
devServer: { devServer: {
proxy: { proxy: {
// 设置代理 // 设置代理
...@@ -25,7 +26,7 @@ module.exports = { ...@@ -25,7 +26,7 @@ module.exports = {
"/yccApi": { "/yccApi": {
// target: "https://mainnet.yuan.org/api", // target: "https://mainnet.yuan.org/api",
// target: "http://13.115.171.240:7901/", // target: "http://13.115.171.240:7901/",
target: "http://183.134.99.140:9901/", target: "https://yuan.org/yccApi",
pathRewrite: { pathRewrite: {
"^/yccApi": "", "^/yccApi": "",
}, },
...@@ -39,7 +40,7 @@ module.exports = { ...@@ -39,7 +40,7 @@ module.exports = {
}, },
"/expandApi": { "/expandApi": {
// target: "http://121.37.141.165:19992/ycc", // target: "http://121.37.141.165:19992/ycc",
target: "http://183.134.99.140:19993/pos33", target: "https://yuan.org/expandApi",
pathRewrite: { pathRewrite: {
"^/expandApi": "", "^/expandApi": "",
}, },
......
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