text: webpackJsonp([33],{DzH6:function(e,s,t){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var a=t("LPk9"),o=t("KcW0"),i=t("x47x"),n={data:function(){return{showData:!1,sortValue:this.$t("message.c46"),indexTo:this.$route.query.indexTo,sortKey:"",sortConsensusList:[],keyword:"",selectKeyword:"",creditValuesShow0:!1,creditValuesShow1:!1,creditValuesShow2:!1,allConsensus:[],totalAll:0,pageNumber:1}},components:{Back:a.a,ProgressBar:o.a},mounted:function(){var e="";"1"===this.indexTo?(e={pageSize:"16",pageNumber:this.pageNumber},this.indexTo="2",sessionStorage.removeItem("keyword"),sessionStorage.removeItem("sortKey"),sessionStorage.removeItem("pageNumber")):e={keyword:sessionStorage.getItem("keyword"),sortType:sessionStorage.getItem("sortKey"),pageSize:"16",pageNumber:sessionStorage.getItem("pageNumber")},this.getAllConsensus("/consensus/agent/list/",e)},beforeRouteEnter:function(e,s,t){t(function(e){e.sortConsensusList=[],e.getShowDataList()})},beforeRouteLeave:function(e,s,t){"/nodePage"!==e.name&&(e.meta.keepAlive=!1),t()},methods:{getAllConsensus:function(e,s){var t=this;this.$fetch(e,s).then(function(e){if(e.success){for(var s=new i.BigNumber(1e-8),a=0;a<e.data.list.length;a++)e.data.list[a].creditVals=e.data.list[a].creditVal,e.data.list[a].deposit=parseFloat(s.times(e.data.list[a].deposit).toString()),e.data.list[a].agentAddresss=e.data.list[a].agentAddress.substr(0,6)+"..."+e.data.list[a].agentAddress.substr(-6),e.data.list[a].creditVal=((e.data.list[a].creditVal+1)/2*100).toFixed().toString()+"%",e.data.list[a].totalDeposit=parseFloat(s.times(e.data.list[a].totalDeposit).toString());t.$nextTick(function(){this.totalAll=e.data.total}),t.allConsensus=e.data.list}else t.totalAll=0,t.allConsensus=[]})},allConsensusSize:function(e){this.pageNumber=e;var s="";s=""!==this.keyword?{keyword:this.keyword,pageSize:"16",pageNumber:e}:"Comprehensive"!==this.sortValue?{sortType:this.sortKey,pageSize:"16",pageNumber:e}:""!==this.keyword&&"Comprehensive"!==this.sortValue?{keyword:this.keyword,sortType:this.sortKey,pageSize:"16",pageNumber:e}:{pageSize:"16",pageNumber:e},this.getAllConsensus("/consensus/agent/list/",s)},getShowDataList:function(){for(var e=0;e<4;e++)this.sortConsensusList.push({sortName:this.$t("message.sortListName"+e),sortKey:this.$t("message.sortListKey"+e)})},showDataList:function(e){this.sortConsensus(this.sortValue,e)},searchConsensus:function(){if(""!==this.keyword){var e={keyword:this.keyword,pageSize:"16",pageNumber:"1"};this.getAllConsensus("/consensus/agent/list/",e)}else this.getAllConsensus("/consensus/agent/list/",{pageSize:"16",pageNumber:"1"})},sortConsensus:function(e,s){if(this.totalAll=0,this.showData=!1,this.sortValue=e,this.sortKey=s,""!==this.keyword){var t={keyword:this.keyword,sortType:s,pageSize:"16",pageNumber:"1"};this.getAllConsensus("/consensus/agent/list/",t)}else{var a={sortType:s,pageSize:"16",pageNumber:"1"};this.getAllConsensus("/consensus/agent/list/",a)}},toggleShow:function(e){this.creditValuesShow0=!this.creditValuesShow0},toNodePage:function(e){this.$router.push({path:"/consensus/nodePage",query:{address:e}}),sessionStorage.setItem("keyword",this.keyword),sessionStorage.setItem("sortKey",this.sortKey)}}},r={render:function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"agency-node"},[t("Back",{attrs:{backTitle:this.$t("message.consensusManagement")}}),e._v(" "),t("h2",[e._v(e._s(e.$t("message.c43")))]),e._v(" "),t("div",{staticClass:"agency-node-top"},[t("div",{staticClass:"search-div fl"},[t("el-input",{attrs:{placeholder:this.$t("message.c44")},model:{value:e.keyword,callback:function(s){e.keyword=s},expression:"keyword"}},[t("template",{slot:"append"},[t("el-button",{attrs:{slot:"append"},on:{click:e.searchConsensus},slot:"append"},[e._v(e._s(e.$t("message.c45")))])],1)],2)],1),e._v(" "),t("div",{staticClass:"select-div fl"},[t("el-select",{attrs:{placeholder:e.sortValue,"popper-append-to-body":!1},on:{change:e.showDataList},model:{value:e.sortKey,callback:function(s){e.sortKey=s},expression:"sortKey"}},e._l(e.sortConsensusList,function(e){return t("el-option",{key:e.sortKey,attrs:{label:e.sortName,value:e.sortKey}})}))],1)]),e._v(" "),t("div",{staticClass:"agency-node-bottom"},e._l(e.allConsensus,function(s,a){return t("div",{staticClass:"div-icon cursor-p",on:{click:function(t){e.toNodePage(s.agentHash)}}},[t("p",{staticClass:"subscript",class:0===s.status?"stay":""},[e._v("\n        "+e._s(e.$t("message.status"+s.status))+"\n      ")]),e._v(" "),t("h3",[e._v(e._s(s.agentId))]),e._v(" "),t("ul",[t("li",{staticClass:"overflow"},[t("label",[e._v(e._s(e.$t("message.c16"))+"：")]),e._v(e._s(s.agentName?s.agentName:s.agentAddresss)+"\n        ")]),e._v(" "),t("li",[t("label",[e._v(e._s(e.$t("message.c17"))+"：")]),e._v(e._s(s.commissionRate)+"%")]),e._v(" "),t("li",[t("label",[e._v(e._s(e.$t("message.c25"))+"：")]),e._v(e._s(s.deposit.toFixed(2))+" NULS")]),e._v(" "),t("li",{staticClass:"cb"},[t("label",{staticClass:"fl"},[e._v(e._s(e.$t("message.c47"))+"：")]),e._v(e._s(s.totalDeposit.toFixed(2))+"\n        ")]),e._v(" "),t("li",{on:{mouseover:function(s){e.toggleShow(a)},mouseout:function(s){e.toggleShow(a)}}},[t("label",{staticClass:"fl cursor-p"},[e._v(e._s(e.$t("message.c18"))+":")]),e._v(" "),t("ProgressBar",{attrs:{colorData:s.creditVals<0?"#f64b3e":"#82bd39",widthData:s.creditVal}})],1)])])})),e._v(" "),t("el-pagination",{directives:[{name:"show",rawName:"v-show",value:e.totalOK=this.totalAll>16,expression:"totalOK = this.totalAll > 16 ? true:false"}],staticClass:"cb",attrs:{layout:"prev, pager, next","page-size":16,total:this.totalAll},on:{"current-change":e.allConsensusSize}})],1)},staticRenderFns:[]};var l=t("vSla")(n,r,!1,function(e){t("v/lu")},null,null);s.default=l.exports},"v/lu":function(e,s){}});