(window.webpackJsonp=window.webpackJsonp||[]).push([[1305],{2712:function(t,e,r){"use strict";r.r(e);r(6),r(5),r(7),r(4),r(12),r(8),r(13);var o=r(2),n=(r(17),r(182),r(78));function c(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}return e}function l(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var d={name:"Grupos",data:function(){return{search:void 0,hover:!0,headVariant:"light",currentPage:1,perPage:5,selectMode:"single",busy:!1,sortDesc:!1,grupos:[],fields:[{key:"descricao",label:"Descrição",sortable:!0}],pageOptions:[5,10,15,20],grupo:{}}},computed:l(l({},Object(n.c)({empresa:"empresa/empresaAtual"})),{},{rows:function(){return this.grupos.length}}),mounted:function(){this.findGrupos()},methods:{findGrupos:function(){var t=this;this.busy=!0,this.$segurancaService.findGruposAcesso(this.search).then((function(e){t.grupos=e.data,t.busy=!1})).catch((function(e){t.$notify({title:"Erro",text:e.response?e.response.data.message:e,type:"error"})}))},addGrupo:function(){this.$nuxt.$options.router.push({path:"/seguranca/gruposAcesso/_grupoAcesso"})},editGrupo:function(t){this.$nuxt.$options.router.push({path:"/seguranca/gruposAcesso/".concat(t.id)})}}},f=r(42),component=Object(f.a)(d,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("b-row",[r("b-col",{attrs:{cols:"12"}},[r("b-card",[r("div",{staticClass:"mt-4 mx-2",attrs:{slot:"header"},slot:"header"},[r("b-row",[r("b-col",{attrs:{cols:"10"}},[r("h2",{staticClass:"primary"},[t._v("Grupos de Usuários")])]),t._v(" "),r("b-col",{attrs:{cols:"2"}},[r("div",{staticClass:"d-flex justify-content-end"},[r("b-button",{staticClass:"rounded",attrs:{id:"btnAdcionar",size:"sm",variant:"primary"},on:{click:t.addGrupo}},[r("FaIcon",{staticClass:"mr-1",attrs:{icon:"plus"}}),t._v(" "),r("span",[t._v("Adicionar")])],1)],1)])],1)],1),t._v(" "),r("b-row",[r("b-col",{attrs:{cols:"6",sm:"6",md:"6",lg:"6"}},[r("b-form-group",{attrs:{label:"Localizar:"}},[r("b-form-input",{attrs:{id:"pesquisa",autofocus:""},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})],1)],1),t._v(" "),r("b-col",{attrs:{cols:"3",sm:"3",md:"3",lg:"3"}},[r("b-button",{staticClass:"mt-4",attrs:{id:"btnPesquisar",variant:"outline-primary",size:"sm"},on:{click:function(e){return t.findGrupos()}}},[r("FaIcon",{staticClass:"mr-1",attrs:{icon:"search"}}),t._v(" "),r("span",[t._v("Pesquisar")])],1)],1)],1)],1)],1)],1),t._v(" "),r("b-row",[r("b-col",{attrs:{cols:"12"}},[r("b-card",{staticClass:"mt-3"},[r("b-table",{staticClass:"mt-3",staticStyle:{"overflow-x":"scroll"},attrs:{hover:t.hover,items:t.grupos,fields:t.fields,"head-variant":t.headVariant,responsive:"sm",selectable:"","empty-text":"Não há grupos disponíveis","show-empty":"","current-page":t.currentPage,"per-page":t.perPage,"busy-empty":!0,busy:t.busy},on:{"row-clicked":t.editGrupo},scopedSlots:t._u([{key:"table-busy",fn:function(){return[r("div",{staticClass:"text-center text-primary my-2"},[r("b-spinner",{staticClass:"align-middle"}),t._v(" "),r("strong",[t._v("Carregando...")])],1)]},proxy:!0}])}),t._v(" "),t.grupos.length>0?r("b-row",[r("b-col",{attrs:{md:"2","align-self":"start"}},[r("b-form-group",{staticClass:"mb-0",attrs:{horizontal:"",label:"Itens por página:"}},[r("b-form-select",{attrs:{options:t.pageOptions},model:{value:t.perPage,callback:function(e){t.perPage=e},expression:"perPage"}})],1)],1),t._v(" "),r("b-col",{attrs:{md:"10","align-self":"end"}},[r("div",{staticClass:"text-right"},[r("b",[t._v("Itens:")]),t._v(" "+t._s(t.grupos.length))])])],1):t._e(),t._v(" "),t.grupos.length>5?r("b-pagination",{attrs:{"total-rows":t.rows,"per-page":t.perPage,align:"center",pills:""},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}}):t._e()],1)],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports}}]);
//# sourceMappingURL=2f9f5ed-1.2.11.js.map