"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[121],{9306:function(t,s,e){e.r(s),e.d(s,{default:function(){return c}});var a=function(){var t=this,s=t._self._c;return t.loaded?s("ButtonMenu",{staticClass:"uk-margin-small-right",attrs:{title:t.showTitle?"Выгрузки":"",dropdownTitle:"Выберите выгрузку",icon:'<i class="fas fa-table"></i>',showArrow:!0,buttonClasses:t.buttonClasses,showListIcons:!1,items:t.menuItems,disabled:!t.loaded},on:{select:function(s){return t.runExport(s.exp)}}}):t._e()},n=[],o=e(3216),u=e(5512),d={name:"DocumentExports",components:{ButtonMenu:()=>e.e(2466).then(e.bind(e,6433))},props:{docKindName:{type:String},docKindId:{type:Number},successClass:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0}},data(){return{loaded:!1,dataExportsRaw:[]}},computed:{menuItems(){return this.dataExports.map((t=>({id:t.DOCUMENT_ID,title:t.DOC_DESCR,exp:t})))},dataExports(){return[...this.dataExportsRaw,{DOCUMENT_ID:0,DOC_DESCR:"Новая выгрузка"}]},buttonClasses(){let t=["uk-button","uk-button-small"];return this.successClass&&t.push("uk-button-success"),t}},mounted(){this.load()},methods:{async load(){this.loaded=!1,this.dataExportsRaw=await o.vd.select("CRM_GET_KIND_ANALITICS_CS",{DOCKIND_ID:this.docKindId},100),this.loaded=!0},runExport(t){let s=[this.docKindName];t.DOCUMENT_ID&&s.push(t.DOCUMENT_ID),u.A.addView({viewType:"exportData",params:s})}}},l=d,r=e(1656),i=(0,r.A)(l,a,n,!1,null,null,null),c=i.exports}}]);
//# sourceMappingURL=DocumentExports.8a011bb4.js.map