mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
"use strict";(self["webpackChunkjandl"]=self["webpackChunkjandl"]||[]).push([[8081],{56747:function(e,t){t.A={data(){return{header:{initialized:!1,marginTop:0,calendar_previousScrollPosition:0,isVisible:!0}}},unmounted(){this.$refs.page?.querySelector(".vuecal__bg")?.removeEventListener("scroll",this.handleScroll)},methods:{_initScrollListener(e=0){if(this.initialized&&e>0)return;const t=this.$refs.page?.querySelector(".vuecal__bg");if(!t)return setTimeout(()=>{e<20&&this._initScrollListener(e+1)},200);t.addEventListener("scroll",this._handleScroll),this.initialized=!0,this.header.calendar_previousScrollPosition=t.scrollTop},_handleScroll(e){const t=document.querySelector("div.subheader");this.initialized?(this.header.calendar_previousScrollPosition>e.target.scrollTop?this.header.isVisible||this.showHeader():(t.offsetHeight,Math.abs(e.target.scrollTop),this.header.isVisible&&this.hideHeader()),this.header.calendar_previousScrollPosition=e.target.scrollTop):this.header.calendar_previousScrollPosition=e.target.scrollTop},hideHeader(){const e=document.querySelector("div.subheader");e.style.transition="margin-top 0.5s",e.style.marginTop=`-${e.offsetHeight}px`,this.header.isVisible=!1,setTimeout(()=>{e.style.transition=""},500)},showHeader(){const e=document.querySelector("div.subheader");e.style.transition="margin-top 0.5s",e.style.marginTop="0",this.header.isVisible=!0,setTimeout(()=>{e.style.transition=""},500)}}}},66751:function(e,t,s){s.d(t,{A:function(){return ce}});var l=s(56768),i=s(24232);const a={class:"calendar-wrapper"},n={class:"h-100 d-flex flex-column",style:{width:"100%","margin-right":"10px","margin-left":"10px"}},o={key:0,class:"d-flex align-center"},c=["src"],r={class:"weekday-label"},d={key:1,class:"d-flex align-center"},u=["src"],k={class:"weekday-label"},m={key:2},v={class:"day-name"},h={class:"unscheduled-time-initials"},b={class:"text-wrap me-4"},p={class:"mb-0 mt-0 unscheduled-time-name"},_={class:"mb-0 mt-0 unscheduled-time-name"},f={class:"mb-0 mt-0"},g={class:"mb-0 mt-0",style:{"font-weight":"400"}},y={class:"d-flex justify-center"},C={class:"d-flex justify-center"},T={style:{"margin-top":"-9px"}};function D(e,t,D,L,w,E){const $=(0,l.g2)("A-timeline-event"),x=(0,l.g2)("Vue-cal");return(0,l.uX)(),(0,l.CE)("div",a,[(0,l.bF)(x,{"hide-view-selector":!0,"hide-title-bar":!0,"disable-views":["years","year","month","week"],"active-view":"day","selected-date":D.calConfig.date,"on-event-click":E.taskClicked,"editable-events":w.vueCalConfig.editing,events:D.calData.tasks,"unscheduled-time":D.calData.unscheduled_times,"overlaps-per-time-step":!1,"show-time-in-cells":!1,"time-cell-height":w.timeCellHeight,"snap-to-time":15,"scroll-to-hour":D.calConfig.scrollHour,"split-days":D.splits,"sticky-split-labels":!0,"min-split-width":140,onReady:t[0]||(t[0]=e=>E.onReady()),onViewChange:E.weekChanged,onEventDrop:E.eventMoved,onEventFocus:E.eventFocused},{"split-label":(0,l.k6)(({split:e})=>[(0,l.Lk)("div",n,[e.date?((0,l.uX)(),(0,l.CE)("span",o,[e.isHomeoffice?((0,l.uX)(),(0,l.CE)("img",{key:0,src:s(1030),class:"mr-2"},null,8,c)):(0,l.Q3)("",!0),(0,l.Lk)("p",r,(0,i.v_)(E.getHeadingDate(e.date)),1)])):((0,l.uX)(),(0,l.CE)("span",d,[e.isHomeoffice?((0,l.uX)(),(0,l.CE)("img",{key:0,src:s(1030),class:"mr-2"},null,8,u)):(0,l.Q3)("",!0),(0,l.Lk)("p",k,(0,i.v_)(e.name),1)])),e.date?((0,l.uX)(),(0,l.CE)("span",m,[(0,l.Lk)("p",v,(0,i.v_)(e.date.toLocaleDateString("en-EN",{weekday:"long"})),1)])):(0,l.Q3)("",!0),(0,l.Lk)("div",{class:(0,i.C4)(["unscheduled-time d-flex align-center text-left",{"vuecal__cell-split--weekend":e.isWeekend}])},[(0,l.Lk)("div",h,[(0,l.Lk)("p",null,(0,i.v_)(e.initials),1)]),(0,l.Lk)("div",b,[(0,l.Lk)("p",p,(0,i.v_)(e.name),1),(0,l.Lk)("p",_,(0,i.v_)(e.surname),1),(0,l.Lk)("h1",f,(0,i.v_)(e.unscheduledTime)+" h",1),(0,l.Lk)("h1",g,(0,i.v_)(e.scheduledTime)+" h ",1)])],2)])]),"time-cell":(0,l.k6)(({hours:e,minutes:s})=>[(0,l.Lk)("span",y,[(0,l.Lk)("span",C,[(0,l.Lk)("p",T,(0,i.v_)(e)+":"+(0,i.v_)(String(s).padStart(2,"0")),1),t[1]||(t[1]=(0,l.Lk)("div",{class:"time-column-line"},null,-1)),t[2]||(t[2]=(0,l.Lk)("span",{class:"vuecal__time-cell-line hour"},null,-1))]),t[3]||(t[3]=(0,l.Lk)("span",{class:"vuecal__time-cell-line",style:{"margin-top":"25px"}},null,-1)),t[4]||(t[4]=(0,l.Lk)("span",{class:"vuecal__time-cell-line",style:{"margin-top":"50px"}},null,-1)),t[5]||(t[5]=(0,l.Lk)("span",{class:"vuecal__time-cell-line",style:{"margin-top":"75px"}},null,-1))])]),event:(0,l.k6)(({event:e})=>[(0,l.bF)($,{event:e,onEditBlocker:E.editBlocker,onDeleteBlocker:E.deleteBlocker,onCompleteTask:E.completeTask,onToggleTimeblockIsFinished:E.toggleTimeblockIsFinished,onEditTask:E.editTask,onDeleteTimeblockInTask:E.deleteTimeBlockInTask},null,8,["event","onEditBlocker","onDeleteBlocker","onCompleteTask","onToggleTimeblockIsFinished","onEditTask","onDeleteTimeblockInTask"])]),_:1},8,["selected-date","on-event-click","editable-events","events","unscheduled-time","time-cell-height","scroll-to-hour","split-days","onViewChange","onEventDrop","onEventFocus"])])}s(83725),s(52598),s(51339);var L=s(17533),w=s(55884),E=s(60782),$=s(49148),x=s.n($),S=(s(28743),s(90144)),F=s(45130),B=s(95022),X=s(42807),H=s(79669),A=s(51161);const j={key:0,class:"custom-event-body non-working-event colWidth h-100 d-flex flex-column justify-center"},M={class:"d-flex justify-center align-center"},I={class:"mb-0 ms-2"},K={class:"text-inherit"},Q={class:"text-inherit"},R={class:"d-flex align-center event-details event-initials-wrapper"},W={class:"text-inherit"},z={class:"event-initials-date text-inherit"},V={key:0,class:"d-flex align-center"},q={key:0,class:"ml-1"},N={key:1,class:"d-flex align-center mt-1"},P=["src"],O=["src"],U=["src"],Z=["src"],G=["src"],J=["src"],Y=["src"],ee=["src"];var te=(0,l.pM)({__name:"a-timeline-event",props:{event:{}},emits:["edit-blocker","delete-blocker","complete-task","toggle-timeblock-is-finished","edit-task","delete-timeblock-in-task"],setup(e,{emit:t}){const s=e,a=t,n=(0,l.EW)(()=>{if(s.event.subtask)return s.event.subtask.deadline?s.event.subtask.deadline:s.event.subtask.master_task_deadline}),o=(0,l.EW)(()=>s.event.end.getTime()-s.event.start.getTime()),c=(0,l.EW)(()=>"office365_blocker"===s.event.type||"office365"===s.event.type?{color:"#ffffff",backgroundColor:"#326cb8"}:s.event._timeblock_is_finished||s.event.subtask?.is_finished?{color:"#000000",backgroundColor:"#dedfe0"}:{color:"#000000",backgroundColor:s.event.color||s.event.subtask?.color}),r=(0,l.EW)(()=>{const e=[];return o.value<=9e6&&e.push("short-event"),o.value<=54e5&&e.push("mini-event"),o.value<=36e5&&e.push("micro-event"),!s.event?.blocker?.approved&&s.event?.isBlocker&&e.push("not-approved"),e.join(" ")}),d=(0,l.EW)(()=>"office365"===s.event.type);return(t,o)=>((0,l.uX)(),(0,l.CE)("div",{class:(0,i.C4)(["event",{"event--office":d.value}])},["non-working-hours"==s.event.type?((0,l.uX)(),(0,l.CE)("div",j,[(0,l.Lk)("div",M,[(0,l.bF)(H.w,{icon:"mdi-cancel",color:"black"}),(0,l.Lk)("h3",I,(0,i.v_)(s.event.title),1)])])):["subtask","blocker","adhoc","vacation","free_day","office365","office365_blocker"].includes(e.event.type)?((0,l.uX)(),(0,l.CE)("div",{key:1,class:(0,i.C4)(["custom-event-body colWidth h-100 d-flex flex-column justify-space-between",r.value]),style:(0,i.Tr)({backgroundColor:c.value.backgroundColor,color:c.value.color})},[(0,l.Lk)("div",{class:(0,i.C4)(["event-content",{"is-blocker":s.event.isBlocker}])},[["subtask","office365"].includes(e.event.type)?((0,l.uX)(),(0,l.CE)(l.FK,{key:0},[s.event.subtask.project_code?((0,l.uX)(),(0,l.CE)("small",{key:0,class:"project-code",style:(0,i.Tr)({color:c.value.color})},(0,i.v_)(s.event.subtask.project_code),5)):(0,l.Q3)("",!0),(0,l.Lk)("h3",K,(0,i.v_)(s.event.subtask.title??s.event.subtask.master_task?.name??s.event.subtask.master_task),1)],64)):((0,l.uX)(),(0,l.Wv)(A.y,{key:1,text:e.event.blocker?.approved?"Schválený":"Neschválený",location:"bottom"},{activator:(0,l.k6)(({props:e})=>[(0,l.Lk)("div",(0,i._B)((0,l.Ng)(e)),[(0,l.Lk)("h3",Q,(0,i.v_)(s.event?.blocker?.approved?s.event?.blocker?.name:s.event?.blocker?.name+"*"),1)],16)]),_:1},8,["text"]))],2),(0,l.Lk)("div",R,[(0,l.Lk)("div",{class:"event-initials d-flex justify-center align-center",style:(0,i.Tr)({borderColor:c.value.color})},[(0,l.Lk)("small",W,(0,i.v_)(s.event.initials),1)],4),(0,l.Lk)("small",z,(0,i.v_)(s.event.date?.toLocaleDateString("sk-SK")),1)]),["subtask"].includes(e.event.type)?((0,l.uX)(),(0,l.CE)("div",V,[(0,l.bF)(H.w,{icon:"mdi-skull-outline",size:"small"}),s.event?.subtask.deadline?((0,l.uX)(),(0,l.CE)("small",q,(0,i.v_)(n.value),1)):((0,l.uX)(),(0,l.Wv)(A.y,{key:1,text:"Deadline z Mastertasku",location:"bottom"},{activator:(0,l.k6)(({props:e})=>[s.event?.subtask?.deadline?(0,l.Q3)("",!0):((0,l.uX)(),(0,l.CE)("small",(0,l.v6)({key:0,class:"cursor-pointer ml-1"},e),(0,i.v_)(n.value)+"*",17))]),_:1}))])):(0,l.Q3)("",!0),["office365"].includes(e.event.type)?((0,l.uX)(),(0,l.CE)("div",N,[(0,l.bF)(H.w,{icon:"mdi-pin-outline",size:"small"}),s.event?.subtask.office365_location?((0,l.uX)(),(0,l.CE)("small",{key:0,style:(0,i.Tr)({color:c.value.color}),class:"ml-1"},(0,i.v_)(s.event?.subtask.office365_location),5)):(0,l.Q3)("",!0)])):(0,l.Q3)("",!0)],6)):(0,l.Q3)("",!0),d.value?((0,l.uX)(),(0,l.CE)("div",{key:2,class:"event__office-footer",style:(0,i.Tr)({backgroundColor:c.value.backgroundColor})},[(0,l.Lk)("img",{src:(0,S.R1)(B.ni),alt:""},null,8,P)],4)):(0,l.Q3)("",!0),(0,l.Lk)("div",{class:"event__footer d-flex",style:(0,i.Tr)({backgroundColor:c.value.backgroundColor})},[d.value?((0,l.uX)(),(0,l.Wv)(X.D,{key:0,rounded:"",class:"event__footer__button me-2",onClick:o[0]||(o[0]=(0,F.D$)(e=>a("edit-task",s.event),["stop"]))},{default:(0,l.k6)(()=>[(0,l.Lk)("img",{src:(0,S.R1)(B.y5),alt:""},null,8,O)]),_:1})):"adhoc"==e.event.type?((0,l.uX)(),(0,l.CE)(l.FK,{key:1},[(0,l.bF)(X.D,{rounded:"",class:"event__footer__button me-2",onClick:o[1]||(o[1]=(0,F.D$)(e=>a("edit-blocker",s.event),["stop","prevent"]))},{default:(0,l.k6)(()=>[(0,l.Lk)("img",{src:(0,S.R1)(B.wz),alt:""},null,8,U)]),_:1}),(0,l.bF)(X.D,{rounded:"",class:"event__footer__button me-2",onClick:o[2]||(o[2]=(0,F.D$)(e=>a("delete-blocker",s.event),["stop","prevent"]))},{default:(0,l.k6)(()=>[(0,l.Lk)("img",{src:(0,S.R1)(B.e5),alt:""},null,8,Z)]),_:1})],64)):"subtask"==s.event.type?((0,l.uX)(),(0,l.CE)(l.FK,{key:2},[(0,l.bF)(X.D,{rounded:"",class:(0,i.C4)(["event__footer__button me-2",{completed:s.event.subtask?.is_finished}]),onClick:o[3]||(o[3]=(0,F.D$)(e=>a("complete-task",s.event),["stop"]))},{default:(0,l.k6)(()=>[(0,l.Lk)("img",{src:(0,S.R1)(B.Ty),alt:""},null,8,G)]),_:1},8,["class"]),(0,l.bF)(X.D,{rounded:"",class:(0,i.C4)(["event__footer__button me-2",{completed:s.event._timeblock_is_finished}]),onClick:o[4]||(o[4]=(0,F.D$)(e=>a("toggle-timeblock-is-finished",s.event),["stop"]))},{default:(0,l.k6)(()=>[(0,l.Lk)("img",{src:(0,S.R1)(B.AI),alt:""},null,8,J)]),_:1},8,["class"]),(0,l.bF)(X.D,{rounded:"",class:"event__footer__button me-2",onClick:o[5]||(o[5]=(0,F.D$)(e=>a("edit-task",s.event),["stop","prevent"]))},{default:(0,l.k6)(()=>[(0,l.Lk)("img",{src:(0,S.R1)(B.y5),alt:""},null,8,Y)]),_:1}),(0,l.bF)(X.D,{rounded:"",class:"event__footer__button me-2",onClick:o[6]||(o[6]=(0,F.D$)(e=>a("delete-timeblock-in-task",s.event),["stop","prevent"]))},{default:(0,l.k6)(()=>[(0,l.Lk)("img",{src:(0,S.R1)(B.e5),alt:""},null,8,ee)]),_:1})],64)):(0,l.Q3)("",!0)],4)],2))}}),se=s(71241);const le=(0,se.A)(te,[["__scopeId","data-v-dd62368e"]]);var ie=le,ae=s(94348),ne={components:{ATimelineEvent:ie},props:{calData:{type:Object,required:!0,default(){return{}}},calConfig:{type:Object,required:!0,default(){return{date:new Date,scrollHour:7}}},splits:{type:Array,required:!1,default(){return[]}}},data(){return{vueCalConfig:{editing:{title:!1,drag:!0,resize:!1,delete:!1,create:!1}},focusedEventId:null,timeCellHeight:100,tmUtils:w.A,visible:!1}},computed:{...(0,E.L8)("tm",["mastertasks"])},methods:{isAfterDeadline(e){const t=this.getDeadline(e.subtask);if(!t)return;const s=x()(e.date),l=x()(t),i=e.end.getHours(),a=e.end.getMinutes();return s.hours(i),s.minutes(a),s.isAfter(l)},getDeadline(e){return e?.deadline?e.deadline:e.master_task_deadline},weekChanged(){const e=this.$el.getElementsByClassName("vuecal__scrollable-body")[0];e.scrollLeft=0},async eventMoved({event:e,newSplit:t}){const s=(0,L.A)(this.calConfig.date,t-1),l=s.setHours(Math.floor(e.startTimeMinutes/60),Math.round(e.startTimeMinutes%60),0),i=s.setHours(Math.floor(e.endTimeMinutes/60),Math.round(e.endTimeMinutes%60),0),a=this.splits.find(e=>e.id==t);if("Dashboard - Tasks"==this.$route.name){const t={...e.subtask,timeblocks:e.subtask.timeblocks.map(t=>t.id===e._timeblock_id?{id:e._timeblock_id,is_finished:t.is_finished||0,start:w.A.formatDateTimeForBackend(l),end:w.A.formatDateTimeForBackend(i)}:t),timesheets:e.subtask.timesheets.map(e=>(delete e.employee_name,e))};try{const{subtask:e}=await this.$axios.put_auth(`v1/subtasks/${t.id}`,t);this.$events.emit("on-subtask-edited",e),e.employee_id==this.$store.getters["auth/user"].id&&this.$events.emit("show-task-add-time-modal",{subtask:e})}catch(n){this.$toast.error(n.message||n)}const s=this.isAfterDeadline(e);s&&this.$toast.error("Timeblock, ktorý ste presunuli je po deadline !")}else if("Dashboard - Teams"==this.$route.name){const t={...e.subtask,employee_id:a.employee_id,timeblocks:e.subtask.timeblocks.map(t=>t.id===e._timeblock_id?{id:e._timeblock_id,is_finished:t.is_finished||0,start:w.A.formatDateTimeForBackend(e.start),end:w.A.formatDateTimeForBackend(e.end)}:t),timesheets:e.subtask.timesheets.map(e=>(delete e.employee_name,e))};try{const{subtask:e}=await this.$axios.put_auth(`v1/subtasks/${t.id}`,t);this.$events.emit("on-subtask-edited",e)}catch(n){this.$toast.error(n.message||n)}}},onReady(){this.correctMargins()},correctMargins(){if(!this.$el.getElementsByClassName("vuecal__split-days-headers").length)return;const e=this.$el.getElementsByClassName("vuecal__split-days-headers")[0].clientHeight;this.$el.getElementsByClassName("vuecal__time-column")[0].style.marginTop=`${e}px`,this.$el.getElementsByClassName("vuecal__cells-body")[0].style.marginTop=`${e}px`},getHeadingDate(e){const t=new Date(e),s=new Date,l=new Date((new Date).setDate(s.getDate()-1)),i=new Date((new Date).setDate(s.getDate()+1));return s.toLocaleDateString("sk-SK")===t.toLocaleDateString("sk-SK")?"Dnes":l.toLocaleDateString("sk-SK")===t.toLocaleDateString("sk-SK")?"Včera":i.toLocaleDateString("sk-SK")===t.toLocaleDateString("sk-SK")?"Zajtra":t.toLocaleDateString("sk-SK")},taskClicked(e){ae.log("task clicked",e)},eventFocused(e){this.focusedEventId=e.task_id},completeTask({subtask:e}){this.$events.emit("show-complete-task-modal",{subtask:e})},async toggleTimeblockIsFinished(e){const t=e.subtask,s=t.timeblocks.find(t=>t.id==e._timeblock_id);s.is_finished=s?.is_finished?0:1;try{const{data:e}=await this.$axios.put_auth(`v1/timeblocks/${s.id}`,s);t.timeblocks=t.timeblocks.map(t=>t.id==e.id?e:t),this.$events.emit("on-subtask-edited",t),s.is_finished&&this.$events.emit("show-task-add-time-modal",{subtask:t})}catch(l){this.$toast.error(l.message||l)}},editTask({subtask:e}){this.$events.emit("show-subtask-modal",{subtask:e})},deleteTimeBlockInTask({subtask:e}){this.$events.emit("show-delete-timeblock-modal",{subtask:e})},editBlocker({blocker:e}){this.$events.emit("show-blocker-modal",{blocker:e})},deleteBlocker({blocker:e}){this.$events.emit("show-delete-blocker-modal",{blocker:e})}}};const oe=(0,se.A)(ne,[["render",D],["__scopeId","data-v-4e767114"]]);var ce=oe}}]);
|
|
//# sourceMappingURL=8081.47b8b6cb.js.map
|