"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[9148],{1451:function(t,e,l){l.r(e),l.d(e,{default:function(){return c}});var i=function(){var t=this,e=t._self._c;return e("div",{staticStyle:{display:"flex","flex-direction":"column",flex:"1","min-height":"1px"}},[e("PanelHead",{attrs:{title:"Фильтры"},on:{close:function(e){return t.close()}}}),e("div",{staticStyle:{padding:"5px"}},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.curFilterId,expression:"curFilterId"}],staticClass:"uk-select",on:{change:[function(e){var l=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.curFilterId=e.target.multiple?l:l[0]},t.filterChange]}},[e("option",{attrs:{value:""}},[t._v("Без фильтра")]),t._l(t.filters,(function(l){return e("option",{key:l.DOCUMENT_ID,domProps:{value:l.DOCUMENT_ID}},[t._v(t._s(l.DOC_DESCR))])}))],2)]),e("div",{staticStyle:{padding:"0",flex:"1","min-height":"1px","overflow-y":"auto"}},[e("QueryFilter",{ref:"filter",attrs:{model:t.model}})],1),t.curFilterId?e("div",{staticClass:"uk-text-center",staticStyle:{padding:"8px 5px","border-top":"1px solid rgb(213, 225, 230)"}},[e("button",{staticClass:"uk-button uk-button-primary",attrs:{disabled:!t.canApply},on:{click:t.apply}},[t._v("Применить фильтр")])]):t._e()],1)},r=[],a={name:"SelectDocFilters",components:{PanelHead:()=>l.e(3321).then(l.bind(l,547)),QueryFilter:()=>l.e(9991).then(l.bind(l,5041))},props:{dockindId:Number,startFilterId:Number,filters:Array,model:Object,canApply:{type:Boolean,default:!0}},data(){return{curFilterId:""}},computed:{},watch:{},mounted(){this.curFilterId=this.startFilterId},methods:{async filterChange(){let t=null;this.curFilterId&&(t=this.filters.find((t=>t.DOCUMENT_ID===parseInt(this.curFilterId)))),t?await this.model.loadTemplateXml(t.XMLSERARCH):await this.model.loadEmpty(this.dockindId),this.$emit("changed",{filterId:t?t.DOCUMENT_ID:null})},apply(){this.$refs.filter.save(),this.model.applyVars(),this.$emit("changed",{filterId:parseInt(this.curFilterId)})},async close(){this.apply(),this.$emit("close")}}},n=a,s=l(1656),d=(0,s.A)(n,i,r,!1,null,null,null),c=d.exports}}]);
//# sourceMappingURL=SelectDocFilters.f63fc38a.js.map