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

View File

@ -173,6 +173,7 @@
<div
v-if="tallyParam"
title="Threshold"
class="box overlay"
:style="`left:${scaleWidth(proposal)}%;`"
/>
@ -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
},

View File

@ -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
},