From a4bb6bbca6df888629089d3e6f7e47b0a9f38d70 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 17 Sep 2021 22:36:56 +0000 Subject: [PATCH] --- ayanova/src/views/home-schedule.vue | 67 +++-------------------------- 1 file changed, 6 insertions(+), 61 deletions(-) diff --git a/ayanova/src/views/home-schedule.vue b/ayanova/src/views/home-schedule.vue index d1349d05..8a3b375f 100644 --- a/ayanova/src/views/home-schedule.vue +++ b/ayanova/src/views/home-schedule.vue @@ -266,15 +266,16 @@ SETTINGS: https://vuetifyjs.com/en/components/calendars/#drag-and-drop https://vuetifyjs.com/en/components/floating-action-buttons/#speed-dial - issues: - drag/extend needs to actually update the work order + issues: drag/extend should not affect locked workorders!! Add canModify or something to event data so no need to even start the op if it can't be done - Extension handle hard to see sb colored same as title text to contrast or have dark and light lines both maybe?? + - Test: overlapping sched items that start or end outside of view - this is a test of the query in schedulecontroller at server + TESTING: + overlapping sched items that start or end outside of view this is a test of the query in schedulecontroller at server + touch mode still can do all ops + ultimately test on devices reporting - make it happen could just default to regular reporting list, doesn't absolutely need to be a calendar at least at first @@ -413,8 +414,6 @@ export default { ); } - //post it - //--- try { window.$gz.form.deleteAllErrorBoxErrors(this); @@ -428,7 +427,6 @@ export default { } catch (error) { window.$gz.errorHandler.handleFormError(error, this); } - //--- } else if (this.createStart && !this.dragEvent && !this.extendEvent) { console.log( "endDragExtend: event is CREATE for new event", @@ -436,40 +434,6 @@ export default { ); } - //dragevent: - // //dragEvent.start is the new start time for this event to be set - // console.log("endDragExtend: event is DRAG of existing event", { - // dragEventStart: new Date(this.dragEvent.start).toString(), - // dragTime: this.dragTime - // }); - // else if (this.extendEvent) { - // //extendEvent.start is the new start time (if dragged upwards beyond start) - // //extendEvent.end is the new end time for this event to be set - // //to be safe should set both start and end here - // console.log("endDragExtend: event is EXTEND of existing event", { - // extendEventStart: new Date(this.extendEvent.start).toString(), - // extendEventEnd: new Date(this.extendEvent.end).toString() - // //extendEventStart: new Date(this.extendEvent.start).toString(), - // //extendOriginal: this.extendOriginal, - // //createStart: this.createStart - // }); - // } - - /* -/schedule/adjust post - public AyaType Type { get; set; } - public long Id { get; set; } - public DateTime Start { get; set; } - public DateTime End { get; set; } -*/ - // console.log("endDragExtend, deets: ", { - // dragEvent: this.dragEvent, - // dragTime: this.dragTime, - // extendEvent: this.extendEvent, - // createStart: this.createStart, - // extendOriginal: this.extendOriginal - // }); - this.dragTime = null; this.dragEvent = null; this.extendEvent = null; @@ -497,36 +461,19 @@ export default { this.dragEvent = null; }, mouseMove(tms) { - // //console.log("moustMove", tms); const mouse = this.toTime(tms); - - //console.log("mouseMove got time:", mouse); - if (this.dragEvent && this.dragTime !== null) { //# DRAGGING PATH - console.log("MouseMove: DRAGGING"); - - //new Date(this.dragEvent.start).getTime(); const start = this.dragEvent.start; const end = this.dragEvent.end; - // if (typeof start == "string") { - // start = new Date(start).getTime(); - // } - // if (typeof end == "string") { - // end = new Date(end).getTime(); - // } const duration = end - start; const newStartTime = mouse - this.dragTime; - const newStart = this.roundTime(newStartTime); - //console.log("mouseMove newStart...", newStart); const newEnd = newStart + duration; - this.dragEvent.start = newStart; this.dragEvent.end = newEnd; } else if (this.extendEvent && this.createStart !== null) { //# EXTENDING PATH - console.log("mosueMove: EXTENDING"); const mouseRounded = this.roundTime(mouse, false); //console.log("mouseMove mouseRounded:", mouseRounded); const min = Math.min(mouseRounded, this.createStart); @@ -566,7 +513,6 @@ export default { } }, roundTime(time, down = true) { - //console.log("roundtime..."); const roundTo = 15; // minutes const roundDownTime = roundTo * 60 * 1000; @@ -575,7 +521,6 @@ export default { : time + (roundDownTime - (time % roundDownTime)); }, toTime(tms) { - //console.log("toTime tms=", tms); return new Date( tms.year, tms.month - 1,