diff --git a/package-lock.json b/package-lock.json index 028f849..8fa23ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4218,9 +4218,9 @@ } }, "element-ui": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.7.2.tgz", - "integrity": "sha512-Exh9QTkm9gwMMPzg1TyaTlBKyr3k4K9XcC5vl0A/mneDvJX//RsURGuOWsCNDVQMdhh5h9e+W5icosh+pKfbCg==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.9.1.tgz", + "integrity": "sha512-w8vrCW5Q+2gfDzs19MUrFdnCy5IjF98rs7DBsKnJQKFfZJZiZ2O+YAsSp/EuPrCm3P/2o/N3MtvZ34VANel13g==", "requires": { "async-validator": "~1.8.1", "babel-helper-vue-jsx-merge-props": "^2.0.0", diff --git a/package.json b/package.json index e0b7a17..603fe26 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dependencies": { "axios": "^0.18.0", "echarts": "^4.2.1", - "element-ui": "^2.4.5", + "element-ui": "^2.9.1", "eosjs": "^16.0.9", "http2": "^3.3.7", "marked": "^0.6.2", diff --git a/src/plugins/element.js b/src/plugins/element.js index 4ac5343..a7dc428 100644 --- a/src/plugins/element.js +++ b/src/plugins/element.js @@ -20,6 +20,7 @@ import { Main, Menu, MenuItem, + Pagination, Progress, Option, Radio, @@ -50,6 +51,7 @@ Vue.use(DropdownMenu) Vue.use(DropdownItem) Vue.use(Progress) +Vue.use(Pagination) Vue.use(Menu) Vue.use(MenuItem) diff --git a/src/views/PollDetail.vue b/src/views/PollDetail.vue index a6b9d78..14cdb40 100644 --- a/src/views/PollDetail.vue +++ b/src/views/PollDetail.vue @@ -14,6 +14,8 @@
{{proposal.proposal.proposal_json.type || 'unknown'}} +
+ Budget: {{incentives}}


-

Meet the conditions {{this.proposal.meet_conditions_days}} {{this.proposal.meet_conditions_days > 1 ? 'days' : 'day'}}

+
+

{{this.proposal.meet_conditions_days}} {{this.proposal.meet_conditions_days > 1 ? 'days' : 'day'}} satisfied

+ +

{{this.proposal ? this.proposal.stats.votes.accounts : 0}} accounts

{{this.proposal ? this.calcDays(this.proposal.proposal.created_at, new Date().toString()) : 0}} days since poll started

@@ -410,6 +415,30 @@ export default { }) return comm }, + incentives () { + if (this.proposal) { + if (this.proposal.proposal.proposal_json.incentives !== undefined) { + let incentives = Number(this.proposal.proposal.proposal_json.incentives) + let integer = Number(incentives.toFixed(0)) + let decimals = String(incentives * 10000 % 10000) + while (decimals.length < 4) { + decimals = '0' + decimals + } + return this.$util.toThousands(integer) + '.' + decimals + ' BOS' + } else { + if (this.budgetList[this.proposal.proposal.proposal_name] !== undefined) { + let incentives = Number(this.budgetList[this.proposalName]) + let integer = Number(incentives.toFixed(0)) + let decimals = String(incentives * 10000 % 10000) + while (decimals.length < 4) { + decimals = '0' + decimals + } + return this.$util.toThousands(integer) + '.' + decimals + ' BOS' + } + } + } + return 'Not declare' + }, otherComm () { let comm = [] this.votes.forEach(vote => { @@ -481,8 +510,15 @@ export default { return 'no content' } }, - abstainPercent () { - return Number((100 - this.agreePercent - this.rejectPercent).toFixed(1)) + satisfiedPercent () { + if (this.proposal) { + if (this.proposal.meet_conditions_days > 20) { + return 100 + } + return Number((100 * this.proposal.meet_conditions_days / 20).toFixed(1)) + } else { + return 0 + } }, agreePercent () { if (!this.proposal || this.proposal.stats.staked.total === 0 || !this.proposal.stats.staked[1]) { @@ -583,7 +619,18 @@ export default { propLoading: true, writeComment: false, showVotersNum: 30, - screenWidth: document.body.clientWidth + screenWidth: document.body.clientWidth, + budgetList: { + 'historyindex': '250000.0000', + 'eosiosg11111': '1000000.0000', + 'bosnationwps': '515000.0000', + 'constantstab': '350000.0000', + 'hyperion.api': '995600.0000', + 'chintaionbos': '1000000.0000', + 'omegaautodex': '450000.0000', + 'btconbos': '400000.0000', + 'universal': '800000.0000' + } } }, created () { @@ -820,6 +867,9 @@ export default { if (this.showVotersNum > this.votes.length) { this.showVotersNum = this.votes.length } + }, + satisfiedText (percentage) { + return `${this.proposal.meet_conditions_days}/20` } }, watch: { @@ -860,7 +910,7 @@ export default { color #F46666 .el-progress-bar__inner background-image linear-gradient(269deg, #F06262 0%, #FF7171 100%) - .abstain-percent + .satisfied-percent .el-progress__text color #F4D03F .el-progress-bar__inner diff --git a/src/views/Referendum.vue b/src/views/Referendum.vue index 9e90d7b..6f9a341 100644 --- a/src/views/Referendum.vue +++ b/src/views/Referendum.vue @@ -180,6 +180,7 @@
+

No relevant proposals

+ + @@ -218,6 +227,7 @@ export default { return { actionLoading: false, activeTab: 'proposals', + currentPage: 1, extendTime: null, extendPropName: '', extendVisible: false,