From 1583cbeda14931288e1c516e1a280d1f15c60455 Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 02:27:55 -0300 Subject: [PATCH 01/17] all years --- .../graph/grossAnualChart/GrossAnualChart.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index dcf360a..4ada146 100644 --- a/src/components/graph/grossAnualChart/GrossAnualChart.tsx +++ b/src/components/graph/grossAnualChart/GrossAnualChart.tsx @@ -103,11 +103,11 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba }; let labels: string[]; - if (bruta) { - labels = [`Até ${new Date().getFullYear()-1}`, `${new Date().getFullYear()}`] - } else { - labels = label - } + //if (bruta) { + // labels = [`Até ${new Date().getFullYear()-1}`, `${new Date().getFullYear()}`] + //} else { + labels = label; + //} const data: any = { labels, From 36223cc3343f1698f0aa1f67f4fd2ccfdbfea52a Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 02:28:34 -0300 Subject: [PATCH 02/17] All months --- src/pages/dashboard/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx index 8b78a6a..6ec8ce1 100644 --- a/src/pages/dashboard/index.tsx +++ b/src/pages/dashboard/index.tsx @@ -92,7 +92,8 @@ export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensal value.mes)} + //label={grossMensalGraph.map((value) => value.mes)} + label={months} miniature /> From 56bdcded97f6b9dccc43cc53ff52c93a25d3d254 Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 02:30:51 -0300 Subject: [PATCH 03/17] fix lint --- src/components/graph/grossAnualChart/GrossAnualChart.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index 4ada146..e0bd1fe 100644 --- a/src/components/graph/grossAnualChart/GrossAnualChart.tsx +++ b/src/components/graph/grossAnualChart/GrossAnualChart.tsx @@ -102,11 +102,11 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba }, }; - let labels: string[]; + const labels: string[] = label; //if (bruta) { // labels = [`Até ${new Date().getFullYear()-1}`, `${new Date().getFullYear()}`] //} else { - labels = label; + // labels = label; //} const data: any = { From e8a758153973f2e2ed0f9e5ad6945068f3c5452d Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 02:36:56 -0300 Subject: [PATCH 04/17] fixed econ --- .../accumulatedEconomyTitle/AccumulatedEconomyTitle.tsx | 2 +- src/components/graph/grossMensalChart/GrossMensalChart.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/accumulatedEconomyTitle/AccumulatedEconomyTitle.tsx b/src/components/accumulatedEconomyTitle/AccumulatedEconomyTitle.tsx index a0ea411..381b263 100644 --- a/src/components/accumulatedEconomyTitle/AccumulatedEconomyTitle.tsx +++ b/src/components/accumulatedEconomyTitle/AccumulatedEconomyTitle.tsx @@ -2,5 +2,5 @@ import React from 'react' import { AccumulatedEconomyTitleView } from './AccumulatedEconomyTitleView' export default function AccumulatedEconomyTitle({value}: {value: string}) { - return Economia Acumulada:

R${parseFloat(value).toLocaleString('pt-br',{currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})}

+ return Economia Acumulada:

