From c40d45e7c94719cdaa4cf8f67e8fa936c920908c Mon Sep 17 00:00:00 2001 From: Guillaume FAUVET Date: Sat, 31 Mar 2018 13:33:08 +0200 Subject: [PATCH] =?UTF-8?q?[page.home]=20{correction}=C2=A0maj=20des=20nom?= =?UTF-8?q?s=20des=20heures=20+=20ajout=20de=20l=C3=A9gendes=20extra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack/component/home/page1.vue | 2 +- webpack/data/home.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/webpack/component/home/page1.vue b/webpack/component/home/page1.vue index 61f655e..83e7a48 100644 --- a/webpack/component/home/page1.vue +++ b/webpack/component/home/page1.vue @@ -33,7 +33,7 @@ :height="gstore.dimensions.bin.width" :width="gstore.dimensions.bin.margin + (gstore.dimensions.axis.width * value)/gstore.maxValue" :data-info="value"> - {{ value }} + {{ (gstore.titles && gstore.titles[key]) ? value + ' ' + gstore.titles[key] : value }} diff --git a/webpack/data/home.js b/webpack/data/home.js index 3e45aa0..984eeb9 100644 --- a/webpack/data/home.js +++ b/webpack/data/home.js @@ -14,30 +14,35 @@ api.call('GET department/stats', {}, function(rs) { } let maxValue = null; - let maxKeyLength = null; + let maxLabelLength = null; let data = {}; let map = { - "potentiel" : "Heures dûes", - "sous_service" : "Heures à faire", + "potentiel" : "Heures potentielles", + "sous_service" : "Heures en sous-services", "heures_comp" : "Heures comp.", "heures_vacataire" : "Heures vacataires", - "heures_exterieur" : "Heures extérieurs", + "heures_exterieur" : "Heures à l'extérieurs", "heures_ue_desactive" : "Heures UE annulées", "nbr_ue_desactive" : "Nombre d'UE annulées" }; for (let stat in rs.data) { maxValue = rs.data[stat] > maxValue ? rs.data[stat] : maxValue; - maxKeyLength = stat.length > maxKeyLength ? stat.length : maxKeyLength; + maxLabelLength = map[stat].length > maxLabelLength ? map[stat].length : maxLabelLength; data[map[stat]] = Math.round(rs.data[stat] * 100) / 100; } + gstore.get.titles = {}; + gstore.get.titles[map['heures_ue_desactive']] = `sur ${data[map['nbr_ue_desactive']]} UE annulées`; + + delete data[map['nbr_ue_desactive']]; + gstore.get.stats = data; gstore.get.dimensions = { padding: 5, text: { - size: maxKeyLength * 9.5, + size: maxLabelLength * 9.5, alignH: 5, alignV: 20, },