Commit 1680c817 authored by chenqikuai's avatar chenqikuai

fix

parent 1890df05
...@@ -117,10 +117,11 @@ export default Vue.extend({ ...@@ -117,10 +117,11 @@ export default Vue.extend({
// 接下来的使用就跟之前一样,初始化图表,设置配置项 // 接下来的使用就跟之前一样,初始化图表,设置配置项
// filters: ['D1', 'W1', 'M1', 'Y1'], // filters: ['D1', 'W1', 'M1', 'Y1'],
const times = this.generate() const times = this.generate()
times &&
statSearch(times).then((ret) => { statSearch(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, null) var myChart = echarts.init(this.$refs.charts as HTMLElement)
myChart.setOption({ myChart.setOption({
xAxis: { xAxis: {
type: 'category', type: 'category',
...@@ -137,7 +138,7 @@ export default Vue.extend({ ...@@ -137,7 +138,7 @@ export default Vue.extend({
series: [ series: [
{ {
data: this.xData data: this.xData
.map((i) => (i && i[0] && i[0].tx_count) || 0) .map((i: any) => (i && i[0] && i[0].tx_count) || 0)
.reverse(), .reverse(),
type: 'line', type: 'line',
areaStyle: {}, areaStyle: {},
......
<template> <template>
<div class="container"> <div class="_container">
<div class="top flex items-center"> <div class="top flex items-center">
<div class="address_label mr-2.5 my-title"> <div class="address_label mr-2.5 my-title">
{{ $t('lang.address.address') }} {{ $t('lang.address.address') }}
...@@ -59,7 +59,7 @@ export default VueTypedMixins(AddressOverview).extend({ ...@@ -59,7 +59,7 @@ export default VueTypedMixins(AddressOverview).extend({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { ._container {
width: 1200px; width: 1200px;
height: 440px; height: 440px;
background: #ffffff; background: #ffffff;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
element-loading-spinner="el-icon-loading" element-loading-spinner="el-icon-loading"
> >
<div class="flex"> <div class="flex">
<div class="flex left overflow-hidden flex-shrink-0"> <div class="flex _left overflow-hidden flex-shrink-0">
<img <img
src="@/assets/images/blockChainBrowser/blockDetail/block.png" src="@/assets/images/blockChainBrowser/blockDetail/block.png"
class="blockIcon" class="blockIcon"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="middle flex-shrink-0"> <div class="_middle flex-shrink-0">
<div class="my-title"> <div class="my-title">
{{ $t('lang.block.blockRevenue') }} {{ $t('lang.block.blockRevenue') }}
</div> </div>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{{ $route.query.height | filterBlockReward }} {{ $route.query.height | filterBlockReward }}
</div> </div>
</div> </div>
<div class="right flex-shrink-0"> <div class="_right flex-shrink-0">
<div class="my-title"> <div class="my-title">
{{ $t('lang.block.txCount') }} {{ $t('lang.block.txCount') }}
</div> </div>
...@@ -108,14 +108,14 @@ export default Vue.extend({ ...@@ -108,14 +108,14 @@ export default Vue.extend({
height: 52px; height: 52px;
margin-right: 20px; margin-right: 20px;
} }
.left { ._left {
width: 360px; width: 360px;
} }
.middle { ._middle {
width: 260px; width: 260px;
} }
.right { ._right {
width: 220px; width: 220px;
} }
.theTitle { .theTitle {
......
<template> <template>
<div class="container shadow-shadow1 bg-white" style="padding: 30px;"> <div class="_container shadow-shadow1 bg-white" style="padding: 30px;">
<div class="flex justify-between"> <div class="flex justify-between">
<div class="text-darkBlue text-lg font-bold"> <div class="text-darkBlue text-lg font-bold">
{{ $t('lang.chainPerf.txNumberOnTheChain') }} {{ $t('lang.chainPerf.txNumberOnTheChain') }}
...@@ -37,7 +37,7 @@ export default Vue.extend({ ...@@ -37,7 +37,7 @@ export default Vue.extend({
</script> </script>
<style scoped> <style scoped>
.container { ._container {
height: 280px; height: 280px;
border-radius: 4px; border-radius: 4px;
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
</div> </div>
<div> <div>
<MySelect <MySelect
v-if="!hideSelect"
style="width: 310px;" style="width: 310px;"
:selectedValue="value" :selectedValue="value"
:optionList="optionList" :optionList="optionList"
...@@ -26,6 +27,9 @@ export default Vue.extend({ ...@@ -26,6 +27,9 @@ export default Vue.extend({
value: [String, Number], value: [String, Number],
setValue: Function, setValue: Function,
optionList: Array as PropType<iOptionItem[]>, optionList: Array as PropType<iOptionItem[]>,
hideSelect: {
type: Boolean,
},
}, },
data() { data() {
return {} return {}
......
...@@ -3,7 +3,15 @@ import { getLatestBlock } from "ycc-api/dist/cmjs/service/home/index"; ...@@ -3,7 +3,15 @@ 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 Base64 from "@/utils/_base64"; import Base64 from "@/utils/_base64";
import { blockStatStatGets, getAccountCount, getTxList } from "@/service/api"; import moment from "moment";
import {
blockStatStatGets,
getAccountCount,
getAllPos33TicketCount,
getTxCountBewteenTimes,
getTxList,
} from "@/service/api";
export default Vue.extend({ export default Vue.extend({
data() { data() {
return { return {
...@@ -18,9 +26,26 @@ export default Vue.extend({ ...@@ -18,9 +26,26 @@ export default Vue.extend({
tps: 0, tps: 0,
addressNumber: 0, addressNumber: 0,
latestTxs: [], latestTxs: [],
ticketCount: 0,
}; };
}, },
mounted() { mounted() {
getTxCountBewteenTimes(
moment().unix(),
moment()
.add(24, "hour")
.unix()
).then((res) => {
if (res.error === null) {
this.tps = Number(((res.result / 24) * 60 * 60).toFixed(2));
}
});
getAllPos33TicketCount().then((ret) => {
if (ret.error === null) {
this.ticketCount = ret.result;
}
});
getAccountCount().then((ret) => { getAccountCount().then((ret) => {
if (ret.error === null) { if (ret.error === null) {
this.addressNumber = ret.result; this.addressNumber = ret.result;
...@@ -39,7 +64,6 @@ export default Vue.extend({ ...@@ -39,7 +64,6 @@ export default Vue.extend({
})); }));
} }
}); });
this.getSpeed();
}, },
methods: { methods: {
getSpeed() { getSpeed() {
...@@ -49,11 +73,10 @@ export default Vue.extend({ ...@@ -49,11 +73,10 @@ export default Vue.extend({
const lastBlock = res.result[1]; const lastBlock = res.result[1];
const perTime = const perTime =
(lastBlock.time - fatherBlock.time) / (this.latestHeight - 725000); (lastBlock.time - fatherBlock.time) / (this.latestHeight - 725000);
const perTxCount = // const perTxCount =
(lastBlock.tx_count - fatherBlock.tx_count) / // (lastBlock.tx_count - fatherBlock.tx_count) /
(lastBlock.time - fatherBlock.time); // (lastBlock.time - fatherBlock.time);
this.tps = perTime; this.speed = perTime;
this.tps = perTxCount;
} }
}); });
}, },
...@@ -104,7 +127,7 @@ export default Vue.extend({ ...@@ -104,7 +127,7 @@ export default Vue.extend({
this.latestHeight = lastHeaderRet.result.height; this.latestHeight = lastHeaderRet.result.height;
this.$store.commit("saveMaxHeight", this.latestHeight); this.$store.commit("saveMaxHeight", this.latestHeight);
const str = this.hexCharCodeToStr(lastHeaderRet.result.hash); const str = this.hexCharCodeToStr(lastHeaderRet.result.hash);
this.getSpeed();
fetch("/market") fetch("/market")
.then((ret) => ret.json()) .then((ret) => ret.json())
.then((ret) => { .then((ret) => {
...@@ -151,7 +174,7 @@ export default Vue.extend({ ...@@ -151,7 +174,7 @@ export default Vue.extend({
{ {
icon: require("@/assets/images/blockChainBrowser/home/pledgeQuantity.png"), icon: require("@/assets/images/blockChainBrowser/home/pledgeQuantity.png"),
title: this.$t("lang.chainMsg.pledgeQuantity"), title: this.$t("lang.chainMsg.pledgeQuantity"),
number: 102938, number: this.ticketCount,
}, },
]; ];
}, },
......
import Vue from "vue"; import Vue from "vue";
import QRCode from "qrcode"; import QRCode from "qrcode";
import { getAddressTxCount } from "@/service/api";
export default Vue.extend({ export default Vue.extend({
data() { data() {
return {}; return {
txCount: 0,
};
}, },
mounted() { mounted() {
this.init(); this.init();
getAddressTxCount(this.$route.query.address as string).then((ret) => {
if (ret.error === null) {
this.txCount = ret.result;
}
});
}, },
activated() { activated() {
this.init(); this.init();
}, },
computed: { computed: {
tradeInTotalList() { tradeInTotalList(): any {
return [ return [
{ {
name: this.$t("lang.address.totalReception"), name: this.$t("lang.address.totalReception"),
...@@ -23,7 +31,7 @@ export default Vue.extend({ ...@@ -23,7 +31,7 @@ export default Vue.extend({
}, },
{ {
name: this.$t("lang.block.txCount"), name: this.$t("lang.block.txCount"),
value: "100YCC", value: this.txCount,
}, },
{ {
name: this.$t("lang.address.totalValue"), name: this.$t("lang.address.totalValue"),
......
...@@ -172,3 +172,62 @@ export function statSearch(times: number[]) { ...@@ -172,3 +172,62 @@ export function statSearch(times: number[]) {
}, },
}); });
} }
export function getAddressTxCount(addr: string) {
return axios(expandApi, {
method: "post",
params: {
id: 1,
method: "Tx.TxCount",
params: [
{
match_one: [
{
key: "from",
value: addr,
},
{
key: "to",
value: addr,
},
],
match: [],
},
],
},
});
}
export function getAllPos33TicketCount() {
return axios("/yccApi", {
method: "post",
params: {
method: "pos33.GetAllPos33TicketCount",
params: [{}],
},
});
}
export function getTxCountBewteenTimes(
startUnixTime: number,
endUnixTime: number
) {
return axios(expandApi, {
method: "post",
params: {
id: 1,
method: "Tx.TxCount",
params: [
{
range: [
{
start: startUnixTime,
end: endUnixTime,
key: "block_time",
},
],
},
],
},
});
}
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
:setFocusedTab="setFocusedTab" :setFocusedTab="setFocusedTab"
></m-tabs> ></m-tabs>
<div class="bg-white px-4"> <div class="bg-white px-4">
<Select <!-- <Select
v-if="focusedTab === 'txRecordTab'" v-if="focusedTab === 'txRecordTab'"
:selectedValue="txRecordFilterValue" :selectedValue="txRecordFilterValue"
:optionList="txRecordFilterOptionList" :optionList="txRecordFilterOptionList"
@change="(v) => (txRecordFilterValue = v)" @change="(v) => (txRecordFilterValue = v)"
></Select> ></Select> -->
</div> </div>
<div class="bg-white px-4"> <div class="bg-white px-4">
<Select <Select
......
...@@ -22,12 +22,7 @@ ...@@ -22,12 +22,7 @@
:setFocusedTab="(v) => (focusedTab = v)" :setFocusedTab="(v) => (focusedTab = v)"
:focusedTab="focusedTab" :focusedTab="focusedTab"
></TabList> ></TabList>
<DataFilter <DataFilter v-if="focusedTab === 'txRecordTab'" :hideSelect="true">
v-if="focusedTab === 'txRecordTab'"
:optionList="txRecordFilterOptionList"
:setValue="(v) => (txRecordFilterValue = v)"
:value="txRecordFilterValue"
>
<template #left> <template #left>
{{ $t('lang.trade.txTotal', [pages.total]) }} {{ $t('lang.trade.txTotal', [pages.total]) }}
</template> </template>
......
...@@ -22,8 +22,8 @@ module.exports = { ...@@ -22,8 +22,8 @@ module.exports = {
changeOrigin: true, changeOrigin: true,
}, },
"/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/",
pathRewrite: { pathRewrite: {
"^/yccApi": "", "^/yccApi": "",
}, },
......
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