From f75a89ac2d1f87683059f8cc15b84e8d53571334 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Mon, 7 Nov 2022 13:18:01 +0800 Subject: [PATCH] remove abstain --- src/views/Dashboard.vue | 6 +++--- src/views/GovernanceProposalView.vue | 6 ++++-- .../components/governance/ProposalSummaryComponent.vue | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index bb3c958e..1293cbad 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -179,7 +179,7 @@ v-b-tooltip.hover title="Threshold" class="box overlay" - :style="`left:${scaleWidth(prop.tally)}%;`" + :style="`left:${scaleWidth(prop)}%;`" />
@@ -410,9 +411,10 @@ export default { scaleWidth(p) { if (this.tallyParam) { if (p.status === 2) { - return Number(this.tallyParam.quorum) * Number(this.tallyParam.threshold) * 100 + return Number(this.tallyParam.quorum) * Number(this.tallyParam.threshold) * (1 - p.tally.abstain) * 100 } - return Number(this.tallyParam.threshold) * 100 + console.log(p.tally, Number(this.tallyParam.threshold) * (1 - p.tally.abstain) * 100) + return Number(this.tallyParam.threshold) * (1 - p.tally.abstain) * 100 } return 50 }, diff --git a/src/views/components/governance/ProposalSummaryComponent.vue b/src/views/components/governance/ProposalSummaryComponent.vue index e79e3ed1..1cf46b7e 100644 --- a/src/views/components/governance/ProposalSummaryComponent.vue +++ b/src/views/components/governance/ProposalSummaryComponent.vue @@ -219,9 +219,9 @@ export default { scaleWidth(p) { if (this.tallyParam) { if (p.status === 2) { - return Number(this.tallyParam.quorum) * Number(this.tallyParam.threshold) * 100 + return Number(this.tallyParam.quorum) * Number(this.tallyParam.threshold) * (1 - p.tally.abstain) * 100 } - return Number(this.tallyParam.threshold) * 100 + return Number(this.tallyParam.threshold) * (1 - p.tally.abstain) * 100 } return 50 },