Changes for public/js/oscar/dist/PersonSchedule.js: 2 added lines, 0 removed lines.
Original line number
Diff line number
Diff line
(function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define([],t):"object"==typeofexports?exports.PersonSchedule=t():e.PersonSchedule=t()})("undefined"!=typeofself?self:this,function(){returnfunction(e){functiont(s){if(n[s])returnn[s].exports;vara=n[s]={i:s,l:!1,exports:{}};returne[s].call(a.exports,a,a.exports,t),a.l=!0,a.exports}varn={};returnt.m=e,t.c=n,t.d=function(e,n,s){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){varn=e&&e.__esModule?function(){returne.default}:function(){returne};returnt.d(n,"a",n),n},t.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});vars=n(4),a=function(e){returne&&e.__esModule?e:{default:e}}(s);t.default={name:"PersonSchedule",props:{urlapi:{default:""},edit:{default:!1}},data:function(){return{daysLabels:{1:"Lundi",2:"Mardi",3:"Mercredi",4:"Jeudi",5:"Vendredi",6:"Samedi",7:"Dimanche"},loading:null,error:null,dayLength:0,days:{},editDay:null,newValue:0}},computed:{totalWeek:function(){vare=this,t=0;returnObject.keys(this.days).forEach(function(n){t+=parseFloat(e.days[n])}),t}},methods:{day:function(e){returnthis.days.hasOwnProperty(e)?this.days[e]:this.dayLength},handlerEditDays:function(){this.editDay=!0},handlerSaveDays:function(){vare=this;this.loading="Enregistrement des horaires";vart=newFormData;t.append("days",JSON.stringify(this.days)),this.$http.post(this.urlapi,t).then(function(t){e.fetch()},function(t){e.error=a.default.resolve("Impossible de modifier les horaires",t)}).then(function(t){e.loading=!1})},fetch:function(){vare=this;!(arguments.length>0&&void0!==arguments[0])||arguments[0];this.loading="Chargement des données",this.$http.get(this.urlapi).then(function(t){console.log(t.body),e.days=t.body.days,e.dayLength=t.body.dayLength},function(t){e.error=a.default.resolve("Impossible de charger les données",t)}).then(function(t){e.loading=!1,e.editDay=null})}},mounted:function(){this.fetch(!0)}}},function(e,t,n){e.exports=n(2)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});vars=n(0),a=n.n(s);for(variins)"default"!==i&&function(e){n.d(t,e,function(){returns[e]})}(i);varr=n(5),o=n(3),d=o(a.a,r.a,!1,null,null,null);t.default=d.exports},function(e,t){e.exports=function(e,t,n,s,a,i){varr,o=e=e||{},d=typeofe.default;"object"!==d&&"function"!==d||(r=e,o=e.default);varc="function"==typeofo?o.options:o;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),a&&(c._scopeId=a);varl;if(i?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof__VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=l):s&&(l=s),l){varu=c.functional,f=u?c.render:c.beforeCreate;u?(c._injectStyles=l,c.render=function(e,t){returnl.call(t),f(e,t)}):c.beforeCreate=f?[].concat(f,l):[l]}return{esModule:r,exports:o,options:c}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={resolve:function(e,t){varn="Erreur inconnue";returnt&&(n=t.body,403==t.status&&(n="Vous avez été déconnectez de l'application")),e+" (Réponse : "+n+")"}}},function(e,t,n){"use strict";vars=function(){vare=this,t=e.$createElement,n=e._self._c||t;returnn("section",{staticClass:"schedule"},[n("transition",{attrs:{name:"fade"}},[e.loading?n("div",{staticClass:"pending overlay"},[n("div",{staticClass:"overlay-content"},[n("i",{staticClass:"icon-spinner animate-spin"}),e._v("\n"+e._s(e.loading)+"\n")])]):e._e()]),e._v(""),n("transition",{attrs:{name:"fade"}},[e.error?n("div",{staticClass:"pending overlay"},[n("div",{staticClass:"overlay-content"},[n("i",{staticClass:"icon-attention-1"}),e._v("\n"+e._s(e.error)+"\n")])]):e._e()]),e._v(""),e._l(e.days,function(t,s){returnn("article",{staticClass:"card xs"},[n("h3",{staticClass:"card-title"},[n("strong",[e._v(e._s(e.daysLabels[s]))]),e._v(""),e.editDay?n("input",{directives:[{name:"model",rawName:"v-model",value:e.days[s],expression:"days[day]"}],attrs:{type:"text"},domProps:{value:e.days[s]},on:{input:function(t){t.target.composing||e.$set(e.days,s,t.target.value)}}}):n("em",{staticClass:"total",on:{click:function(t){e.handlerEditDays()}}},[e._v(e._s(e._f("heures")(t)))])])])}),e._v(""),n("article",{staticClass:"card"},[n("h3",{staticClass:"card-title"},[n("strong",[e._v("Total / semaine")]),e._v(""),n("em",{staticClass:"total"},[e._v(e._s(e._f("heures")(e.totalWeek)))])])]),e._v(""),n("nav",[e.editDay?e._e():n("button",{staticClass:"btn btn-default",on:{click:function(t){e.handlerEditDays()}}},[n("i",{staticClass:"icon-pencil"}),e._v(" modifier")]),e._v(""),e.editDay?n("button",{staticClass:"btn btn-primary",on:{click:function(t){e.handlerSaveDays()}}},[n("i",{staticClass:"icon-floppy"}),e._v(" enregistrer")]):e._e(),e._v(""),e.editDay?n("button",{staticClass:"btn btn-primary",on:{click:function(t){e.fetch()}}},[n("i",{staticClass:"icon-cancel-circled"}),e._v(" annuler")]):e._e()]),e._v(""),n("pre",[e._v(e._s(e.days))])],2)},a=[],i={render:s,staticRenderFns:a};t.a=i}])});