From e5c951ab4eac97e664a40ddf31b111ab5d35b362 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 25 Feb 2022 16:54:17 +0000 Subject: [PATCH] --- .../components/dash-labor-hours-personal.vue | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/ayanova/src/components/dash-labor-hours-personal.vue b/ayanova/src/components/dash-labor-hours-personal.vue index 593f190f..0118cc38 100644 --- a/ayanova/src/components/dash-labor-hours-personal.vue +++ b/ayanova/src/components/dash-labor-hours-personal.vue @@ -118,6 +118,20 @@ export default { //do not want the client end to have to do math or anything and also it needs to drive reporting of the same type as the widget display //so as similar as possible to the datatable system but handles the math and summarizing ideally in the db server itself /* + TODO: + DYNAMIC FROM SETS + handle params (time range, currentusertoken,period) + enforce current user only (I guess that's built in if use token or leave out token because it's assumed in which case rename to WorkOrderItemLaborQuantitySummaryPERSONAL ) + ACTUAL CHART WORKING + line chart, can it work with this data, does it need adjustment to locale? + scroll? Vertical better than horizontal? Select bar OR line? + + + REPORTING + v.nexxt? + charts lib at server? + + DateTrunc https://www.postgresqltutorial.com/postgresql-date_trunc/ will respect changes of month or year or whatever so this works SELECT row_to_json(t) as res from ( @@ -133,27 +147,30 @@ GROUP BY timeframe ORDER BY timeframe ASC ) t -TODO: - DYNAMIC FROM SETS - handle params (time range, currentusertoken,period) - enforce current user only (I guess that's built in if use token or leave out token because it's assumed in which case rename to WorkOrderItemLaborQuantitySummaryPERSONAL ) - ACTUAL CHART WORKING - line chart, can it work with this data, does it need adjustment to locale? - scroll? Vertical better than horizontal? Select bar OR line? - - REPORTING - v.nexxt? - charts lib at server? */ + + // let tt = { + // KPIName: "WorkOrderItemLaborQuantitySummary", + // criteria: { + // dateRange: this.settings.dateRange, + // unit: this.settings.unit + // }, + // clientTimeStamp: window.$gz.locale.clientLocalZoneTimeStamp() + // }; + // console.log(tt); + try { this.errorMessage = null; const res = await window.$gz.api.post("kpi", { KPIName: "WorkOrderItemLaborQuantitySummary", - criteria: JSON.stringify({ test: 12, blah: "blahbittyblahblahblah" }), + criteria: { + dateRange: this.settings.dateRange, + unit: this.settings.unit + }, clientTimeStamp: window.$gz.locale.clientLocalZoneTimeStamp() }); if (res.error) {