Files
jandl-taskmanager-app/app/dist/js/5282.59912085.js
T

2 lines
2.8 KiB
JavaScript

"use strict";(self["webpackChunkjandl"]=self["webpackChunkjandl"]||[]).push([[5282],{55282:function(r,e,o){o.r(e),o.d(e,{default:function(){return _}});var t=o(56768),s=o(24232),a=o(42807),l=o(15728);const n={class:"border-bottom py-5 px-5"},i={class:"py-5 px-5 border-bottom"},d={class:"py-5 px-5"};function u(r,e,o,u,m,c){return(0,t.uX)(),(0,t.CE)(t.FK,null,[(0,t.Lk)("div",n,[e[5]||(e[5]=(0,t.Lk)("h1",null,"Všeobecné informácie",-1)),(0,t.bF)(l.Wx,{modelValue:r.user.name,"onUpdate:modelValue":e[0]||(e[0]=e=>r.user.name=e),class:"w-75",variant:"solo",label:"Meno",disabled:!0},null,8,["modelValue"]),(0,t.bF)(l.Wx,{modelValue:r.user.surname,"onUpdate:modelValue":e[1]||(e[1]=e=>r.user.surname=e),class:"w-75",variant:"solo",label:"Priezvisko",disabled:!0},null,8,["modelValue"])]),(0,t.Lk)("div",i,[e[6]||(e[6]=(0,t.Lk)("h1",null,"Pracovná doba",-1)),(0,t.bF)(l.Wx,{modelValue:m.form.work_start,"onUpdate:modelValue":e[2]||(e[2]=r=>m.form.work_start=r),class:(0,s.C4)(["w-75",{error:m.v$.form.work_start.$errors.length}]),variant:"solo",label:"Začiatok","append-inner-icon":"mdi-clock-outline",type:"time",hint:m.v$.form.work_start.$errors?m.errorUtils.parseErrors(m.v$.form.work_start.$errors):null},null,8,["modelValue","class","hint"]),(0,t.bF)(l.Wx,{modelValue:m.form.work_end,"onUpdate:modelValue":e[3]||(e[3]=r=>m.form.work_end=r),class:(0,s.C4)(["w-75",{error:m.v$.form.work_end.$errors.length}]),variant:"solo",label:"Koniec","append-inner-icon":"mdi-clock-outline",type:"time",hint:m.v$.form.work_end.$errors?m.errorUtils.parseErrors(m.v$.form.work_end.$errors):null},null,8,["modelValue","class","hint"])]),(0,t.Lk)("div",d,[(0,t.bF)(a.D,{class:"button primary",onClick:e[4]||(e[4]=r=>c.updateUserInfo())},{default:(0,t.k6)(()=>[...e[7]||(e[7]=[(0,t.eW)("ULOŽIŤ ZMENY",-1)])]),_:1})])],64)}var m=o(63883),c=o(77175),p=o(8782),k=o(60782),h={data(){return{errorUtils:p.A,v$:(0,m.Ay)(),form:{}}},computed:{...(0,k.L8)("auth",["user"])},validations(){return{form:{work_start:{required:c.mw},work_end:{required:c.mw}}}},watch:{user(){this._setDates()}},mounted(){this._setDates()},methods:{async updateUserInfo(){if(!await this.v$.$validate())return;const[r,e]=this.form.work_start.split(":"),[o,t]=this.form.work_end.split(":"),s={id:this.user.id,work_start:parseFloat(r)+parseFloat(e)/60,work_end:parseFloat(o)+parseFloat(t)/60};try{await this.$store.dispatch("auth/updateUserInfo",s),this.$toast.success("Profil bol úspešne zmenený")}catch(a){this.$toast.error(this.$parseError(a))}},_setDates(){this.form={work_start:this.decimalHoursToTime(this.user.work_start),work_end:this.decimalHoursToTime(this.user.work_end)}},decimalHoursToTime(r){let e=Math.floor(r),o=Math.floor(60*r%60);return e=(e<10?"0":"")+e,o=(o<10?"0":"")+o,e+":"+o}}},w=o(71241);const f=(0,w.A)(h,[["render",u],["__scopeId","data-v-d7b570e6"]]);var _=f}}]);
//# sourceMappingURL=5282.59912085.js.map