1 |
- webpackJsonp([94],{j0k0:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("Gu7T"),r=a.n(i),n=a("Dd8w"),s=a.n(n),o=a("//Fk"),l=a.n(o),c=a("d7EF"),d=a.n(c),f=a("Xxa5"),u=a.n(f),h=a("u2KI"),p=a.n(h),m=a("exGp"),g=a.n(m),_={components:{datePicker:a("gzej").a},data:function(){var t=[this.$getDay(-30,!1),this.$getDay(0,!1)];return{default_time:t,reset:!1,pageLoading:!1,height:"",detailLoading:!1,detailsTableCol:[],pagination:{page:1,page_size:20,pages:0,total:0},filter:{time:t,sort_field:"",sort_type:""},updateTime:"",isHasData:!1}},computed:{isCanExport:function(){return!!this.$store.state.dataBoardAuth.can_export}},created:function(){this.initTableHeight(),this.handleGetData()},methods:{handleGetData:function(){this.handleGetList()},handleGetList:function(){var t=this;return g()(u.a.mark(function e(){var a,i,r,n,s,o,l;return u.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.detailLoading=!0,a={start_date:t.filter.time[0],end_date:t.filter.time[1],sort_field:t.filter.sort_field,sort_type:t.filter.sort_type},i=""+t.URL.BASEURL+t.URL.dataBoard_pitcherAdqAccountData,e.next=6,t.$axios.get(i,{params:a});case 6:if(r=e.sent,n=r.data,!(s=void 0===n?{}:n)||0!=s.errno){e.next=21;break}return s.rst.extra[0].fixed="left",o=[],s.rst.extra.forEach(function(t){t.name&&t.name.length>5&&-1==t.name.indexOf("(")&&(t.min_width=25*t.name.length),o.push(t)}),t.detailsTableCol=p()(o),e.next=16,t.$nextTick();case 16:l=Array.isArray(s.rst.data)?s.rst.data:[],t.$refs.detailsTable.reloadData(l),t.isHasData=!!l.length,e.next=22;break;case 21:4002!=s.errno&&(t.$message.warning(s.err),t.$refs.detailsTable.reloadData([]),t.isHasData=!1);case 22:e.next=29;break;case 24:e.prev=24,e.t0=e.catch(0),console.log(e.t0),t.$refs.detailsTable.reloadData([]),t.isHasData=!1;case 29:return e.prev=29,t.detailLoading=!1,e.finish(29);case 32:case"end":return e.stop()}},e,t,[[0,24,29,32]])}))()},onChangeTime:function(t){this.filter.time=Array.isArray(t)?t:[],this.handleGetData()},onClickSort:function(t,e){this.filter.sort_field===t?this.filter.sort_type===e?(this.filter.sort_field="",this.filter.sort_type=""):this.filter.sort_type=e:(this.filter.sort_field=t,this.filter.sort_type=e),this.handleGetData()},onClickReset:function(){this.reset=!this.reset,this.filter.time=this.default_time,this.filter.sort_field="",this.filter.sort_type="",this.handleGetData()},onClickExport:function(){var t=this;return g()(u.a.mark(function e(){var a,i,r,n,o,c;return u.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.isHasData){e.next=2;break}return e.abrupt("return",t.$message.warning("暂无数据可导出"));case 2:return e.prev=2,t.pageLoading=!0,a={detail:""+t.URL.BASEURL+t.URL.dataBoard_pitcherAdqAccountData},i={start_date:t.filter.time[0],end_date:t.filter.time[1]},e.next=8,l.a.all([t.$axios.get(a.detail,{params:s()({},i,{sort_field:t.filter.sort_field,sort_type:t.filter.sort_type})})]);case 8:r=e.sent,n=d()(r,1),o=n[0].data,(c=void 0===o?{}:o)&&0==c.errno?t.handleExport({detailData:c.rst}):4002!=c.errno&&t.$message.warning(c.err),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),console.log(e.t0),t.$message.warning("导出失败,请重试");case 19:return e.prev=19,t.pageLoading=!1,e.finish(19);case 22:case"end":return e.stop()}},e,t,[[2,15,19,22]])}))()},handleExport:function(t){var e=t.detailData,a=void 0===e?{}:e,i=[{tHeader:[].concat(r()(a.extra.map(function(t){return""+t.name}))),filterVal:[].concat(r()(a.extra.map(function(t){return t.column}))),tableDatas:[].concat(r()(a.data)),sheetName:""}];this.$exportOrder({excelDatas:i,name:"投手ADQ数据统计(导出时间:"+this.$getDay(0)+")"})},getHeaderCellStyle:function(){return{backgroundColor:"#FFFFFF !important",border:"none!important"}},initTableHeight:function(){this.height=document.documentElement.clientHeight-180>400?document.documentElement.clientHeight-180:400}}},v={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.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:t.default_time,clearFlag:!1,reset:t.reset},on:{changeTime:t.onChangeTime}})],1),t._v(" "),t.isCanExport?a("el-button",{staticClass:"export-btn",attrs:{type:"primary",size:"mini"},on:{click:t.onClickExport}},[t._v("导出Excel")]):t._e()],1),t._v(" "),a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.detailLoading,expression:"detailLoading"}]},[a("ux-grid",{ref:"detailsTable",staticClass:"detailsTable",attrs:{border:!1,"header-cell-style":t.getHeaderCellStyle,"show-footer-overflow":"tooltip","show-overflow":"tooltip",size:"mini",height:t.height},on:{"row-click":function(){}}},t._l(t.detailsTableCol,function(e,i){return a("ux-table-column",{key:e.column+e.name,attrs:{resizable:!0,field:e.column,title:e.name,"min-width":e.min_width?e.min_width:132,fixed:e.fixed?e.fixed:"",align:"center"},scopedSlots:t._u([{key:"header",fn:function(){return[a("div",{staticClass:"flex-align-jus-center"},[t._v("\n "+t._s(e.name)+"\n "),e.notes?a("el-tooltip",{attrs:{content:e.notes,placement:"top"}},[a("div",[a("i",{staticClass:"el-icon-question"})])]):t._e(),t._v(" "),e.enable_to_sort?a("div",{staticClass:"sort-wrap"},[a("i",{staticClass:"el-icon-caret-top",class:{active:t.filter.sort_field===e.column&&"asc"===t.filter.sort_type},on:{click:function(a){return t.onClickSort(e.column,"asc")}}}),t._v(" "),a("i",{staticClass:"el-icon-caret-bottom",class:{active:t.filter.sort_field===e.column&&"desc"===t.filter.sort_type},on:{click:function(a){return t.onClickSort(e.column,"desc")}}})]):t._e()],1)]},proxy:!0},{key:"default",fn:function(i){var r=i.row;return["pitcher_name"==e.column?a("span",[t._v(t._s(r[e.column]||"-"))]):a("span",[t._v(t._s(r[e.column]||0==r[e.column]?t.$formatNum(r[e.column]):"-"))])]}}],null,!0)})}),1)],1)])},staticRenderFns:[]};var x=a("VU/8")(_,v,!1,function(t){a("oXGH")},"data-v-2746ddca",null);e.default=x.exports},oXGH:function(t,e){}});
|