(window.webpackJsonp=window.webpackJsonp||[]).push([[365],{843:function(e,t,r){"use strict";r.r(t);r(11),r(10),r(5),r(12),r(8),r(13);var o=r(1),n=(r(860),r(4),r(861),r(862),r(863),r(864),r(865),r(866),r(867),r(868),r(869),r(870),r(871),r(872),r(873),r(874),r(875),r(876),r(877),r(878),r(879),r(880),r(881),r(882),r(883),r(884),r(52),r(57),r(390),r(204),r(74));function l(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var d={props:{relatorios:{type:Array,default:function(){return[]}}},data:function(){return{fields:[{key:"fileName",label:"Nome do Arquivo",sortable:!0,sortKey:"fileName"},{key:"action",label:""}],selectMode:"single",perPage:8,currentPage:1,busy:!1}},computed:c(c({},Object(n.c)({empresa:"empresa/empresaAtual"})),{},{rows:function(){return this.relatorios.length}}),methods:{cancelModalRelatorios:function(){this.$bvModal.hide("modalRelatorio")},downloadRelatorio:function(e){console.log("relatorio=>",e);var t=this.base64ToArrayBuffer(e.fileBytes);this.saveByteArray(e.fileName,t,e.contentType)},base64ToArrayBuffer:function(e){for(var t=window.atob(e),r=t.length,o=new Uint8Array(r),i=0;i<r;i++){var n=t.charCodeAt(i);o[i]=n}return o},saveByteArray:function(e,t,r){var o=new Blob([t],{type:r}),link=document.createElement("a");link.href=window.URL.createObjectURL(o);var n=e;link.download=n,link.click()}}},f=r(37),component=Object(f.a)(d,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("b-modal",{attrs:{id:"modalRelatorio",size:"lg",title:"Donwload de Relatórios",centered:"","hide-header-close":"","hide-footer":"",scrollable:""}},[r("b-row",[r("b-col",{attrs:{md:"12"}},[r("b-table",{attrs:{striped:"",hover:"",fields:e.fields,items:e.relatorios,"busy-empty":!0,"show-empty":"","empty-text":"Não há dados de relatórios.","per-page":e.perPage,"current-page":e.currentPage,busy:e.busy,"select-mode":e.selectMode,selectable:""},scopedSlots:e._u([{key:"table-busy",fn:function(){return[r("div",{staticClass:"text-center text-info my-2"},[r("b-spinner",{staticClass:"align-middle"}),e._v(" "),r("strong",[e._v("Carregando...")])],1)]},proxy:!0},{key:"cell(action)",fn:function(t){return[r("b-button",{staticClass:"btn-table",attrs:{variant:"outline-primary",title:"Download do relatório"},on:{click:function(r){return e.downloadRelatorio(t.item)}}},[r("fa-icon",{attrs:{icon:"fa-download"}})],1)]}}])}),e._v(" "),e.relatorios.length>0?r("b-row",[r("b-col",{attrs:{"align-self":"end"}},[r("div",{staticClass:"text-right"},[r("b",[e._v("Itens:")]),e._v(" "+e._s(e.relatorios.length))])])],1):e._e(),e._v(" "),e.relatorios.length>=10?r("b-pagination",{attrs:{"total-rows":e.rows,"per-page":e.perPage,align:"center"},model:{value:e.currentPage,callback:function(t){e.currentPage=t},expression:"currentPage"}}):e._e()],1)],1),e._v(" "),r("b-row",[r("b-col",{staticClass:"pl-2",attrs:{md:"8"}},[r("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"outline-secondary"},on:{click:function(t){return e.cancelModalRelatorios()}}},[r("fa-icon",{attrs:{icon:"rotate-left"}}),e._v(" "),r("span",{staticClass:"ml-1"},[e._v("Voltar")])],1)],1)],1)],1)}),[],!1,null,null,null);t.default=component.exports}}]);
//# sourceMappingURL=5fd6d29-1.2.10.js.map