From 62afd28f904d6e9b29d502a7ea8fd63bb6822ad4 Mon Sep 17 00:00:00 2001 From: joseCorte-exe Date: Tue, 9 Aug 2022 09:17:29 -0300 Subject: [PATCH] fixing charts fonst and add more features --- next.config.js | 2 +- src/components/graph/DemRegXDemConChart.tsx | 4 +- .../graph/DiscretizedConsumptionChart.tsx | 4 +- .../graph/cativoXLivreChart/index.tsx | 4 +- .../graph/costIndicatorChart/index.tsx | 12 ++- src/components/graph/fatorPotenciaChart.tsx | 4 +- .../graph/grossAnualChart/GrossAnualChart.tsx | 4 +- .../grossMensalChart/GrossMensalChart.tsx | 21 ++++-- src/components/header/Header.tsx | 9 +-- src/components/header/HeaderView.ts | 13 ++++ src/pages/chartTelemetry/index.tsx | 23 ------ src/pages/consumption/index.tsx | 45 ----------- src/pages/dashboard/index.tsx | 52 ++++++++----- src/pages/economy/index.tsx | 75 ++++++++++--------- src/pages/estimatedCost/index.tsx | 3 +- src/pages/grossSavings/index.tsx | 3 - src/pages/pld/index.tsx | 4 +- src/pages/resumoOperacao/index.tsx | 7 +- src/pages/telemetria/index.tsx | 2 +- src/services/DadosTabelaResumoOperacao.js | 10 --- src/services/consumoDiscretizadoBar.js | 12 --- src/services/consumoDiscretizadoLine.js | 14 ---- src/services/consumoEstimado.js | 6 -- src/services/dados.json | 10 --- src/services/economiaAcumulada.js | 15 ---- src/services/economiaBruta.js | 4 - src/services/economiaBruta.json | 6 -- src/services/economiaIndicador.js | 5 -- src/services/evolucaoPld.js | 8 -- src/services/fatorPotencia.js | 8 -- src/styles/layouts/economy/economy.ts | 15 ++++ src/txt.txt | 0 32 files changed, 144 insertions(+), 260 deletions(-) delete mode 100644 src/pages/consumption/index.tsx delete mode 100644 src/services/DadosTabelaResumoOperacao.js delete mode 100644 src/services/consumoDiscretizadoBar.js delete mode 100644 src/services/consumoDiscretizadoLine.js delete mode 100644 src/services/consumoEstimado.js delete mode 100644 src/services/dados.json delete mode 100644 src/services/economiaAcumulada.js delete mode 100644 src/services/economiaBruta.js delete mode 100644 src/services/economiaBruta.json delete mode 100644 src/services/economiaIndicador.js delete mode 100644 src/services/evolucaoPld.js delete mode 100644 src/services/fatorPotencia.js delete mode 100644 src/txt.txt diff --git a/next.config.js b/next.config.js index b991d93..72eb432 100644 --- a/next.config.js +++ b/next.config.js @@ -6,7 +6,7 @@ const nextConfig = { styledComponents: true, }, images: { - domains: ["kluppdevelopment.s3.sa-east-1.amazonaws.com"] + domains: ["kluppdevelopment.s3.sa-east-1.amazonaws.com", "api.energiasmart.com.br"] } } diff --git a/src/components/graph/DemRegXDemConChart.tsx b/src/components/graph/DemRegXDemConChart.tsx index dcd17e6..9a63332 100644 --- a/src/components/graph/DemRegXDemConChart.tsx +++ b/src/components/graph/DemRegXDemConChart.tsx @@ -95,7 +95,7 @@ export function DemRegXDemConChart({ }, ticks: { font: { - size: 16 + size: window.innerWidth/80 } }, }, @@ -105,7 +105,7 @@ export function DemRegXDemConChart({ }, ticks: { font: { - size: 16 + size: window.innerWidth/80 } }, }, diff --git a/src/components/graph/DiscretizedConsumptionChart.tsx b/src/components/graph/DiscretizedConsumptionChart.tsx index b71577b..98071f3 100644 --- a/src/components/graph/DiscretizedConsumptionChart.tsx +++ b/src/components/graph/DiscretizedConsumptionChart.tsx @@ -43,7 +43,7 @@ export function DiscretizedConsumptionChart({ title, subtitle, dataProps, label, }, ticks: { font: { - size: 16 + size: window.innerWidth/80 } }, }, @@ -53,7 +53,7 @@ export function DiscretizedConsumptionChart({ title, subtitle, dataProps, label, }, ticks: { font: { - size: 16 + size: window.innerWidth/80 } }, }, diff --git a/src/components/graph/cativoXLivreChart/index.tsx b/src/components/graph/cativoXLivreChart/index.tsx index 565a115..0fe5aa2 100644 --- a/src/components/graph/cativoXLivreChart/index.tsx +++ b/src/components/graph/cativoXLivreChart/index.tsx @@ -85,7 +85,7 @@ export function CativoXLivreChart({ title, subtitle, chartData, label, dataset1, }, ticks: { font: { - size: !miniature? 16 : 10 + size: !miniature? window.innerWidth/80 : window.innerWidth/100 } }, }, @@ -95,7 +95,7 @@ export function CativoXLivreChart({ title, subtitle, chartData, label, dataset1, }, ticks: { font: { - size: !miniature? 16 : 10 + size: !miniature? window.innerWidth/80 : window.innerWidth/100 } }, }, diff --git a/src/components/graph/costIndicatorChart/index.tsx b/src/components/graph/costIndicatorChart/index.tsx index 856a342..7cb103e 100644 --- a/src/components/graph/costIndicatorChart/index.tsx +++ b/src/components/graph/costIndicatorChart/index.tsx @@ -43,22 +43,24 @@ export default function CostIndicatorChart({ title, data1, data2, label, subtitl responsive: true, scales: { x: { + // stacked: false, grid: { display: false }, ticks: { font: { - size: !miniature? 16 : 10 + size: !miniature? window.innerWidth/80 : window.innerWidth/100 } }, }, y: { + stacked: false, grid: { display: false }, ticks: { font: { - size: !miniature? 16 : 10 + size: !miniature? window.innerWidth/80 : window.innerWidth/100 } }, }, @@ -101,6 +103,12 @@ export default function CostIndicatorChart({ title, data1, data2, label, subtitl label: '2021', data: data1?.map(value => value.custo_unit>0? value.custo_unit : null), borderRadius: 8, + datalabels: { + backgroundColor: 'white', + borderRadius: 8, + opacity: .8, + offset: -5 + }, backgroundColor: (value, ctx) => { if (value.dad_estimado) return draw('diagonal-right-left', '#C2d5fb'); diff --git a/src/components/graph/fatorPotenciaChart.tsx b/src/components/graph/fatorPotenciaChart.tsx index 5189992..a134f11 100644 --- a/src/components/graph/fatorPotenciaChart.tsx +++ b/src/components/graph/fatorPotenciaChart.tsx @@ -53,7 +53,7 @@ export default function FatorPotenciaChart({ title, subtitle, data1, data2, labe }, ticks: { font: { - size: 16 + size: window.innerWidth/80 } }, }, @@ -63,7 +63,7 @@ export default function FatorPotenciaChart({ title, subtitle, data1, data2, labe }, ticks: { font: { - size: 16 + size: window.innerWidth/80 } }, }, diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index 6596e07..cf57379 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? 16 : 10 + size: !miniature? window.innerWidth/80 : window.innerWidth/100 } }, }, @@ -57,7 +57,7 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba }, ticks: { font: { - size: !miniature? 16 : 10 + size: !miniature? window.innerWidth/80 : window.innerWidth/100 } }, }, diff --git a/src/components/graph/grossMensalChart/GrossMensalChart.tsx b/src/components/graph/grossMensalChart/GrossMensalChart.tsx index a0008b2..01bdafa 100644 --- a/src/components/graph/grossMensalChart/GrossMensalChart.tsx +++ b/src/components/graph/grossMensalChart/GrossMensalChart.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useEffect, useState } from 'react' import { Bar, Line, Chart as ChartJs } from 'react-chartjs-2'; import { @@ -44,11 +44,20 @@ interface ChartInterface { export default function GrossMensalChart({ title, data1, data2, label, subtitle, miniature }: ChartInterface) { function spacement(string) { const spaces = string.length===1?'' : string.length===2? '' : string.length===3? ' ' : string.length===4? ' ' : string.length===5? ' ' : '' - // const spaces = string.length===1?'' : string.length===2? '⠀⠀⠀⠀' : string.length===3? '⠀⠀⠀' : string.length===4? '⠀⠀' : string.length===5? '⠀' : '' - return spaces } + const [lastDataS, setLastData] = useState('') + useEffect(() => { + let lastData = '0' + let index=0 + while (index < data1.length) { + data1[index].dad_estimado? lastData=data1[index].economia_acumulada : null + index++ + setLastData(`economia acumulada: R$ ${parseFloat(lastData).toFixed(3)}`) + } + }, [data1]) + const options: any = { responsive: true, scales: { @@ -58,7 +67,7 @@ export default function GrossMensalChart({ title, data1, data2, label, subtitle, }, ticks: { font: { - size: !miniature? 16 : 10 + size: !miniature? window.innerWidth/80 : window.innerWidth/100 } }, }, @@ -68,7 +77,7 @@ export default function GrossMensalChart({ title, data1, data2, label, subtitle, }, ticks: { font: { - size: !miniature? 16 : 10 + size: !miniature? window.innerWidth/80 : window.innerWidth/100 } }, }, @@ -101,7 +110,7 @@ export default function GrossMensalChart({ title, data1, data2, label, subtitle, }, title: { display: true, - text: '', + text: '' }, }, }; diff --git a/src/components/header/Header.tsx b/src/components/header/Header.tsx index 67d549e..b18d9be 100644 --- a/src/components/header/Header.tsx +++ b/src/components/header/Header.tsx @@ -1,9 +1,6 @@ import React, { useContext, useEffect, useState } from 'react' import Image from 'next/image'; -import Avatar from '@mui/material/Avatar'; -import TextField from '@mui/material/TextField'; - import { HeaderView } from './HeaderView' import { parseCookies } from 'nookies'; import { GetServerSideProps } from 'next'; @@ -27,11 +24,13 @@ export default function Header({name, admin, children}: headerInterface) {
{ !admin && profile_picture? - +
+ +
: } -
+

olá, {name}

diff --git a/src/components/header/HeaderView.ts b/src/components/header/HeaderView.ts index cdf4923..e1603fe 100644 --- a/src/components/header/HeaderView.ts +++ b/src/components/header/HeaderView.ts @@ -30,6 +30,19 @@ export const HeaderView = styled.header` } } + .logoContainer { + display: flex; + align-items: center; + justify-content: center; + + width: 40%; + + img { + width: 100%; + height: auto; + } + } + section { display: flex; align-items: center; diff --git a/src/pages/chartTelemetry/index.tsx b/src/pages/chartTelemetry/index.tsx index 4fb2e4d..c918907 100644 --- a/src/pages/chartTelemetry/index.tsx +++ b/src/pages/chartTelemetry/index.tsx @@ -15,9 +15,6 @@ import DiscretizedConsumptionChartLine from '../../components/graph/DiscretizedC import { useRouter } from 'next/router' import { DemRegXDemConChart } from '../../components/graph/DemRegXDemConChart' import RenderIf from '../../utils/renderIf' -import { getPowerFactorData } from '../../services/charts/telemetry/getPowerFactor' -import { getDemand } from '../../services/charts/telemetry/getDemand' -import { getDiscretization } from '../../services/charts/telemetry/getDiscretization' export default function chartTelemetry({userName}) { const [fatorPotenciaData, setFatorPotenciaData] = useState([]); @@ -31,30 +28,10 @@ export default function chartTelemetry({userName}) { const {startDate, endDate, unity, discretization} = router.query - const { '@smartAuth-token': token } = parseCookies() - function getChartsData() { - console.log(token) // getPowerFactorData("PRAXCUENTR101P", "2022-01-01", "2022-01-31", "med_5min") // .then(result => setFatorPotenciaData(result)) // .catch(exception => console.log('exeption', exception)) - - // getDiscretization("PRAXCUENTR101P", "2022-01-01", "2022-01-31", "med_5min") - // .then(result => setDiscretizedConsumptionDataReativa(result)) - // .catch(exception => console.log(exception)) - - // getDiscretization("PRAXCUENTR101P", "2022-01-01", "2022-01-31", "med_5min") - // .then(result => setDiscretizedConsumptionData(result)) - // .catch(exception => console.log(exception)) - - // getDemand("PRAXCUENTR101P", "2022-01-01", "2022-01-31", "med_5min") - // .then(result => setDemRegXDemCon(result)) - // .catch(exception => console.log(exception)) - - // setFatorPotenciaData(res.data.data) - // setDiscretizedConsumptionDataReativa(res.data.data) - // setDiscretizedConsumptionData(res.data.data) - // setDemRegXDemCon(res.data.data) } useEffect(() => { diff --git a/src/pages/consumption/index.tsx b/src/pages/consumption/index.tsx deleted file mode 100644 index f5fc37c..0000000 --- a/src/pages/consumption/index.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { GetServerSideProps } from 'next' -import Head from 'next/head' -import { parseCookies } from 'nookies' -import React from 'react' -import Chart from '../../components/graph/Chart' -import Header from '../../components/header/Header' -import PageTitle from '../../components/pageTitle/PageTitle' -import { dataEconomiaIndicador } from '../../services/economiaIndicador' -import { ConsumptionView } from '../../styles/layouts/consumption/ConsumptionView' - -export default function Consumption({userName}: any) { - return ( - - - Smart Energia - Consumo - -
- -
- -
- - ) -} - -export const getServerSideProps: GetServerSideProps = async (ctx) => { - const { ['@smartAuth-token']: token } = parseCookies(ctx) - const { ['user-name']: userName } = parseCookies(ctx) - - if (!token) { - return { - redirect: { - destination: '/', - permanent: false - } - } - } - - return { - props: { - userName - } - } -} - diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx index 2e2e0b4..b18dc79 100644 --- a/src/pages/dashboard/index.tsx +++ b/src/pages/dashboard/index.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useEffect, useState } from 'react' import { DashboardView } from '../../styles/layouts/dashboard/DashboardView' @@ -7,26 +7,15 @@ import GraphCard from '../../components/graph/graphCard/ChartCard' import Header from '../../components/header/Header' import PageTitle from '../../components/pageTitle/PageTitle' import Link from 'next/link' -import LineChart from '../../components/graph/LineChart' -import { SingleBar } from '../../components/graph/SingleBar' -import { dataEconomiaBruta } from '../../services/economiaBruta' -import { dataEconomiaIndicador } from '../../services/economiaIndicador' -import { EconomiaAcumulada } from '../../services/economiaAcumulada' -import Chart from '../../components/graph/Chart' -import { LineBarChart } from '../../components/graph/LineBarChart' -import { LineBarChart2 } from '../../components/graph/LineBarChart2' -import { ConsumoEstimado } from '../../services/consumoEstimado' -import Head from 'next/head' -import recoverUserInformation from '../../services/auth' import { parseCookies } from 'nookies' import { GetServerSideProps } from 'next' import getAPIClient from '../../services/ssrApi' -import Chart2 from '../../components/graph/Chart2' import { GrossAnualChart } from '../../components/graph/grossAnualChart/GrossAnualChart' import CostIndicatorChart from '../../components/graph/costIndicatorChart' import { CativoXLivreChart } from '../../components/graph/cativoXLivreChart' import GrossMensalChart from '../../components/graph/grossMensalChart/GrossMensalChart' +import Head from 'next/head' export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensalGraph, grossMensalYears, acumulatedGraph, mapsInfo, userName, costIndicator} : any) { const months = [ @@ -44,6 +33,27 @@ export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensal 'Dez' ] + const [lastDataBrutaMensalS, setLastDataBrutaMensal] = useState('') + const [lastDataBrutaAnualS, setLastDataBrutaAnual] = useState('') + useEffect(() => { + let lastDataMensal = '0' + let lastDataAnual = '0' + let index=0 + while (index < grossMensalGraph.length) { + if (!grossMensalGraph[index].dad_estimado && grossMensalGraph[index].economia_acumulada!==null) + lastDataMensal=grossMensalGraph[index].economia_acumulada + index++ + } + setLastDataBrutaMensal(`economia acumulada: R$ ${parseFloat(lastDataMensal).toFixed(3)}`) + index=0 + while (index < grossAnualGraph.length) { + if (!grossAnualGraph[index].dad_estimado) + lastDataAnual=grossAnualGraph[index].economia_acumulada + index++ + } + setLastDataBrutaAnual(`economia acumulada: R$ ${parseFloat(lastDataAnual).toFixed(3)}`) + }, []) + return ( @@ -69,6 +79,7 @@ export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensal <>
+

{lastDataBrutaAnualS}

- value.mes)} - miniature - /> +

{lastDataBrutaMensalS}

+ value.mes)} + miniature + />
+ label={['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez']} title='' subtitle='' barLabel hashurado miniature/> diff --git a/src/pages/economy/index.tsx b/src/pages/economy/index.tsx index cda45d3..107f645 100644 --- a/src/pages/economy/index.tsx +++ b/src/pages/economy/index.tsx @@ -1,39 +1,26 @@ -import Fab from '@mui/material/Fab'; import FormControl from '@mui/material/FormControl'; import InputLabel from '@mui/material/InputLabel'; import MenuItem from '@mui/material/MenuItem'; -import Select, { SelectChangeEvent } from '@mui/material/Select'; +import Select from '@mui/material/Select'; import { GetServerSideProps } from 'next'; import Head from 'next/head'; -import Link from 'next/link'; import { parseCookies } from 'nookies'; import React, { useContext, useEffect, useState } from 'react' -import BasicButton from '../../components/buttons/basicButton/BasicButton'; -import { LineBarChart } from '../../components/graph/LineBarChart'; -import LineChart from '../../components/graph/LineChart'; import Header from '../../components/header/Header' import PageTitle from '../../components/pageTitle/PageTitle'; import { api } from '../../services/api'; -import { EvolucaoPld } from '../../services/evolucaoPld'; import getAPIClient from '../../services/ssrApi'; -import { GoBack, PldGraphView, PldTableView, TableHeader } from '../../styles/layouts/pld/PldView' +import { TableHeader } from '../../styles/layouts/pld/PldView' import RenderIf from '../../utils/renderIf' import Tabs from '@mui/material/Tabs'; import Tab from '@mui/material/Tab'; -import NavigationIcon from '@mui/icons-material/Navigation'; - -import TextField from '@mui/material/TextField'; -import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker'; -import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'; -import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; import { MenuContext } from '../../contexts/menu/MenuContext'; import { GrossAnualChart } from '../../components/graph/grossAnualChart/GrossAnualChart'; import GrossMensalChart from '../../components/graph/grossMensalChart/GrossMensalChart'; import { CativoXLivreChart } from '../../components/graph/cativoXLivreChart'; -import { ConsumoEstimado } from '../../services/consumoEstimado'; import CostIndicatorChart from '../../components/graph/costIndicatorChart'; import { EconomyView } from '../../styles/layouts/economy/economy'; @@ -60,6 +47,26 @@ export default function economy({userName, anual, years, brutaMensal, yearsBruta 'Dez' ] + const [lastDataBrutaMensalS, setLastDataBrutaMensal] = useState('') + useEffect(() => { + let lastData = '0' + let index=0 + if (economyMenu) { + while (index < brutaMensal.length) { + if (!brutaMensal[index].dad_estimado) + lastData=brutaMensal[index].economia_acumulada + index++ + } + } else { + while (index < anual.length) { + if (!anual[index].dad_estimado) + lastData=brutaMensal[index].economia_acumulada + index++ + } + } + setLastDataBrutaMensal(`economia acumulada: R$ ${parseFloat(lastData).toFixed(3)}`) + }, [economyMenu]) + useEffect(() => { api.post('/economy/estimates', unity!==''?{ "filters": [ @@ -67,21 +74,14 @@ export default function economy({userName, anual, years, brutaMensal, yearsBruta ] }:{}).then(res => { setCatLivDataState(res.data.data) - }).catch(res => { - // console.log(res) }) - }, [unity]) - useEffect(() => { api.post('/economy/MWh', unity!==''?{ "filters": [ {"type" : "=", "field":"dados_cadastrais.cod_smart_unidade", "value": unity!=="default"? null : unity} ] }:{}).then(res => { setIndicatorDataState(res.data.data) - console.log('res', res.data.data) - }).catch(res => { - // console.log(res) }) }, [unity]) @@ -103,18 +103,23 @@ export default function economy({userName, anual, years, brutaMensal, yearsBruta - { - economyMenu === 0? -

Economia Bruta Estimada e Acumulada Anual - Valores em R$ x mil

- : - economyMenu === 1? -

Economia Bruta Estimada e Acumulada Anual - Valores em R$ x mil

- : - economyMenu === 2? -

Comparativo de Custo Estimado - Valores em R$ x mil

- : -

Indicador de Custo - Valores em R$/MWh

- } +
+ { + economyMenu === 0 || economyMenu === 1? +

Economia Bruta Estimada e Acumulada Anual - Valores em R$ x mil

+ : + economyMenu === 2? +

Comparativo de Custo Estimado - Valores em R$ x mil

+ : +

Indicador de Custo - Valores em R$/MWh

+ } +

{ + economyMenu===0 || economyMenu===1? + lastDataBrutaMensalS + : + null + }

+
{ typeof window === 'undefined' || typeof window === undefined? null : <> @@ -165,7 +170,7 @@ export default function economy({userName, anual, years, brutaMensal, yearsBruta
+ label={['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez']} title='' subtitle='' barLabel hashurado/>
diff --git a/src/pages/estimatedCost/index.tsx b/src/pages/estimatedCost/index.tsx index 6dc3462..876547b 100644 --- a/src/pages/estimatedCost/index.tsx +++ b/src/pages/estimatedCost/index.tsx @@ -12,7 +12,6 @@ import Select from '@mui/material/Select'; import Header from '../../components/header/Header' import PageTitle from '../../components/pageTitle/PageTitle' -import { ConsumoEstimado } from '../../services/consumoEstimado' import getAPIClient from '../../services/ssrApi' import { EstimatedCostView } from '../../styles/layouts/economy/estimatedCost/EstimatedCostView' @@ -65,7 +64,7 @@ export default function EstimatedCost({graphData, userName, clients}: any) {
+ label={['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez']} title='' subtitle='' barLabel hashurado/>
) diff --git a/src/pages/grossSavings/index.tsx b/src/pages/grossSavings/index.tsx index 4b598ce..c3e1697 100644 --- a/src/pages/grossSavings/index.tsx +++ b/src/pages/grossSavings/index.tsx @@ -3,12 +3,9 @@ import Head from 'next/head' import { parseCookies } from 'nookies' import React from 'react' -import Chart from '../../components/graph/Chart' import { GrossAnualChart } from '../../components/graph/grossAnualChart/GrossAnualChart' -import { SingleBar } from '../../components/graph/SingleBar' import Header from '../../components/header/Header' import PageTitle from '../../components/pageTitle/PageTitle' -import { dataEconomiaBruta } from '../../services/economiaBruta' import getAPIClient from '../../services/ssrApi' import { GrossSavingsView } from '../../styles/layouts/economy/grossSavings/GrossSavings' diff --git a/src/pages/pld/index.tsx b/src/pages/pld/index.tsx index f6c967d..371e722 100644 --- a/src/pages/pld/index.tsx +++ b/src/pages/pld/index.tsx @@ -5,7 +5,6 @@ import MenuItem from '@mui/material/MenuItem'; import Select, { SelectChangeEvent } from '@mui/material/Select'; import { GetServerSideProps } from 'next'; import Head from 'next/head'; -import Link from 'next/link'; import { parseCookies } from 'nookies'; import React, { useContext, useEffect, useState } from 'react' @@ -15,9 +14,8 @@ import LineChart from '../../components/graph/LineChart'; import Header from '../../components/header/Header' import PageTitle from '../../components/pageTitle/PageTitle'; import { api } from '../../services/api'; -import { EvolucaoPld } from '../../services/evolucaoPld'; import getAPIClient from '../../services/ssrApi'; -import { GoBack, PldGraphView, PldTableMinMaxView, PldTableView, TableHeader } from '../../styles/layouts/pld/PldView' +import { PldGraphView, PldTableMinMaxView, PldTableView, TableHeader } from '../../styles/layouts/pld/PldView' import RenderIf from '../../utils/renderIf' import Tabs from '@mui/material/Tabs'; diff --git a/src/pages/resumoOperacao/index.tsx b/src/pages/resumoOperacao/index.tsx index d014a0f..2834f52 100644 --- a/src/pages/resumoOperacao/index.tsx +++ b/src/pages/resumoOperacao/index.tsx @@ -7,18 +7,13 @@ import { GetServerSideProps } from 'next'; import Head from 'next/head'; import { parseCookies } from 'nookies'; import React, { useEffect, useState } from 'react'; -// import Teste from '../files/teste.csv'; -import { CSVDownload, CSVLink } from "react-csv"; import BasicButton from '../../components/buttons/basicButton/BasicButton'; import Header from '../../components/header/Header'; import PageTitle from '../../components/pageTitle/PageTitle'; -import Sidebar from '../../components/sidebar/Sidebar'; import { api } from '../../services/api'; -// import { dados } from '../services/DadosTabelaResumoOperacao'; -import data from '../../services/dados.json' import getAPIClient from '../../services/ssrApi'; -import { Pagination, TableBodyView, TableHeader, TableView } from '../../styles/layouts/ResumoOperacao/ResumoOperacaoView'; +import { TableBodyView, TableHeader, TableView } from '../../styles/layouts/ResumoOperacao/ResumoOperacaoView'; import Fab from '@mui/material/Fab'; diff --git a/src/pages/telemetria/index.tsx b/src/pages/telemetria/index.tsx index 34c0ec7..b45e76f 100644 --- a/src/pages/telemetria/index.tsx +++ b/src/pages/telemetria/index.tsx @@ -45,7 +45,7 @@ export default function Telemetria({userName, clients}: any) { const [unity, setUnity] = useState(''); const [startDate, setStartDate] = useState(new Date()); const [endDate, setEndDate] = useState(new Date()); - const [discretization, setDiscretization] = useState(''); + const [discretization, setDiscretization] = useState('1_hora'); const [openSnackSuccess, setOpenSnackSuccess] = useState(false) const [openSnackError, setOpenSnackError] = useState(false) diff --git a/src/services/DadosTabelaResumoOperacao.js b/src/services/DadosTabelaResumoOperacao.js deleted file mode 100644 index 048904a..0000000 --- a/src/services/DadosTabelaResumoOperacao.js +++ /dev/null @@ -1,10 +0,0 @@ -// { -// "unidades": [ -// { "value": "unidade1", "name": "Unidade-1", "operacao": "Compra", "montante": "130,00", "contraparte": "cOPEL COM I5", "preco": "234,67", "valorNF": "38.257,15" }, -// { "value": "unidade2", "name": "Unidade-2", "operacao": "Compra", "montante": "20,00", "contraparte": "EMEWE I5", "preco": "234,67", "valorNF": "38.257,15"}, -// { "value": "unidade3", "name": "Unidade-3", "operacao": "Compra", "montante": "30,00", "contraparte": "EMEWE I5", "preco": "234,67", "valorNF": "38.257,15" }, -// { "value": "unidade4", "name": "Unidade-4", "operacao": "Compra", "montante": "40,00", "contraparte": "COPEL COM I5", "preco": "234,67", "valorNF": "38.257,15" }, -// { "value": "unidade5", "name": "Unidade-5", "operacao": "Compra", "montante": "500,00","contraparte": "COPEL COM I5", "preco": "234,67", "valorNF": "38.257,15" }, -// { "value": "unidade6", "name": "Unidade-6", "operacao": "Compra", "montante": "300,00", "contraparte": "COPEL COM I5", "preco":"234,67", "valorNF": "965,95" } -// ] -// } diff --git a/src/services/consumoDiscretizadoBar.js b/src/services/consumoDiscretizadoBar.js deleted file mode 100644 index 772f9f2..0000000 --- a/src/services/consumoDiscretizadoBar.js +++ /dev/null @@ -1,12 +0,0 @@ -export const ConsumoDecretizadoBar = { - data: - [1, 3, 4, 7, 10, 14, 17, 20, 23, 25, 28, 31, 34, 37, 40, 43, 46, 49, 53, 56, 58, 60, 63, 66, - 69, 72, 76, 79, 82, 86, 90, 93, 97, 103, 106, 109, 112, 116, 120, 124, 127, 130, 134, 138, 142, 145, 148, 152, - 155, 158, 161, 164, 168, 172, 176, 200, 203, 206, 209, 213, 217, 221, 223, 226, 229, 231, 234, 238, 240, 244, 248 - ], - - label: - ['0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', - '0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', - '0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22'] -} diff --git a/src/services/consumoDiscretizadoLine.js b/src/services/consumoDiscretizadoLine.js deleted file mode 100644 index 10b90fa..0000000 --- a/src/services/consumoDiscretizadoLine.js +++ /dev/null @@ -1,14 +0,0 @@ -export const ConsumoDecretizadoLine = { - data: [100, 120, 110, 130, 140, 130, 150, 300, 400, 410, 420, 430, 435, 440, 440, 420, 400, 420, 420, 415, 300, 280, 280, 200, - 100, 120, 110, 130, 140, 130, 150, 300, 400, 410, 420, 430, 435, 440, 440, 420, 400, 420, 420, 415, 300, 280, 280, 200, - 100, 120, 110, 130, 140, 130, 150, 300, 400, 410, 420, 430, 435, 440, 440, 420, 400, 420, 420, 415, 300, 280, 280, 200, - 100, 120, 110, 130, 140, 130, 150, 300, 400, 410, 420, 430, 435, 440, 440, 420, 400, 420, 420, 415, 300, 280, 280, 200,], - - data1: [600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 290, 290, 290, - 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 290, 290, 290, - 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 290, 290, 290,], - - label1:['0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '0', - '0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '0', - '0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '0', ] -} diff --git a/src/services/consumoEstimado.js b/src/services/consumoEstimado.js deleted file mode 100644 index 7b20bed..0000000 --- a/src/services/consumoEstimado.js +++ /dev/null @@ -1,6 +0,0 @@ -export const ConsumoEstimado = { - data: [245,202, 176, 150, 102, 138, 155, 177, 228, 161, 316, 335], - data1: [214, 167, 129, 114, 68, 99, 116, 129, 183, 93, 165, 164], - data2: [31, 35, 47, 37, 39, 39, 48, 45, 68, 151, 171], - label: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'] -} diff --git a/src/services/dados.json b/src/services/dados.json deleted file mode 100644 index d0c3dcc..0000000 --- a/src/services/dados.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "unidades": [ - { "value": "unidade1", "name": "Unidade-1", "operacao": "Compra", "montante": "130,00", "contraparte": "cOPEL COM I5", "preco": "234,67", "valorNF": "38.257,15" }, - { "value": "unidade2", "name": "Unidade-2", "operacao": "Compra", "montante": "20,00", "contraparte": "EMEWE I5", "preco": "234,67", "valorNF": "38.257,15"}, - { "value": "unidade3", "name": "Unidade-3", "operacao": "Compra", "montante": "30,00", "contraparte": "EMEWE I5", "preco": "234,67", "valorNF": "38.257,15" }, - { "value": "unidade4", "name": "Unidade-4", "operacao": "Compra", "montante": "40,00", "contraparte": "COPEL COM I5", "preco": "234,67", "valorNF": "38.257,15" }, - { "value": "unidade5", "name": "Unidade-5", "operacao": "Compra", "montante": "500,00","contraparte": "COPEL COM I5", "preco": "234,67", "valorNF": "38.257,15" }, - { "value": "unidade6", "name": "Unidade-6", "operacao": "Compra", "montante": "300,00", "contraparte": "COPEL COM I5", "preco":"234,67", "valorNF": "965,95" } - ] -} diff --git a/src/services/economiaAcumulada.js b/src/services/economiaAcumulada.js deleted file mode 100644 index 90a1b42..0000000 --- a/src/services/economiaAcumulada.js +++ /dev/null @@ -1,15 +0,0 @@ -export const EconomiaAcumulada = { - data : [872, 903, 938, 985, 1021, 1055, 1094, 1133, 1181, 1226, 1294], - data1 : [1445, 1615], - data2 : [872, 903, 938, 985, 1021, 1055, 1094, 1133, 1181, 1226, 1294, 872], - - data3: [9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9], - data4: [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6], - data5: [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], - data6: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], - - - label: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'ago', 'set', 'out', 'nov', 'dez'], - label1: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24'], - label3: ['0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8', '0', '2', '4', '6', '8',] -} diff --git a/src/services/economiaBruta.js b/src/services/economiaBruta.js deleted file mode 100644 index 2e1fe21..0000000 --- a/src/services/economiaBruta.js +++ /dev/null @@ -1,4 +0,0 @@ -export const dataEconomiaBruta = { - data: [872, 1615, 2196, 2930, 3838, 4814, 5700], - labels: ['2020', '2021', '2022', '2023', '2024', '2025', '2026'] -} diff --git a/src/services/economiaBruta.json b/src/services/economiaBruta.json deleted file mode 100644 index 1d881d7..0000000 --- a/src/services/economiaBruta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "consolidada": [], - "2020": [], - "2021": [], - "labels": [2020, 2021, 2022, 2023, 2024, 2025, 2026] -} diff --git a/src/services/economiaIndicador.js b/src/services/economiaIndicador.js deleted file mode 100644 index 23e4a8e..0000000 --- a/src/services/economiaIndicador.js +++ /dev/null @@ -1,5 +0,0 @@ -export const dataEconomiaIndicador = { - data1: [591, 552, 527, 1138, 529, 478, 456, 515, 526, 731, 890, 742], - data2: [714, 683, 547, 575, 660, 628, 699, 751, 819, 700], - labels: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'ago', 'set', 'out', 'nov', 'dez'] -} diff --git a/src/services/evolucaoPld.js b/src/services/evolucaoPld.js deleted file mode 100644 index 1a400d6..0000000 --- a/src/services/evolucaoPld.js +++ /dev/null @@ -1,8 +0,0 @@ -export const EvolucaoPld = { - data :[97.00, 98.00, 99.00, 100.00, 105.00, 113.00, 116.00, 120.00, 123.00, 120.00, 120.00, 118.00, 113.00, 101.00, 100.00, 98.00, - 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00], - - data1 :[97.00, 98.00, 99.00, 100.00, 105.00, 113.00, 116.00, 120.00, 123.00, 120.00, 120.00, 118.00, 113.00, 101.00, 100.00, 98.00, - 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00, 98.00], - label: ['1', '2', '3', '4', '5', '6', '7', '8', '8', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30'] -} diff --git a/src/services/fatorPotencia.js b/src/services/fatorPotencia.js deleted file mode 100644 index 02775fb..0000000 --- a/src/services/fatorPotencia.js +++ /dev/null @@ -1,8 +0,0 @@ -export const FatorPotencia = { - data : [1.00, 1.00, 1.00, -0.96, -0.96, 0.97, 0.98, 0.95, 0.94, 0.98, 0.95, 0.95, 0.98, 1.01, 1.05, 1.00, 1.00, 0.95, 0.97, 0.97, 0.97, 0.97, 0.97, 0.97, 0.98, 1.00, 0.97, 0.97, 0.97, 0.97, 0.97, 0.96, 0.95, 0.94, 0.95, 0.95,], - - data1 : [90, 90, 90, 90, 90, 90, 90, 90, 90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90 ,90, 90, 90], - data2 : [.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98,.98], - - label1: ['0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22'], -} diff --git a/src/styles/layouts/economy/economy.ts b/src/styles/layouts/economy/economy.ts index 38fe86f..faa5c0b 100644 --- a/src/styles/layouts/economy/economy.ts +++ b/src/styles/layouts/economy/economy.ts @@ -28,4 +28,19 @@ export const EconomyView = styled.main` .chartBox { } + + article { + display: flex; + align-items: center; + justify-content: space-between; + + p { + :first-child { + margin-left: '3%' + } + :last-child { + color: #254F7F; + } + } + } ` diff --git a/src/txt.txt b/src/txt.txt deleted file mode 100644 index e69de29..0000000