(window.webpackJsonp=window.webpackJsonp||[]).push([[210],{922:function(t,e,o){"use strict";o.r(e);o(5),o(7),o(4),o(12),o(8),o(13);var n=o(2),r=(o(6),o(78));function l(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(object);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,o)}return e}function c(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(e){Object(n.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var m={name:"ModalAnexo",props:{saveImage:{type:Function,default:function(){return{}}},busyAnexo:{type:Boolean,default:function(){return!1}}},data:function(){return{anexo:{},validations:[]}},computed:c(c({},Object(r.c)({empresa:"empresa/empresaAtual"})),{},{busy:{get:function(){return this.busyAnexo},set:function(t){this.$emit("update:busyAnexo",t)}}}),mounted:function(){var t=this;this.$root.$on("bv::modal::show",(function(e,o){"modalAnexo"===o&&(t.anexo={})}))},methods:{cancelModalAnexo:function(){this.anexo={},this.$bvModal.hide("modalAnexo")},saveAnexo:function(){var t=this,e={};void 0===this.anexo.arquivos&&this.$notify({title:"Erro",text:'Preencha o campo "Anexo"',type:"error"}),null!=this.anexo.arquivos&&void 0!==this.anexo.arquivos&&""!==this.anexo.arquivos||(e.arquivos="dirty");var o=Object.keys(e);console.log("validations==>",o),o.length>0||(this.busy=!0,console.log(this.anexo),this.saveImage(this.anexo).then((function(){t.$bvModal.hide("modalAnexo"),t.busy=!1})).catch((function(e){t.busy=!1,t.$notifyApiError(e,"Erro ao salvar anexo")})))},getValidationState:function(t){return null!==this.anexo[t]&&void 0!==this.anexo[t]&&""!==this.anexo[t]&&null}}},d=o(42),component=Object(d.a)(m,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("b-modal",{attrs:{id:"modalAnexo",centered:"","hide-header-close":"","hide-footer":""},scopedSlots:t._u([{key:"modal-title",fn:function(){return[o("div",{staticClass:"d-flex"},[o("fa-icon",{staticStyle:{"font-size":"1.5rem","margin-top":"15px"},attrs:{icon:"image"}}),t._v(" "),o("h4",{staticClass:"ml-3 mt-3"},[t._v("Adicionar imagem")])],1)]},proxy:!0}])},[t._v(" "),o("b-form",{on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.saveAnexo.apply(null,arguments)}}},[o("b-row",[o("b-col",{attrs:{md:"12",xl:"12"}},[o("b-form-group",{attrs:{label:"Anexo"}},[o("b-form-file",{attrs:{name:"anexo",placeholder:"Escolha um arquivo ou solte-o aqui...","drop-placeholder":"Solte o arquivo aqui...","browse-text":"Escolher",multiple:!0,accept:"image/png, image/jpg, image/jpeg",state:t.getValidationState("anexo")},model:{value:t.anexo.arquivos,callback:function(e){t.$set(t.anexo,"arquivos",e)},expression:"anexo.arquivos"}})],1)],1),t._v(" "),o("b-col",{attrs:{md:"12",xl:"12"}},[o("b-form-group",{attrs:{label:"Comentário"}},[o("b-form-textarea",{staticClass:"my-2",attrs:{name:"comentario",placeholder:"Comentário",rows:"3","max-rows":"6"},model:{value:t.anexo.comentario,callback:function(e){t.$set(t.anexo,"comentario",e)},expression:"anexo.comentario"}})],1)],1),t._v(" "),o("b-col",{staticClass:"pl-2",attrs:{md:"12"}},[o("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"success",type:"submit"}},[o("fa-icon",{attrs:{icon:"save"}}),t._v(" "),o("span",{staticClass:"ml-1"},[t._v("Salvar")])],1),t._v(" "),o("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"outline-secondary"},on:{click:function(e){return t.cancelModalAnexo()}}},[o("fa-icon",{attrs:{icon:"times"}}),t._v(" "),o("span",{staticClass:"ml-1"},[t._v("Cancelar")])],1)],1)],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports}}]);
//# sourceMappingURL=cdf7288-1.2.11.js.map