From c2ffa8891232ee9327357cb9255b5c406a18deb7 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Thu, 21 Feb 2019 16:26:48 +0000 Subject: [PATCH] Added quick interval to observations view --- frontend/src/views/ViewObservations.vue | 172 ++++++++++++++++-------- 1 file changed, 115 insertions(+), 57 deletions(-) diff --git a/frontend/src/views/ViewObservations.vue b/frontend/src/views/ViewObservations.vue index 438f31c..2476593 100644 --- a/frontend/src/views/ViewObservations.vue +++ b/frontend/src/views/ViewObservations.vue @@ -12,6 +12,29 @@ + + + + Quick Interval: + 1 Week + 1 Month + 3 Months + 1 Year + + + @@ -30,7 +53,8 @@ {{ observation.type }} / {{ observation.observed }} -

Observed by: +

+ Observed by: {{ tutor.name }} @@ -45,80 +69,112 @@
- +
{{ observation.monitoring.toFixed(1) }}
- +
{{ observation.controlProcedural.toFixed(1) }}
- +
{{ observation.control.toFixed(1) }}
- +
{{ observation.conservatism.toFixed(1) }}
- +
{{ observation.teamworkCommunications.toFixed(1) }}
- +
{{ observation.teamworkLeadership.toFixed(1) }}
- +
{{ observation.teamworkWorkload.toFixed(1) }}
- +
{{ observation.knowledge.toFixed(1) }}
- -

{{ entry.title }}

-
- - - - - - - - - - - - - - - - + +

{{ entry.title }}

+
+ + + + + + + + + + + + + + + +
@@ -126,9 +182,7 @@ CSV Dump - - Loading... - + Loading... @@ -144,7 +198,7 @@ import Vue from "vue"; import "vue-awesome/icons/search"; import ObservationEntry from "../components/ObservationEntry.vue"; -import ObservationSearchBar from "../components/ObservationSearchBar" +import ObservationSearchBar from "../components/ObservationSearchBar"; var moment = require("moment"); export default { @@ -179,7 +233,7 @@ export default { }, methods: { getFiltered: function() { - this.loading = true + this.loading = true; Vue.axios .post("/observations", { site: this.$store.state.search.site, @@ -191,13 +245,13 @@ export default { }) .then(response => { this.observationData = response.data; - this.loading = false + this.loading = false; }) .catch(error => { this.errorStatus = error.response.status; this.errorMessage = error.response.data; this.$refs.errorModal.show(); - this.loading = false + this.loading = false; }); }, getCSV: function() { @@ -231,6 +285,10 @@ export default { } else { return data.substr(0, 20) + "..."; } + }, + setInterval: function(amount, timeType) { + this.endDate = moment(); + this.startDate = moment().subtract(amount, timeType); } } }; @@ -245,7 +303,7 @@ export default { text-align: center; } .scorewarning { - background-color: red; + background-color: red; } .image-centered-text { position: absolute;