"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[9363],{7303:function(t,e,s){s.r(e),s.d(e,{default:function(){return c}});var i=function(){var t=this,e=t._self._c;return e("Modal",{ref:"modal",attrs:{title:"Добавить из меню",autoOpen:!0,fullHeight:!0},on:{closed:function(e){return t.$emit("closed")}}},[e("div",{staticClass:"flex-row flex-grow"},[e("div",{staticStyle:{width:"200px","border-right":"1px solid #d5e1e6",padding:"5px"}},t._l(t.modules,(function(s){return e("div",{key:s.ID,staticStyle:{"font-size":"18px"}},[e("button",{staticClass:"uk-button uk-button-small",class:{"uk-button-primary":t.curModuleId===s.ID},staticStyle:{width:"100%","text-align":"left"},on:{click:function(e){t.curModuleId=s.ID}}},[e("img",{attrs:{src:"/img/sidebar/"+s.SYSTEM_NAME+".svg","uk-svg":"",width:"16",height:"16"}}),t._v(" "+t._s(s.NAME)+" ")])])})),0),e("div",{staticClass:"flex-grow",staticStyle:{padding:"5px",overflow:"auto"}},t._l(t.curGroups,(function(s){return e("div",{key:s.GROUP_ID},[e("h4",{staticStyle:{margin:"0"}},[t._v(t._s(s.NAME))]),t._l(s.items,(function(s){return e("div",{key:s.ID},[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.addItem(s)}}},[e("img",{staticClass:"pos-sidebar-submenu-nav-item--icon",attrs:{src:t.menuIcon(s),width:"14",height:"14","uk-svg":""}}),t._v(" "+t._s(s.TITLE)+" ")])])}))],2)})),0)])])},n=[],u=s(3216),r=(s(3610),s(8466)),a={name:"DashboardAddMenu",components:{Modal:()=>s.e(8362).then(s.bind(s,2215))},props:{},data(){return{curModuleId:null,saving:!1}},computed:{modules(){return r.A.fullMenu},curGroups(){let t=this.modules.find((t=>t.ID===this.curModuleId));return t?t.groups:[]}},async mounted(){this.curModuleId=this.modules[0].ID},methods:{menuIcon(t){return r.A.itemIcon(t)},async addItem(t){if(!this.saving){try{this.saving=!0,await u.vd.query("CLON_TO_DESKTOP_MODULE_2",{MENU_MODULE_ID:t.ID,GROUP_ID:t.GROUP_ID}),this.$emit("changed"),this.$refs.modal.close()}catch(e){throw e}this.saving=!1}}}},l=a,o=s(1656),d=(0,o.A)(l,i,n,!1,null,null,null),c=d.exports}}]);
//# sourceMappingURL=DashboardAddMenu.edd571e9.js.map