1 |
- webpackJsonp([98],{Cj3b:function(e,t){},SMiQ:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("Gu7T"),n=a.n(i),r=a("Dd8w"),s=a.n(r),o=a("//Fk"),l=a.n(o),c=a("d7EF"),d=a.n(c),p=a("u2KI"),u=a.n(p),g=a("Xxa5"),h=a.n(g),f=a("exGp"),m=a.n(f),v={components:{datePicker:a("gzej").a},data:function(){var e=[this.$getDay(-30,!1),this.$getDay(0,!1)];return{default_time:e,reset:!1,pageLoading:!1,height:"",detailLoading:!1,detailsTableCol:[],pagination:{page:1,page_size:20,pages:0,total:0},filter:{time:e,sort_field:"",sort_type:""},updateTime:""}},computed:{isCanExport:function(){return!!this.$store.state.dataBoardAuth.can_export}},created:function(){this.initTableHeight(),this.handleGetData()},methods:{handleGetData:function(){this.handleGetList(),this.handleGetUpdateTime()},handleGetUpdateTime:function(){var e=this;return m()(h.a.mark(function t(){var a,i,n,r;return h.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,a={type:"cumulative_recovery_data"},t.next=4,e.$axios.get(""+e.URL.BASEURL+e.URL.dataBoard_uptime,{params:a});case 4:i=t.sent,n=i.data,(r=void 0===n?{}:n)&&0==r.errno?e.updateTime=r.rst.uptime:4002!=r.errno&&(e.$message.warning(r.err),e.updateTime=""),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),e.updateTime="";case 13:case"end":return t.stop()}},t,e,[[0,10]])}))()},handleGetList:function(){var e=this;return m()(h.a.mark(function t(){var a,i,n,r,s,o,l;return h.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.detailLoading=!0,a={start_date:e.filter.time[0],end_date:e.filter.time[1],page:e.pagination.page,page_size:e.pagination.page_size},i=""+e.URL.BASEURL+e.URL.dataBoard_recharge_list,t.next=6,e.$axios.get(i,{params:a});case 6:if(n=t.sent,r=n.data,!(s=void 0===r?{}:r)||0!=s.errno){t.next=22;break}return s.rst.extra[0].fixed="left",o=[],s.rst.extra.forEach(function(e){e.name&&e.name.length>6&&(e.min_width=25*e.name.length),o.push(e)}),e.detailsTableCol=u()(o),t.next=16,e.$nextTick();case 16:l=Array.isArray(s.rst.data)?s.rst.data:[],e.$refs.detailsTable.reloadData(l),e.pagination.total=s.rst.pageInfo.total,e.pagination.pages=s.rst.pageInfo.pages,t.next=23;break;case 22:4002!=s.errno&&(e.$message.warning(s.err),e.$refs.detailsTable.reloadData([]),e.pagination.total=0,e.pagination.pages=0);case 23:t.next=31;break;case 25:t.prev=25,t.t0=t.catch(0),console.log(t.t0),e.$refs.detailsTable.reloadData([]),e.pagination.total=0,e.pagination.pages=0;case 31:return t.prev=31,e.detailLoading=!1,t.finish(31);case 34:case"end":return t.stop()}},t,e,[[0,25,31,34]])}))()},onChangeTime:function(e){this.filter.time=Array.isArray(e)?e:[],this.pagination.page=1,this.handleGetData()},onClickSort:function(e,t){this.filter.sort_field===e?this.filter.sort_type===t?(this.filter.sort_field="",this.filter.sort_type=""):this.filter.sort_type=t:(this.filter.sort_field=e,this.filter.sort_type=t),this.pagination.page=1,this.handleGetData()},handleCurrentChange:function(e){this.pagination.page=e,this.handleGetData()},handleSizeChange:function(e){this.pagination.page_size=e,this.pagination.page=1,this.handleGetData()},onClickReset:function(){this.reset=!this.reset,this.filter.time=this.default_time,this.filter.sort_field="",this.filter.sort_type="",this.pagination.page=1,this.handleGetData()},onClickExport:function(){var e=this;return m()(h.a.mark(function t(){var a,i,n,r,o,c;return h.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.pagination.total){t.next=2;break}return t.abrupt("return",e.$message.warning("暂无数据可导出"));case 2:return t.prev=2,e.pageLoading=!0,a={detail:""+e.URL.BASEURL+e.URL.dataBoard_recharge_list},i={start_date:e.filter.time[0],end_date:e.filter.time[1]},t.next=8,l.a.all([e.$axios.get(a.detail,{params:s()({},i,{page:1,page_size:e.$store.state.exportNumber})})]);case 8:n=t.sent,r=d()(n,1),o=r[0].data,(c=void 0===o?{}:o)&&0==c.errno?e.handleExport({detailData:c.rst}):4002!=c.errno&&e.$message.warning(c.err),t.next=19;break;case 15:t.prev=15,t.t0=t.catch(2),console.log(t.t0),e.$message.warning("导出失败,请重试");case 19:return t.prev=19,e.pageLoading=!1,t.finish(19);case 22:case"end":return t.stop()}},t,e,[[2,15,19,22]])}))()},handleExport:function(e){var t=e.detailData,a=void 0===t?{}:t,i=[{tHeader:[].concat(n()(a.extra.map(function(e){return""+e.name}))),filterVal:[].concat(n()(a.extra.map(function(e){return e.column}))),tableDatas:[].concat(n()(a.data)),sheetName:""}];this.$exportOrder({excelDatas:i,name:"充值数据(导出时间:"+this.$getDay(0)+")"})},getHeaderCellStyle:function(){return{backgroundColor:"#FFFFFF !important",border:"none!important"}},initTableHeight:function(){this.height=document.documentElement.clientHeight-240>400?document.documentElement.clientHeight-240:400}}},_={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.pageLoading,expression:"pageLoading"}],staticClass:"recharge-wrap"},[a("div",{staticClass:"screenBox"},[a("div",{staticClass:"flex-align-center",staticStyle:{"flex-wrap":"wrap","margin-right":"60px"}},[a("datePicker",{staticStyle:{"margin-right":"30px"},attrs:{title:"自定义",quickFlag:!0,afferent_time:e.default_time,clearFlag:!1,reset:e.reset},on:{changeTime:e.onChangeTime}})],1),e._v(" "),e.isCanExport?a("el-button",{staticClass:"export-btn",attrs:{type:"primary",size:"mini"},on:{click:e.onClickExport}},[e._v("导出Excel")]):e._e()],1),e._v(" "),a("div",{staticClass:"update-time"},[a("i",{staticClass:"el-icon-warning-outline"}),e._v("数据更新时间:"+e._s(e.updateTime||"-"))]),e._v(" "),a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.detailLoading,expression:"detailLoading"}]},[a("ux-grid",{ref:"detailsTable",staticClass:"detailsTable",attrs:{border:!1,"header-cell-style":e.getHeaderCellStyle,"show-footer-overflow":"tooltip","show-overflow":"tooltip",size:"mini",height:e.height},on:{"row-click":function(){}}},e._l(e.detailsTableCol,function(t,i){return a("ux-table-column",{key:t.column+t.name,attrs:{resizable:!0,field:t.column,title:t.name,"min-width":t.min_width?t.min_width:160,fixed:t.fixed?t.fixed:"",align:"center"},scopedSlots:e._u([{key:"header",fn:function(){return[a("div",{staticClass:"flex-align-jus-center"},[e._v("\n "+e._s(t.name)+"\n "),t.notes?a("el-tooltip",{attrs:{content:t.notes,placement:"top"}},[a("div",[a("i",{staticClass:"el-icon-question"})])]):e._e(),e._v(" "),t.enable_to_sort?a("div",{staticClass:"sort-wrap"},[a("i",{staticClass:"el-icon-caret-top",class:{active:e.filter.sort_field===t.column&&"asc"===e.filter.sort_type},on:{click:function(a){return e.onClickSort(t.column,"asc")}}}),e._v(" "),a("i",{staticClass:"el-icon-caret-bottom",class:{active:e.filter.sort_field===t.column&&"desc"===e.filter.sort_type},on:{click:function(a){return e.onClickSort(t.column,"desc")}}})]):e._e()],1)]},proxy:!0},{key:"default",fn:function(i){var n=i.row;return[a("span",[e._v(e._s(n[t.column]||0==n[t.column]?e.$formatNum(n[t.column]):"-"))])]}}],null,!0)})}),1),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:e.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":e.pagination.page,layout:"prev, pager, next, sizes","page-sizes":[20,50,100],"page-count":Number(e.pagination.pages)},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}})],1)],1)])},staticRenderFns:[]};var x=a("VU/8")(v,_,!1,function(e){a("Cj3b")},"data-v-05cfc92d",null);t.default=x.exports}});
|