text: webpackJsonp([12],{Nnma:function(e,t,a){(e.exports=a("BkJT")(!1)).push([e.i,"\n.radio-label {\r\n  font-size: 14px;\r\n  color: #606266;\r\n  line-height: 40px;\r\n  padding: 0 12px 0 30px;\n}\r\n",""])},cLdg:function(e,t,a){var n=a("Nnma");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);a("8bSs")("459655d4",n,!0)},oz0I:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("vLgD");var l=a("hRKE"),i=a.n(l);function o(e,t){if(0===arguments.length)return null;var a=t||"{y}-{m}-{d} {h}:{i}:{s}",n=void 0;"object"===(void 0===e?"undefined":i()(e))?n=e:(10===(""+e).length&&(e=1e3*parseInt(e)),n=new Date(e));var l={y:n.getFullYear(),m:n.getMonth()+1,d:n.getDate(),h:n.getHours(),i:n.getMinutes(),s:n.getSeconds(),a:n.getDay()};return a.replace(/{(y|m|d|h|i|s|a)+}/g,function(e,t){var a=l[t];return"a"===t?["一","二","三","四","五","六","日"][a-1]:(e.length>0&&a<10&&(a="0"+a),a||0)})}var r={name:"exportExcel",data:function(){return{list:null,listLoading:!0,downloadLoading:!1,filename:"",autoWidth:!0,total:0,page:1,pageSize:10}},created:function(){this.fetchData()},methods:{fetchData:function(){var e,t=this;this.listLoading=!0,Object(n.a)({url:"/excel/exportExcel",method:"get",params:e}).then(function(e){var a=e.data.filter(function(e,a){return a<10*t.page&&a>=10*(t.page-1)});console.log(a),t.total=e.data.length,t.list=a,t.listLoading=!1})},handleCurrentChange:function(e){this.page=e,console.log(this.page),this.fetchData()},handleSizeChange:function(e){this.page=e,console.log(this.page),this.fetchData()},handleDownload:function(){var e=this;this.downloadLoading=!0,a.e(20).then(a.bind(null,"zWO4")).then(function(t){var a=e.list,n=e.formatJson(["id","title","author","pageviews","display_time"],a);t.export_json_to_excel({header:["Id","Title","Author","Readings","Date"],data:n,filename:e.filename,autoWidth:e.autoWidth}),e.downloadLoading=!1})},formatJson:function(e,t){return t.map(function(t){return e.map(function(e){return"timestamp"===e?o(t[e]):t[e]})})}}},s={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("label",{staticClass:"radio-label",staticStyle:{"padding-left":"0"}},[e._v("Filename: ")]),e._v(" "),a("el-input",{staticStyle:{width:"340px"},attrs:{placeholder:e.$t("excel.placeholder"),"prefix-icon":"el-icon-document"},model:{value:e.filename,callback:function(t){e.filename=t},expression:"filename"}}),e._v(" "),a("label",{staticClass:"radio-label"},[e._v("Cell Auto Width: ")]),e._v(" "),a("el-radio-group",{model:{value:e.autoWidth,callback:function(t){e.autoWidth=t},expression:"autoWidth"}},[a("el-radio",{attrs:{label:!0,border:""}},[e._v("True")]),e._v(" "),a("el-radio",{attrs:{label:!1,border:""}},[e._v("False")])],1),e._v(" "),a("el-button",{staticStyle:{margin:"0 0 20px 20px"},attrs:{type:"primary",icon:"document",loading:e.downloadLoading},on:{click:e.handleDownload}},[e._v(e._s(e.$t("excel.export"))+" excel")]),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,"element-loading-text":"拼命加载中",border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{align:"center",label:"Id",width:"95"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n        "+e._s(t.$index)+"\n      ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"Title"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n        "+e._s(t.row.title)+"\n      ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"Author",width:"110",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",[e._v(e._s(t.row.author))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"Readings",width:"115",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n        "+e._s(t.row.pageviews)+"\n      ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"Date",width:"220"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("i",{staticClass:"el-icon-time"}),e._v(" "),a("span",[e._v(e._s(t.row.timestamp))])]}}])})],1),e._v(" "),a("el-pagination",{staticStyle:{"text-align":"center","margin-top":"20px"},attrs:{layout:"total, prev, pager, next",background:"","page-size":10,total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)},staticRenderFns:[]};var d=a("/Xao")(r,s,!1,function(e){a("cLdg")},null,null);t.default=d.exports}});