(window.webpackJsonp=window.webpackJsonp||[]).push([[815],{897:function(e,t,r){"use strict";r.r(t);r(6),r(5),r(7),r(12),r(8),r(13);var o=r(2),n=(r(1076),r(4),r(1077),r(1078),r(1079),r(1080),r(1081),r(1082),r(1083),r(1084),r(1085),r(1086),r(1087),r(1088),r(1089),r(1090),r(1091),r(1092),r(1093),r(1094),r(1095),r(1096),r(1097),r(1098),r(1099),r(1100),r(31),r(32),r(398),r(165),r(78));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(42),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=1c9fe25-1.2.11.js.map