R${(parseFloat(value)*1000).toLocaleString('pt-br',{currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})}

} diff --git a/src/components/graph/grossMensalChart/GrossMensalChart.tsx b/src/components/graph/grossMensalChart/GrossMensalChart.tsx index ca611be..d49c9b4 100644 --- a/src/components/graph/grossMensalChart/GrossMensalChart.tsx +++ b/src/components/graph/grossMensalChart/GrossMensalChart.tsx @@ -55,7 +55,7 @@ export default function GrossMensalChart({ title, data1, data2, label, subtitle, while (index < data1.length) { data1[index].dad_estimado? lastData=data1[index].economia_acumulada : null index++ - setLastData(`economia acumulada: R$ ${parseFloat(lastData).toFixed(3)}`) + setLastData(`economia acumulada: R$ ${parseFloat(lastData).toLocaleString('pt-br', {minimumFractionDigits: 2})}`) } }, [data1]) From b53b6436bb096caddc1a5141c91d7a677eb953df Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 02:41:47 -0300 Subject: [PATCH 05/17] add estimated annual --- src/components/graph/grossAnualChart/GrossAnualChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index e0bd1fe..cc56f49 100644 --- a/src/components/graph/grossAnualChart/GrossAnualChart.tsx +++ b/src/components/graph/grossAnualChart/GrossAnualChart.tsx @@ -126,7 +126,7 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba type: 'bar', stacked: true, label: 'Estimado', - data: dataProps.filter(value => value.ano === '2022').map((value, index) => { + data: dataProps.filter(value => value.dad_estimado === true).map((value, index) => { if (value.dad_estimado) return parseFloat(value.economia_acumulada) }), From 0427e572a60cebc50422368a4e4bea8d9cff5ab2 Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 02:52:39 -0300 Subject: [PATCH 06/17] unique labels --- .../graph/grossAnualChart/GrossAnualChart.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index cc56f49..b248f2b 100644 --- a/src/components/graph/grossAnualChart/GrossAnualChart.tsx +++ b/src/components/graph/grossAnualChart/GrossAnualChart.tsx @@ -102,7 +102,9 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba }, }; - const labels: string[] = label; + const labels: string[] = label.filter(function(item, pos) { + return label.indexOf(item) == pos; + }); //if (bruta) { // labels = [`Até ${new Date().getFullYear()-1}`, `${new Date().getFullYear()}`] //} else { @@ -126,10 +128,12 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba type: 'bar', stacked: true, label: 'Estimado', - data: dataProps.filter(value => value.dad_estimado === true).map((value, index) => { + data: [0].concat(dataProps.filter(value => value.dad_estimado === true).map((value, index) => { if (value.dad_estimado) - return parseFloat(value.economia_acumulada) - }), + return parseFloat(value.economia_acumulada) + else + return 0 + })), borderRadius: 10, backgroundColor: draw('diagonal-right-left', '#C2d5fb'), }, From d6367c6493393ccdfeea707e124d22508520ead4 Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 02:55:16 -0300 Subject: [PATCH 07/17] Smaller font size --- src/components/graph/grossAnualChart/GrossAnualChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index b248f2b..b6966eb 100644 --- a/src/components/graph/grossAnualChart/GrossAnualChart.tsx +++ b/src/components/graph/grossAnualChart/GrossAnualChart.tsx @@ -86,7 +86,7 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba align: "start", font: { weight: 'bold', - size: !miniature? window.innerWidth/80 : window.innerWidth/105, + size: !miniature? window.innerWidth/80 : window.innerWidth/120, }, color: (value) => { return value.dataset.label==='Consolidada'? '#fff' : '#255488' From a2077f03d5743c5d8e91b7b6ce5c8c15aed3a31e Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 02:57:33 -0300 Subject: [PATCH 08/17] Smaller fonts annual --- src/components/graph/grossAnualChart/GrossAnualChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index b6966eb..0960547 100644 --- a/src/components/graph/grossAnualChart/GrossAnualChart.tsx +++ b/src/components/graph/grossAnualChart/GrossAnualChart.tsx @@ -86,7 +86,7 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba align: "start", font: { weight: 'bold', - size: !miniature? window.innerWidth/80 : window.innerWidth/120, + size: !miniature? window.innerWidth/80 : window.innerWidth/130, }, color: (value) => { return value.dataset.label==='Consolidada'? '#fff' : '#255488' From e94401c78d613711cf276fab651b92e6bbf2b88d Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 02:59:01 -0300 Subject: [PATCH 09/17] Smaller fonts --- src/components/graph/config.ts | 6 +++--- src/components/graph/grossAnualChart/GrossAnualChart.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/graph/config.ts b/src/components/graph/config.ts index 03a9458..919bfb6 100644 --- a/src/components/graph/config.ts +++ b/src/components/graph/config.ts @@ -11,7 +11,7 @@ const config = (miniature: boolean | undefined): ChartOptions => { }, ticks: { font: { - size: !miniature? window.innerWidth/90 : window.innerWidth/110 + size: !miniature? window.innerWidth/90 : window.innerWidth/130 } }, }, @@ -22,7 +22,7 @@ const config = (miniature: boolean | undefined): ChartOptions => { }, ticks: { font: { - size: !miniature? window.innerWidth/90 : window.innerWidth/110 + size: !miniature? window.innerWidth/90 : window.innerWidth/130 } }, }, @@ -45,7 +45,7 @@ const config = (miniature: boolean | undefined): ChartOptions => { align: "end", font: { weight: 'bold', - size: !miniature? window.innerWidth/80 : window.innerWidth/105 + size: !miniature? window.innerWidth/80 : window.innerWidth/130 } }, legend: { diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index 0960547..9bbaf70 100644 --- a/src/components/graph/grossAnualChart/GrossAnualChart.tsx +++ b/src/components/graph/grossAnualChart/GrossAnualChart.tsx @@ -46,7 +46,7 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba }, ticks: { font: { - size: !miniature? window.innerWidth/90 : window.innerWidth/110 + size: !miniature? window.innerWidth/90 : window.innerWidth/130 } }, }, @@ -57,7 +57,7 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba }, ticks: { font: { - size: !miniature? window.innerWidth/90 : window.innerWidth/110 + size: !miniature? window.innerWidth/90 : window.innerWidth/130 } }, }, From 17d9bbfe1a80a336cd57f3c80a91a9bb5e858777 Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 03:03:53 -0300 Subject: [PATCH 10/17] changing 1995 to 1650 on dashboard --- src/styles/layouts/dashboard/DashboardView.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/layouts/dashboard/DashboardView.ts b/src/styles/layouts/dashboard/DashboardView.ts index 809900d..f565255 100644 --- a/src/styles/layouts/dashboard/DashboardView.ts +++ b/src/styles/layouts/dashboard/DashboardView.ts @@ -51,7 +51,7 @@ export const DashboardView = styled.main` } } - @media (max-width: 1195px) { + @media (max-width: 1650px) { width: 100%; padding: 30px; margin: 0; From 5535fb860f582216b8c99f52759c2cad990186cb Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 03:05:21 -0300 Subject: [PATCH 11/17] adding span gaps to annual --- src/components/graph/grossAnualChart/GrossAnualChart.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index 9bbaf70..c4644e8 100644 --- a/src/components/graph/grossAnualChart/GrossAnualChart.tsx +++ b/src/components/graph/grossAnualChart/GrossAnualChart.tsx @@ -128,7 +128,8 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba type: 'bar', stacked: true, label: 'Estimado', - data: [0].concat(dataProps.filter(value => value.dad_estimado === true).map((value, index) => { + spanGaps: true, + data: [null].concat(dataProps.filter(value => value.dad_estimado === true).map((value, index) => { if (value.dad_estimado) return parseFloat(value.economia_acumulada) else From 0230c6ccf4d10e892f4f4ff587f5eba521958db1 Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 03:12:33 -0300 Subject: [PATCH 12/17] change font size pattern --- src/components/graph/config.ts | 6 +++--- src/components/graph/grossAnualChart/GrossAnualChart.tsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/graph/config.ts b/src/components/graph/config.ts index 919bfb6..4dc708c 100644 --- a/src/components/graph/config.ts +++ b/src/components/graph/config.ts @@ -11,7 +11,7 @@ const config = (miniature: boolean | undefined): ChartOptions => { }, ticks: { font: { - size: !miniature? window.innerWidth/90 : window.innerWidth/130 + size: !miniature? window.innerWidth/90 : window.innerWidth/125 } }, }, @@ -22,7 +22,7 @@ const config = (miniature: boolean | undefined): ChartOptions => { }, ticks: { font: { - size: !miniature? window.innerWidth/90 : window.innerWidth/130 + size: !miniature? window.innerWidth/90 : window.innerWidth/125 } }, }, @@ -45,7 +45,7 @@ const config = (miniature: boolean | undefined): ChartOptions => { align: "end", font: { weight: 'bold', - size: !miniature? window.innerWidth/80 : window.innerWidth/130 + size: !miniature? window.innerWidth/80 : window.innerWidth/125 } }, legend: { diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index c4644e8..344f069 100644 --- a/src/components/graph/grossAnualChart/GrossAnualChart.tsx +++ b/src/components/graph/grossAnualChart/GrossAnualChart.tsx @@ -46,7 +46,7 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba }, ticks: { font: { - size: !miniature? window.innerWidth/90 : window.innerWidth/130 + size: !miniature? window.innerWidth/90 : window.innerWidth/125 } }, }, @@ -57,7 +57,7 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba }, ticks: { font: { - size: !miniature? window.innerWidth/90 : window.innerWidth/130 + size: !miniature? window.innerWidth/90 : window.innerWidth/125 } }, }, @@ -86,7 +86,7 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba align: "start", font: { weight: 'bold', - size: !miniature? window.innerWidth/80 : window.innerWidth/130, + size: !miniature? window.innerWidth/80 : window.innerWidth/125, }, color: (value) => { return value.dataset.label==='Consolidada'? '#fff' : '#255488' From 85084c74dbee6408a09881fb4513fbce1e7f5f7f Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 03:21:59 -0300 Subject: [PATCH 13/17] Changing operation type --- src/pages/resumoOperacao/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/resumoOperacao/index.tsx b/src/pages/resumoOperacao/index.tsx index a1f1b7f..a3bea91 100644 --- a/src/pages/resumoOperacao/index.tsx +++ b/src/pages/resumoOperacao/index.tsx @@ -184,7 +184,7 @@ export default function ResumoOperacao({tableData, clients, userName, clientMont return {value.mes} {value.unidade} - {value.operacao} + {value.nf_c_icms > 0 ? 'Compra' : 'Cessão'} {value.contraparte} {parseFloat(value.montante_nf).toLocaleString('pt-br')} {parseFloat(value.preco_nf).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})} From d489a378223a92db9039e2403f2a8476b90ef034 Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 03:24:32 -0300 Subject: [PATCH 14/17] making logo smaller --- src/components/header/HeaderView.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/header/HeaderView.ts b/src/components/header/HeaderView.ts index c205221..059696f 100644 --- a/src/components/header/HeaderView.ts +++ b/src/components/header/HeaderView.ts @@ -36,6 +36,8 @@ export const HeaderView = styled.header` justify-content: center; width: 40%; + max-width: 120px; + max-height: 100px; img { width: 100%; From 1b9c599ef2087e047759aadccc93a14164714b95 Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 03:33:04 -0300 Subject: [PATCH 15/17] Fix unity id request --- src/pages/economy/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/economy/index.tsx b/src/pages/economy/index.tsx index 7d6fa37..4fea18b 100644 --- a/src/pages/economy/index.tsx +++ b/src/pages/economy/index.tsx @@ -74,7 +74,7 @@ export default function economy({userName, anual, years, brutaMensal, catLiv, cl useEffect(() => { api.post('/economy/estimates', unity!==''?{ "filters": [ - {"type" : "=", "field":"dados_cadastrais.cod_smart_unidade", "value": unity!=="default"? null : unity} + {"type" : "=", "field":"dados_cadastrais.cod_smart_unidade", "value": unity === "default" ? null : unity} ] }:{}).then(res => { setCatLivDataState(res.data.data) @@ -82,7 +82,7 @@ export default function economy({userName, anual, years, brutaMensal, catLiv, cl api.post('/economy/MWh', unity!==''?{ "filters": [ - {"type" : "=", "field":"dados_cadastrais.cod_smart_unidade", "value": unity!=="default"? null : unity} + {"type" : "=", "field":"dados_cadastrais.cod_smart_unidade", "value": unity === "default"? null : unity} ] }:{}).then(res => { setIndicatorDataState(res.data.data) From 22ef1b4890d2cfa85a1bebb0649e3b3c50d3dc87 Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 03:35:39 -0300 Subject: [PATCH 16/17] Fix unity all request filter --- src/pages/economy/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/economy/index.tsx b/src/pages/economy/index.tsx index 4fea18b..5c7fb09 100644 --- a/src/pages/economy/index.tsx +++ b/src/pages/economy/index.tsx @@ -74,7 +74,7 @@ export default function economy({userName, anual, years, brutaMensal, catLiv, cl useEffect(() => { api.post('/economy/estimates', unity!==''?{ "filters": [ - {"type" : "=", "field":"dados_cadastrais.cod_smart_unidade", "value": unity === "default" ? null : unity} + {"type" : "=", "field":"dados_cadastrais.cod_smart_unidade", "value": unity === "default" ? unity : unity} ] }:{}).then(res => { setCatLivDataState(res.data.data) @@ -82,7 +82,7 @@ export default function economy({userName, anual, years, brutaMensal, catLiv, cl api.post('/economy/MWh', unity!==''?{ "filters": [ - {"type" : "=", "field":"dados_cadastrais.cod_smart_unidade", "value": unity === "default"? null : unity} + {"type" : "=", "field":"dados_cadastrais.cod_smart_unidade", "value": unity === "default"? unity : unity} ] }:{}).then(res => { setIndicatorDataState(res.data.data) From c2b539dfe404d0310f8331cfd06c677ca9c5c49c Mon Sep 17 00:00:00 2001 From: Luiz Filipe Date: Tue, 16 Aug 2022 03:38:00 -0300 Subject: [PATCH 17/17] fix --- src/pages/economy/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/economy/index.tsx b/src/pages/economy/index.tsx index 5c7fb09..abfcad8 100644 --- a/src/pages/economy/index.tsx +++ b/src/pages/economy/index.tsx @@ -161,7 +161,7 @@ export default function economy({userName, anual, years, brutaMensal, catLiv, cl onChange={value => setUnity(value.target.value)} fullWidth > - Todas + Todas { clients.map((value) => { return {value.unidade} @@ -190,7 +190,7 @@ export default function economy({userName, anual, years, brutaMensal, catLiv, cl onChange={value => setUnity(value.target.value)} fullWidth > - Todas + Todas {/* RSZFNAENTR101P COMENTARIO DE OPÇAO COM DADOS TESTES */} { clients.map((value) => {