"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[9118],{239:function(t,e,n){n.r(e),n.d(e,{default:function(){return d}});var a=function(){var t=this,e=t._self._c;return t.dateStartEnd?e(t.navActive.component,{tag:"component",attrs:{nav:t.nav,period:t.dateStartEnd,view:t.view},on:{update:function(e){return t.updatePeriod(e)},active:function(e){return t.setNavActive(e)}}}):t._e()},i=[],s={name:"Scheduler",props:{view:Object},metaInfo(){return{htmlAttrs:{lang:this.$t("app.lang")}}},async mounted(){this.dateStartEnd=await this.getDateStartEnd(new Date,this.timelineShowDaysDefault)},components:{SchedulerRC:()=>Promise.all([n.e(9896),n.e(6812),n.e(851)]).then(n.bind(n,4108)),SchedulerResources:()=>Promise.all([n.e(9896),n.e(2121)]).then(n.bind(n,8158))},data(){return{nav:[{id:1,component:"SchedulerRC",icon:"/img/icons/icon__machine.svg",active:!0,title:"График производства по рабочим центрам"},{id:2,component:"SchedulerResources",icon:"/img/icons/icon__fiels_user.svg",active:!1,title:"График производства по ресурсам"}],dateStartEnd:null}},computed:{navActive(){return this.nav.find((t=>t.active))}},methods:{updatePeriod(t){console.log("period",t),this.dateStartEnd=t},getDateStartEnd(t="",e=7){const n=[],a=this.$moment(t).set({hour:8,minute:0,second:0}).format("DD.MM.YYYY HH:mm:ss"),i=this.$moment(t).add(e,"days").set({hour:23,minute:59,second:59}).format("DD.MM.YYYY HH:mm:ss");return n.push(a),n.push(i),n},setNavActive(t){if(console.log("setNavActive",t),this.navActive&&this.navActive.id!==t){this.nav.forEach((t=>{t.active=!1}));const e=this.nav.findIndex((e=>e.id===t));console.log("activeNav Index",e),this.nav[e].active=!0}}}},o=s,c=n(1656),r=(0,c.A)(o,a,i,!1,null,null,null),d=r.exports}}]);
//# sourceMappingURL=Scheduler.4c125e81.js.map