remove abstain

This commit is contained in:
liangping 2022-11-07 13:18:01 +08:00
parent 3aa899bf90
commit f75a89ac2d
3 changed files with 9 additions and 7 deletions

View File

@ -179,7 +179,7 @@
v-b-tooltip.hover v-b-tooltip.hover
title="Threshold" title="Threshold"
class="box overlay" class="box overlay"
:style="`left:${scaleWidth(prop.tally)}%;`" :style="`left:${scaleWidth(prop)}%;`"
/> />
<div <div
v-if="tallyParam" v-if="tallyParam"
@ -655,9 +655,9 @@ export default {
} }
return 'be rejected' return 'be rejected'
}, },
scaleWidth() { scaleWidth(p) {
if (this.tallyParam) { if (this.tallyParam) {
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 50 return 50
}, },

View File

@ -173,6 +173,7 @@
<div <div
v-if="tallyParam" v-if="tallyParam"
title="Threshold"
class="box overlay" class="box overlay"
:style="`left:${scaleWidth(proposal)}%;`" :style="`left:${scaleWidth(proposal)}%;`"
/> />
@ -410,9 +411,10 @@ export default {
scaleWidth(p) { scaleWidth(p) {
if (this.tallyParam) { if (this.tallyParam) {
if (p.status === 2) { 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 return 50
}, },

View File

@ -219,9 +219,9 @@ export default {
scaleWidth(p) { scaleWidth(p) {
if (this.tallyParam) { if (this.tallyParam) {
if (p.status === 2) { 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 return 50
}, },