diff --git a/next.config.js b/next.config.js index 0adf626..b991d93 100644 --- a/next.config.js +++ b/next.config.js @@ -11,4 +11,3 @@ const nextConfig = { } module.exports = nextConfig - diff --git a/package.json b/package.json index ee05b14..f34f75a 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "@mui/material": "^5.6.4", "@mui/x-data-grid": "^5.11.0", "@mui/x-date-pickers": "^5.0.0-alpha.3", - "@react-pdf-viewer/core": "^3.5.0", "@tinymce/tinymce-react": "^4.1.0", "@types/react-csv": "^1.1.2", "@types/yup": "^0.29.14", diff --git a/public/assets/banners/newsBanner.webp b/public/assets/banners/newsBanner.webp new file mode 100644 index 0000000..3d0b41f Binary files /dev/null and b/public/assets/banners/newsBanner.webp differ diff --git a/src/components/buttons/gradientButton/GradientButtonView.ts b/src/components/buttons/gradientButton/GradientButtonView.ts index c324f99..5cf53c6 100644 --- a/src/components/buttons/gradientButton/GradientButtonView.ts +++ b/src/components/buttons/gradientButton/GradientButtonView.ts @@ -20,12 +20,12 @@ export const GradientButtonView = styled.button` color: #FFFFFF; background: ${ props => props.color==='orange'? - 'linear-gradient(200.86deg, #F48665 8.03%, #F48665 91.97%), #FFFFFF' + 'linear-gradient(200.86deg, #e7992f 8.03%, #e7992f 91.97%), #FFFFFF' : props.color === 'purple'? - 'linear-gradient(200.69deg, #9A56FF 9%, #D78AFD 98%), #FFFFFF' + 'linear-gradient(200.69deg, #254f7f 9%, #254f7f 98%), #FFFFFF' : - 'linear-gradient(200.69deg, #23BDB8 8.53%, #43E794 98%), #FFFFFF' + 'linear-gradient(200.69deg, #018a8a 8.53%, #018a8a 98%), #FFFFFF' }; box-shadow: 0.5px 3px 10px rgba(119, 119, 119, 0.1); @@ -50,7 +50,7 @@ export const GradientButtonView = styled.button` font-family: 'Poppins'; font-style: normal; font-weight: 700; - font-size: 12; + font-size: 11px; text-transform: uppercase; } diff --git a/src/components/graph/Chart.tsx b/src/components/graph/Chart.tsx index 0cc1958..7e4f656 100644 --- a/src/components/graph/Chart.tsx +++ b/src/components/graph/Chart.tsx @@ -35,20 +35,26 @@ interface ChartInterface { label: any, dataset1?: string, dataset2?: string, - barLabel?: boolean | undefined + miniature?: boolean | undefined } -export default function Chart({ title, data1, data2, label, subtitle, dataset1, dataset2, barLabel }: ChartInterface) { +export default function Chart({ title, data1, data2, label, subtitle, dataset1, dataset2, miniature }: ChartInterface) { const labels = label; const options: any = { responsive: true, + scales: { + yAxes: [{ + gridLines: { + color: "rgba(0, 0, 0, 0)", + } + }] + }, plugins: { datalabels: { display: true, color: (value, ctx) => { - console.log(value) return value.dataset.label==='2021'? 'black' : 'white' }, formatter: (value, ctx) => { @@ -57,7 +63,7 @@ export default function Chart({ title, data1, data2, label, subtitle, dataset1, dataArr.map(data => { sum += data; }); - const result = `${parseFloat(value).toLocaleString('pt-br')}` + const result = `${parseInt(value).toLocaleString('pt-br')}` return value==null? null : result }, @@ -66,12 +72,13 @@ export default function Chart({ title, data1, data2, label, subtitle, dataset1, align: "end", rotation: -90, font: { - size: 14, - weight: 800 + size: !miniature? 15 : 10, + weight: !miniature? 800 : 100 } }, legend: { position: 'bottom' as const, + }, title: { display: true, @@ -85,15 +92,14 @@ export default function Chart({ title, data1, data2, label, subtitle, dataset1, datasets: [ { label: dataset1? dataset1 : '2021', - data: data1.map(value => value.custo_unit? value.custo_unit : 0), + data: data1.map(value => value.custo_unit), backgroundColor: '#C2D5FB', }, - data2? { label: dataset2? dataset2 : '2022', - data: data2.map(value => value.custo_unit? value.custo_unit : 0), + data: data2.map(value => value.custo_unit), backgroundColor: '#255488', - } : null + } ], } diff --git a/src/components/graph/Chart2.tsx b/src/components/graph/Chart2.tsx new file mode 100644 index 0000000..5d5371c --- /dev/null +++ b/src/components/graph/Chart2.tsx @@ -0,0 +1,121 @@ +import React, { useState, useEffect } from 'react' + +import { Bar, Line } from 'react-chartjs-2'; +import { + Chart as ChartJS, + CategoryScale, + LinearScale, + BarElement, + Title, + Tooltip, + Legend +} from 'chart.js' + +import faker from 'faker' +import { ChartView } from './ChartView'; +import RenderIf from '../../utils/renderIf'; +import ChartTitle from './ChartTitle'; +// import { data } from './LineBarChart'; + +ChartJS.register( + CategoryScale, + LinearScale, + BarElement, + Title, + Tooltip, + Legend +) + +interface ChartInterface { + title: string, + subtitle: string, + data1: any, + data2: any, + single?: any + label: any, + dataset1?: string, + dataset2?: string, + miniature?: boolean | undefined +} + +export default function Chart({ title, data1, data2, label, subtitle, dataset1, dataset2, miniature }: ChartInterface) { + + const labels = label; + + const options: any = { + responsive: true, + scales: { + x: { + grid: { + display: false + } + }, + }, + plugins: { + datalabels: { + display: true, + color: (value, ctx) => { + return 'black' + }, + formatter: (value, ctx) => { + let sum = 0; + const dataArr = ctx.chart.data.datasets[0].data; + dataArr.map(data => { + sum += data; + }); + const percentage = (data1[ctx.dataIndex].econ_percentual*100).toFixed(0)+"%"; + const result = ` ${parseInt(value)!=0? parseInt(value).toLocaleString('pt-br') : ''}\n ${parseInt(value)!=0? percentage : ''}` + + return value==null? null : result + }, + anchor: "end", + offset: 0, + align: "end", + font: { + size: !miniature? 15 : 10, + } + }, + legend: { + position: 'bottom' as const, + + }, + title: { + display: true, + text: '', + }, + }, + }; + + const data = { + labels, + datasets: [ + { + label: dataset1? dataset1 : '2021', + data: data1.map(value => value.economia_acumulada? value.economia_acumulada : 0), + backgroundColor: '#255488', + }, + data2? + { + label: dataset2? dataset2 : '2022', + data: data2.map(value => value.economia_acumulada? value.economia_acumulada : 0), + backgroundColor: '#C2D5FB', + } : null + ], + } + + return ( + + {/* + + */} + + + + ) +} diff --git a/src/components/graph/DemRegXDemConChart.tsx b/src/components/graph/DemRegXDemConChart.tsx index 127909d..3ba52cf 100644 --- a/src/components/graph/DemRegXDemConChart.tsx +++ b/src/components/graph/DemRegXDemConChart.tsx @@ -80,9 +80,6 @@ export function DemRegXDemConChart({ data2, label, red, - dataset1, - dataset2, - dataset3, barLabel }: LineBarChartInterface) { const chartRef = useRef(null); @@ -126,13 +123,15 @@ export function DemRegXDemConChart({ '#f00' : '#0c9200', borderWidth: 2, fill: false, - data: data1.map(value => value.dem_cont), + borderDash: [5, 5], + data: data1?.map(value => value.dem_cont), + pointBorderColor: 'rgba(255, 145, 0, 0)', }, { type: 'bar' as const, label: 'Demanda Registrada', backgroundColor: '#255488', - data: data2.map(value => value.dem_reg), + data: data2?.map(value => value.dem_reg), }, ], }; diff --git a/src/components/graph/DiscretizedConsumptionChart.tsx b/src/components/graph/DiscretizedConsumptionChart.tsx index 210e868..90ed38c 100644 --- a/src/components/graph/DiscretizedConsumptionChart.tsx +++ b/src/components/graph/DiscretizedConsumptionChart.tsx @@ -48,7 +48,7 @@ export function DiscretizedConsumptionChart({ title, subtitle, dataProps, label, sum += data; }); const percentage = (dataProps[ctx.dataIndex].econ_percentual*100).toFixed(0)+"%"; - const result = `${parseFloat(value).toFixed(0)}\n ${percentage}` + const result = `${parseInt(value).toFixed(0)}\n ${percentage}` return value==null? null : result }, @@ -81,6 +81,24 @@ export function DiscretizedConsumptionChart({ title, subtitle, dataProps, label, data: dataProps.map(value => value.consumo), backgroundColor: '#255488' }, + { + type: 'line' as const, + label: 'base', + data: dataProps.map(value => 500), + borderColor: 'rgb(0, 0, 0)', + fill: false, + backgroundColor: 'rgb(0, 0, 0)' , + pointBorderColor: 'rgba(255, 145, 0, 0)', + }, + { + type: 'line' as const, + label: 'tolerância', + data: dataProps.map(value => 525), + borderColor: 'rgb(255, 0, 0)', + fill: false, + backgroundColor: 'rgb(255, 0, 0)' , + pointBorderColor: 'rgba(255, 145, 0, 0)', + }, ], } diff --git a/src/components/graph/DiscretizedConsumptionChartLine.tsx b/src/components/graph/DiscretizedConsumptionChartLine.tsx index 896a7dc..8b987cd 100644 --- a/src/components/graph/DiscretizedConsumptionChartLine.tsx +++ b/src/components/graph/DiscretizedConsumptionChartLine.tsx @@ -32,18 +32,13 @@ interface ChartInterface { title: string, subtitle: string, data1: any, - data2?: any, - data3?: any, - data4?: any, label: any, dataset1?: string, - dataset2?: string, - dataset3?: string, - dataset4?: string, + barLabel?: boolean | undefined } -export default function DiscretizedConsumptionChartLine({ title, subtitle, data1, data2, data3, data4, label, dataset1, dataset2, dataset3, dataset4, barLabel }: ChartInterface) { +export default function DiscretizedConsumptionChartLine({ title, subtitle, data1, label, dataset1, barLabel }: ChartInterface) { const options: any = { responsive: true, plugins: { @@ -71,7 +66,7 @@ export default function DiscretizedConsumptionChartLine({ title, subtitle, data1 const labels = label; const data = { - labels, + labels: labels.map((value, index) => `${value} - ${data1[index].day_formatted}`), datasets: [ { label: dataset1, @@ -79,6 +74,22 @@ export default function DiscretizedConsumptionChartLine({ title, subtitle, data1 borderColor: 'rgb(53, 162, 235)', backgroundColor: 'rgba(53, 162, 235, 0)', }, + { + label: 'base', + data: data1.map(value => 500), + borderColor: 'rgb(0, 0, 0)', + fill: false, + backgroundColor: 'rgba(255, 145, 0, 0)' , + pointBorderColor: 'rgba(255, 145, 0, 0)', + }, + { + label: 'tolerância', + data: data1.map(value => 525), + borderColor: 'rgb(255, 0, 0)', + fill: false, + backgroundColor: 'rgba(255, 145, 0, 0)' , + pointBorderColor: 'rgba(255, 145, 0, 0)', + }, ], } diff --git a/src/components/graph/LineBarChart.tsx b/src/components/graph/LineBarChart.tsx index 83bbb2f..17363e7 100644 --- a/src/components/graph/LineBarChart.tsx +++ b/src/components/graph/LineBarChart.tsx @@ -84,6 +84,13 @@ export function LineBarChart({ title, subtitle, data1, data2, data3, label, red, const options: any = { responsive: true, + scales: { + x: { + grid: { + display: false + } + }, + }, plugins: { datalabels: { display: true, diff --git a/src/components/graph/LineBarChart2.tsx b/src/components/graph/LineBarChart2.tsx index ad9efea..8f235d7 100644 --- a/src/components/graph/LineBarChart2.tsx +++ b/src/components/graph/LineBarChart2.tsx @@ -71,17 +71,23 @@ interface LineBarChartInterface { dataset3?: string, barLabel?: boolean | undefined, hashurado?: boolean | undefined, + miniature?: boolean | undefined, } -export function LineBarChart2({ title, subtitle, data1, data2, data3, label, red, dataset1, dataset2, dataset3, barLabel, hashurado }: LineBarChartInterface) { +export function LineBarChart2({ title, subtitle, data1, data2, data3, label, red, dataset1, dataset2, dataset3, barLabel, hashurado, miniature }: LineBarChartInterface) { const chartRef = useRef(null); - const currentTime = new Date(); - const labels = label const options: any = { responsive: true, + scales: { + x: { + grid: { + display: false + } + }, + }, plugins: { datalabels: { display: true, @@ -91,7 +97,7 @@ export function LineBarChart2({ title, subtitle, data1, data2, data3, label, red offset: -20, align: "start", font: { - size: 12 + size: !miniature? 15 : 10 }, formatter: (value, ctx) => { let sum = 0; @@ -99,7 +105,7 @@ export function LineBarChart2({ title, subtitle, data1, data2, data3, label, red dataArr.map(data => { sum += data; }); - const result = `${parseFloat(value).toLocaleString('pt-br')}` + const result = `${parseInt(value).toLocaleString('pt-br')}` return value==null? null : result } diff --git a/src/components/graph/LineChart.tsx b/src/components/graph/LineChart.tsx index 79ffd31..1862a66 100644 --- a/src/components/graph/LineChart.tsx +++ b/src/components/graph/LineChart.tsx @@ -46,6 +46,13 @@ interface ChartInterface { export default function LineChart({ title, subtitle, data1, data2, data3, data4, label, dataset1, dataset2, dataset3, dataset4, barLabel }: ChartInterface) { const options: any = { responsive: true, + scales: { + x: { + grid: { + display: false + } + }, + }, plugins: { datalabels: { display: true, diff --git a/src/components/graph/SingleBar.tsx b/src/components/graph/SingleBar.tsx index f090179..5fe0cb7 100644 --- a/src/components/graph/SingleBar.tsx +++ b/src/components/graph/SingleBar.tsx @@ -24,12 +24,19 @@ interface SingleBarInterface{ label: Array, dataset: string, barLabel?: boolean | undefined, - brutoAnual?: boolean | undefined, + miniature?: boolean | undefined, } -export function SingleBar({ title, subtitle, dataProps, label, dataset, barLabel, brutoAnual }: SingleBarInterface) { +export function SingleBar({ title, subtitle, dataProps, label, dataset, barLabel, miniature }: SingleBarInterface) { const options: object = { responsive: true, + scales: { + x: { + grid: { + display: false + } + }, + }, series: { downsample: { threshold: 1000 @@ -44,7 +51,7 @@ export function SingleBar({ title, subtitle, dataProps, label, dataset, barLabel sum += data; }); const percentage = (dataProps[ctx.dataIndex].econ_percentual*100).toFixed(0)+"%"; - const result = `${parseFloat(value).toLocaleString('pt-br')}\n ${percentage}` + const result = ` ${parseInt(value).toLocaleString('pt-br')}\n ${percentage}` return value==null? null : result }, @@ -54,11 +61,16 @@ export function SingleBar({ title, subtitle, dataProps, label, dataset, barLabel offset: -40, align: "start", font: { - size: 12 + size: !miniature? 15 : 10 } }, legend: { position: 'bottom' as const, + labels: { + font: { + size: 16 + } + } }, title: { display: false, diff --git a/src/components/graph/fatorPotenciaChart.tsx b/src/components/graph/fatorPotenciaChart.tsx index ce5af02..986c5b0 100644 --- a/src/components/graph/fatorPotenciaChart.tsx +++ b/src/components/graph/fatorPotenciaChart.tsx @@ -83,7 +83,10 @@ export default function FatorPotenciaChart({ title, subtitle, data1, data2, labe label: dataset2? dataset2 : '', data: data2.map(value => value.f_ref), borderColor: 'rgb(0, 0, 0)' , + fill: false, + borderDash: [5, 5], backgroundColor: 'rgba(255, 145, 0, 0)' , + pointBorderColor: 'rgba(255, 145, 0, 0)', }, ], } diff --git a/src/components/header/Header.tsx b/src/components/header/Header.tsx index 0023023..97819e8 100644 --- a/src/components/header/Header.tsx +++ b/src/components/header/Header.tsx @@ -13,24 +13,30 @@ interface headerInterface { name: string, admin?: boolean | undefined logo?: string + children?: React.ReactNode } -export default function Header({name, admin}: headerInterface) { +export default function Header({name, admin, children}: headerInterface) { const { ['user-profile_picture']: profile_picture } = parseCookies() return ( -
-

- olá, {name} -

-
- { - !admin && profile_picture? - - : - - } +
+ {children} +
+
+
+

+ olá, {name} +

+
+ { + !admin && profile_picture? + + : + + } +
) } diff --git a/src/components/header/HeaderView.ts b/src/components/header/HeaderView.ts index c612183..0e39fd4 100644 --- a/src/components/header/HeaderView.ts +++ b/src/components/header/HeaderView.ts @@ -2,7 +2,7 @@ import styled from "styled-components"; export const HeaderView = styled.header` display: flex; - justify-content: flex-end; + justify-content: space-between; width: 100%; @@ -29,4 +29,16 @@ export const HeaderView = styled.header` white-space: nowrap; } } + + section { + display: flex; + align-items: center; + justify-content: center; + + :first-child { + align-items: flex-start; + justify-content: flex-start; + flex-direction: column; + } + } ` diff --git a/src/components/sidebar/Sidebar.tsx b/src/components/sidebar/Sidebar.tsx index 696ecde..1fbac26 100644 --- a/src/components/sidebar/Sidebar.tsx +++ b/src/components/sidebar/Sidebar.tsx @@ -49,7 +49,9 @@ export default function Sidebar() { useEffect(() => { api.post('/notify').then(res => { setNotificationsCount(res.data) - }).catch(res => console.log(res)) + }).catch(res => { + // console.log(res) + }) }, []) return ( @@ -94,10 +96,10 @@ export default function Sidebar() {
setViewModal(!viewModal)} > - +
- +
  • {'Visão Geral'}
  • @@ -105,7 +107,7 @@ export default function Sidebar() {
  • Economia Bruta Anual
  • Economia Bruta Mensal
  • -
  • Cativo x Livre mensal
  • +
  • Cativo x Livre Mensal
  • Custo R$/MWh
  • {'Telemetria >'}
  • diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 70523a6..ccc4377 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -24,11 +24,8 @@ export function MyApp({ Component, pageProps, notificationsCount }: AppProps | a const router = useRouter() const rota = router.pathname - console.log('notifications: ', notificationsCount) - useEffect(() => { const handleStart = (url) => { - console.log(`Loading: ${url}`) NProgress.start() } const handleStop = () => { @@ -80,8 +77,10 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { let notificationsCount await apiClient.post('/download').then(res => { - console.log(res) - }).catch(res => console.log(res)) + // console.log(res) + }).catch(res => { + // console.log(res) + }) if (!token) { return { diff --git a/src/pages/aboutUs/index.tsx b/src/pages/aboutUs/index.tsx index 2e8732e..8269c76 100644 --- a/src/pages/aboutUs/index.tsx +++ b/src/pages/aboutUs/index.tsx @@ -15,7 +15,7 @@ export default function aboutUs({userName, text}) { Smart Energia - About Us - {/*
    */} +
    @@ -42,7 +42,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { await apiClient.get('/aboutUs').then(res => { text = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) if (!token) { diff --git a/src/pages/accumulatedSavings/index.tsx b/src/pages/accumulatedSavings/index.tsx index 611a3a0..9f91925 100644 --- a/src/pages/accumulatedSavings/index.tsx +++ b/src/pages/accumulatedSavings/index.tsx @@ -3,27 +3,45 @@ import Head from 'next/head' import { parseCookies } from 'nookies' import React from 'react' -import Chart from '../../components/graph/Chart' -import { SingleBar } from '../../components/graph/SingleBar' +import Chart2 from '../../components/graph/Chart2' import Header from '../../components/header/Header' import PageTitle from '../../components/pageTitle/PageTitle' -import { EconomiaAcumulada } from '../../services/economiaAcumulada' -import { dataEconomiaBruta } from '../../services/economiaBruta' + import getAPIClient from '../../services/ssrApi' import { AccumulatedSavingsView } from '../../styles/layouts/economy/accumulatedSavings/AccumulatedSavingsView' export default function AccumulatedSavings({graphData, years, userName}: any) { + const months = [ + 'Jan', + 'Fev', + 'Mar', + 'Abr', + 'Mai', + 'Jun', + 'Jul', + 'Ago', + 'Set', + 'Out', + 'Nov', + 'Dez' + ] + return ( Smart Energia - Economia Bruta Mensal -
    - +
    + +
    - value.mes.slice(3, 8).includes('2021'))} + data2={graphData.filter((value, index) => value.mes.slice(3, 8).includes('2022'))} + label={months}/> + {/* + label={years} barLabel/> */}
    ) @@ -40,7 +58,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { graphData = res.data.data // console.log(graphData[0].mes) }).catch(res => { - console.log(res) + // console.log(res) }) const years = graphData.map((value) => value.mes) diff --git a/src/pages/administrative/general.tsx b/src/pages/administrative/general.tsx index 8a8d62b..9442afa 100644 --- a/src/pages/administrative/general.tsx +++ b/src/pages/administrative/general.tsx @@ -26,14 +26,6 @@ export default function index({userName, initialText}: any) { const [openSnackSuccess, setOpenSnackSuccess] = useState(false) const [openSnackError, setOpenSnackError] = useState(false) - console.log(initialText) - - const log = () => { - if (editorRef.current) { - console.log(editorRef.current.getContent()); - } - }; - const handleChange = (event: SelectChangeEvent) => { setText(event.target.value); }; @@ -95,7 +87,6 @@ export default function index({userName, initialText}: any) {
    editorRef.current = editor} - onChange={value => console.log(value)} onEditorChange={(newText) => setText(newText)} initialValue={initialText[0].about} init={{ @@ -127,9 +118,9 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { await apiClient.get('/aboutUs').then(res => { initialText = res.data.data - console.log(res.data.data) + // console.log(res.data.data) }).catch(res => { - console.log(res) + // console.log(res) }) if (!token) { diff --git a/src/pages/administrative/industryInfo/index.tsx b/src/pages/administrative/industryInfo/index.tsx index e7531bf..f83d127 100644 --- a/src/pages/administrative/industryInfo/index.tsx +++ b/src/pages/administrative/industryInfo/index.tsx @@ -1,7 +1,7 @@ import { GetServerSideProps } from 'next' import Head from 'next/head' import { parseCookies } from 'nookies' -import React, { useState } from 'react' +import React, { useEffect, useState } from 'react' import BasicButton from '../../../components/buttons/basicButton/BasicButton' import Header from '../../../components/header/Header' import PageTitle from '../../../components/pageTitle/PageTitle' @@ -19,13 +19,13 @@ const Alert = React.forwardRef(function Alert( return ; }); -export default function industryInfo({userName}: any) { +export default function industryInfo({userName, pdfUrl}: any) { const formData = new FormData(); const [pdf, setPdf] = useState(); function onChange(e) { + console.log(e.target.files) setPdf(e.target.files[0]) - console.log(pdf) } const [openSnackSuccess, setOpenSnackSuccess] = useState(false); @@ -75,6 +75,14 @@ export default function industryInfo({userName}: any) { handleCreateClient()} title='Atualizar'/> + window.open(pdfUrl)} title='Visualizar arquivo mais recente'/> + console.log('')} title='Excluir último arquivo enviado'/> + + {/* */} ) @@ -84,6 +92,14 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { const { ['@smartAuth-token']: token } = parseCookies(ctx) const { ['user-name']: userName } = parseCookies(ctx) + let pdfUrl=[] + + api.get('/download').then(res => { + pdfUrl = res.data.path + }).catch(res => { + console.log(res) + }) + if (!token) { return { redirect: { @@ -95,7 +111,8 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { return { props: { - userName + userName, + pdfUrl } } } diff --git a/src/pages/administrative/notification/index.tsx b/src/pages/administrative/notification/index.tsx index 234ea9f..92a57aa 100644 --- a/src/pages/administrative/notification/index.tsx +++ b/src/pages/administrative/notification/index.tsx @@ -105,7 +105,10 @@ export default function notification({clients, notifications, userName}: any) { title, body, users - }).then(res => setOpenSnackSuccess(true)).catch(res => setOpenSnackError(true)) + }).then(res => { + setOpenSnackSuccess(true) + window.location.reload() + }).catch(res => setOpenSnackError(true)) } async function handleDeleteNotification(id: any) { await id.map((value) => { diff --git a/src/pages/chartTelemetry/index.tsx b/src/pages/chartTelemetry/index.tsx index 2f50d66..7d1373c 100644 --- a/src/pages/chartTelemetry/index.tsx +++ b/src/pages/chartTelemetry/index.tsx @@ -26,6 +26,7 @@ import { DiscretizedConsumptionChart } from '../../components/graph/DiscretizedC import DiscretizedConsumptionChartLine from '../../components/graph/DiscretizedConsumptionChartLine' import router, { useRouter } from 'next/router' import { DemRegXDemConChart } from '../../components/graph/DemRegXDemConChart' +import RenderIf from '../../utils/renderIf' const style = { display: 'flex', @@ -65,16 +66,17 @@ export default function chartTelemetry({userName}) { const {startDate, endDate, unity, discretization} = router.query async function getChartsData() { - console.log(router.query) await api.post('/telemetry/powerFactor', { "filters": [ - {"type" : "=", "field": "med_5min.ponto", "value": unity}, - {"type" : "between", "field": "dia_num", "value": [startDate, endDate]} + {"type" : "=", "field": "med_5min.ponto", "value": "RSZFNAENTR101P"}, + {"type" : "between", "field": "dia_num", "value": ["2022-04-01", "2022-04-28"]} ] - }).then(res => { + }).then(res => { + console.log(res.data.data) setFatorPotenciaData(res.data.data) }).catch(res => { - console.log(res) + // console.log(res) + router.push('/telemetria') }) await api.post('/telemetry/discretization', { @@ -86,7 +88,8 @@ export default function chartTelemetry({userName}) { }).then(res => { setDiscretizedConsumptionDataReativa(res.data.data) }).catch(res => { - console.log(res) + // console.log(res) + router.push('/telemetria') }) await api.post('/telemetry/discretization', { @@ -98,7 +101,8 @@ export default function chartTelemetry({userName}) { }).then(res => { setDiscretizedConsumptionData(res.data.data) }).catch(res => { - console.log(res) + // console.log(res) + router.push('/telemetria') }) await api.post('/telemetry/demand', { @@ -109,13 +113,13 @@ export default function chartTelemetry({userName}) { }).then(res => { setDemRegXDemCon(res.data.data) }).catch(res => { - console.log(res) + // console.log(res) + router.push('/telemetria') }) } useEffect(() => { getChartsData() - console.log(fatorPotenciaData) }, []) return ( @@ -137,27 +141,14 @@ export default function chartTelemetry({userName}) { : <> -
    setOpenFatorPotencia(true)}> - -
    - - - - - +
    setOpenConsumoDiscretizado1(true)}> parseFloat(data.reativa).toFixed(3))} /> + } subtitle='' data1={discretizedConsumptionDataReativa} dataset1='Demanda registrada' + label={discretizedConsumptionDataReativa.map(data => parseFloat(data.reativa).toFixed(3))} />
    value.minut)} dataset={'Consumo'} dataset1='Estimado' month/> +

    {`Mês - ${startDate.toString().split('-')[2]}/${startDate.toString().split('-')[1]}/${startDate.toString().split('-')[0]}`}

    value.minut)} dataset={'Consumo'} dataset1='Estimado' month/> +
    setOpenDemandaContratada(true)}> value.hora)} title='Demanda Contratada X Registrada' subtitle='' red/> @@ -206,6 +199,22 @@ export default function chartTelemetry({userName}) { value.hora)} title='Demanda Contratada X Registrada' subtitle='' red/> + +
    setOpenFatorPotencia(true)}> + parseFloat(value.dia_num))} /> +
    + + + parseFloat(value.dia_num))} /> + + }
    @@ -220,21 +229,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { const { ['user-name']: userName } = parseCookies(ctx) const { ['user-cod_client']: cod_client } = parseCookies(ctx) - const fatorPotenciaChart = [] - - console.log('olha os query ai', ctx.query) - - // await apiClient.post('/telemetry/powerFactor', { - // "filters": [ - // {"type" : "=", "field": "med_5min.ponto", "value": cod_client}, - // {"type" : "between", "field": "dia_num", "value": ["2022-01-03", "2022-01-03"]} - // ] - // }).then(res => { - // fatorPotenciaChart = res.data - // }).catch(res => { - // console.log(res) - // }) - if (!token) { return { redirect: { @@ -247,7 +241,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { return { props: { userName, - fatorPotenciaChart } } } diff --git a/src/pages/costIndicator/index.tsx b/src/pages/costIndicator/index.tsx index 6119298..27c6a87 100644 --- a/src/pages/costIndicator/index.tsx +++ b/src/pages/costIndicator/index.tsx @@ -30,14 +30,15 @@ export default function CostIndicator({graphData, userName}: any) { Smart Energia - Indicador de Custos -
    - +
    + +
    value.mes.slice(4, 8).includes('2021'))} // data1={graphData} data2={graphData.filter((value, index) => value.mes.slice(4, 8).includes('2022'))} - label={graphData.map(value => value.mes.slice(0, 3))} barLabel /> + label={months}/>
    ) @@ -53,7 +54,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { await apiClient.post('/economy/MWh').then(res => { graphData = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) if (!token) { diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx index d9d2ead..3330e01 100644 --- a/src/pages/dashboard/index.tsx +++ b/src/pages/dashboard/index.tsx @@ -22,16 +22,33 @@ import recoverUserInformation from '../../services/auth' import { parseCookies } from 'nookies' import { GetServerSideProps } from 'next' import getAPIClient from '../../services/ssrApi' +import Chart2 from '../../components/graph/Chart2' export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensalGraph, grossMensalYears, acumulatedGraph, mapsInfo, userName, costIndicator} : any) { + const months = [ + 'Jan', + 'Fev', + 'Mar', + 'Abr', + 'Mai', + 'Jun', + 'Jul', + 'Ago', + 'Set', + 'Out', + 'Nov', + 'Dez' + ] + return ( Smart Energia - Dashboard -
    +
    + +
    -
    @@ -44,25 +61,24 @@ export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensal
    - + + label={grossAnualYears} barLabel miniature/> - - + + value.mes.slice(3, 8).includes('2021'))} + data2={grossMensalGraph.filter((value, index) => value.mes.slice(3, 8).includes('2022'))} + label={months} miniature/> - + + title='' subtitle='' barLabel hashurado miniature/> @@ -70,7 +86,7 @@ export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensal data1={costIndicator.filter((value, index) => value.mes.slice(4, 8).includes('2021'))} // data1={graphData} data2={costIndicator.filter((value, index) => value.mes.slice(4, 8).includes('2022'))} - label={costIndicator.map(value => value.mes.slice(0, 3))} barLabel /> + label={costIndicator.map(value => value.mes.slice(0, 3))} miniature/>
    @@ -91,31 +107,31 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { await apiClient.post('/economy/grossAnnual').then(res => { grossAnualGraph = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) await apiClient.post('/economy/grossMonthly').then(res => { grossMensalGraph = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) await apiClient.post('/economy/estimates').then(res => { acumulatedGraph = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) await apiClient.post('/economy/MWh').then(res => { costIndicator = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) await apiClient.post('/pld/overview').then(res => { mapsInfo = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) const grossMensalYears = grossMensalGraph.map((value) => value.mes) diff --git a/src/pages/estimatedCost/index.tsx b/src/pages/estimatedCost/index.tsx index 50ab7aa..8234338 100644 --- a/src/pages/estimatedCost/index.tsx +++ b/src/pages/estimatedCost/index.tsx @@ -18,8 +18,9 @@ export default function EstimatedCost({graphData, userName}: any) { Smart Energia - Custos Estimados -
    - +
    + +
    { await apiClient.post('/economy/estimates').then(res => { graphData = res.data.data - console.log(graphData) }).catch(res => { - console.log(res) + // console.log(res) }) if (!token) { diff --git a/src/pages/faq/index.tsx b/src/pages/faq/index.tsx index edce73a..7b90f55 100644 --- a/src/pages/faq/index.tsx +++ b/src/pages/faq/index.tsx @@ -16,10 +16,9 @@ export default function commonQuestions({faqData, userName}) { Smart Energia - FAQ -
    - - {/*

    Perguntas Frequentes

    -

    Aqui estão algumas das perguntas que mais recebemos!

    */} +
    + +
    { faqData.map((value, index ) => { diff --git a/src/pages/grossSavings/index.tsx b/src/pages/grossSavings/index.tsx index aa0df7a..820d20e 100644 --- a/src/pages/grossSavings/index.tsx +++ b/src/pages/grossSavings/index.tsx @@ -18,8 +18,9 @@ export default function GrossSavings({graphData, years, userName}: any) { Smart Energia - Economia Acumulada -
    - +
    + +
    { graphData = res.data.data // console.log(graphData[0]) }).catch(res => { - console.log(res) + // console.log(res) }) const years = graphData.map((value) => value.ano) - console.log(years) if (!token) { return { redirect: { diff --git a/src/pages/index.tsx b/src/pages/index.tsx index d25b0a3..1ade32b 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -8,7 +8,7 @@ import Head from 'next/head'; import Image from 'next/image'; import Link from 'next/link'; import { useRouter } from 'next/router' -import React, { useContext, useState, useEffect,useCallback } from 'react' +import React, { useContext, useState, useEffect,useCallback, useRef } from 'react' import { AiOutlineEye, AiOutlineEyeInvisible } from 'react-icons/ai'; import RenderIf from '../utils/renderIf'; import Snackbar from '@mui/material/Snackbar'; @@ -30,10 +30,11 @@ const Alert = React.forwardRef(function Alert( export default function Home() { const [openSnackSuccess, setOpenSnackSuccess] = useState(false); const [openSnackError, setOpenSnackError] = useState(false); - const [openSnackSuccessDelete, setOpenSnackSuccessDelete] = useState(false); - const [openSnackErrorDelete, setOpenSnackErrorDelete] = useState(false); + + const field = useRef(null) const [state, setstate] = useState(false); + const [focus, setFocus] = useState('email'); const [values, setValues] = useState({ password: null, @@ -75,7 +76,7 @@ export default function Home() { } }) } catch (exception){ - console.log(exception) + // console.log(exception) } } } @@ -123,17 +124,19 @@ export default function Home() { e.key==='Enter'? console.log(field.current.children[0].focus()) : null} onChange={value => { setEmail(value.target.value.toLowerCase()) }}/> - Senha + Senha e.key==='Enter'? handleSignIn() : null} endAdornment={ { window.open(res.data.path); - console.log(res.data); setOpenSnackSuccess(true) }).catch(res => { - console.log(res) setOpenSnackError(true) }) } @@ -59,11 +57,13 @@ export default function industryInfo({userName}: any) { Smart Energia - Info de Setor -
    -
    +
    -
    +
    + + +

    Um resumo das atualizações gerais do Setor Elétrico, com dados sobre geração consumo, demanda, meteorologia baseadas em informações do ONS, CCEE, ANEEL, 10 Maiores Jornais e Revistas e CPTEC

    ) } diff --git a/src/pages/news/index.tsx b/src/pages/news/index.tsx index 7d0e490..e2700eb 100644 --- a/src/pages/news/index.tsx +++ b/src/pages/news/index.tsx @@ -13,18 +13,16 @@ import getAPIClient from '../../services/ssrApi'; import { Button, NewsView } from '../../styles/layouts/news/NewsView' export default function aboutUs({userName, news}: any) { - console.log(news.channel.item) - return ( Smart Energia - Noticias - {/*
    */} - +
    + { - news.channel.item.map(data => { + news.map(data => { return <>
    @@ -63,7 +61,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { await apiClient.get('/news').then(res => { news = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) if (!token) { diff --git a/src/pages/notifications/index.tsx b/src/pages/notifications/index.tsx index c41629a..d9518e1 100644 --- a/src/pages/notifications/index.tsx +++ b/src/pages/notifications/index.tsx @@ -15,11 +15,12 @@ export default function Notifications({notificationData, userName}: any) { Smart Energia - Notificações -
    - +
    + +
    { - notificationData? + notificationData.length!=0? notificationData.map((value, index ) => { return <> @@ -42,10 +43,9 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { let notificationData = []; await apiClient.get('/notification').then(res => { - console.log(res) notificationData = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) if (!token) { diff --git a/src/pages/pld/index.tsx b/src/pages/pld/index.tsx index e62375c..53f707d 100644 --- a/src/pages/pld/index.tsx +++ b/src/pages/pld/index.tsx @@ -30,11 +30,12 @@ interface pldInterface { clientMonth: any } -export default function pld({tableData, graphByHourData, graphByMonthData, userName, clientMonth}: pldInterface) { - const router = useRouter() - const { region } = router.query +export default function pld({tableData, userName, clientMonth}: pldInterface) { + const dateFormated = new Date() - const [date, setDate] = useState(''); + const year_Month = `0${dateFormated.getMonth()}/${dateFormated.getFullYear()}` + + const [date, setDate] = useState(`${dateFormated.getFullYear()}-${dateFormated.getUTCMonth()+1}-${dateFormated.getUTCDate()}`); const [select, setSelect] = useState('NORDESTE'); const [page, setPage] = useState('table') const [day, setDay] = useState(null) @@ -64,7 +65,9 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN "order": [{ "field": "day_calc", "direction": "asc" }] }).then(res => { setDataByDay(res.data.data) - }).catch(exception => console.log(exception)) + }).catch(exception => { + console.log(exception) + }) } function getDataByHour() { @@ -78,7 +81,9 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN "order": [{ "field": "hour", "direction": "asc" }] }).then(res => { setSul(res.data.data) - }).catch(exception => console.log(exception)) + }).catch(exception => { + // console.log(exception) + }) api.post('/pld/schedule', { "limit": 20, @@ -90,7 +95,9 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN "order": [{ "field": "hour", "direction": "asc" }] }).then(res => { setSudeste(res.data.data) - }).catch(exception => console.log(exception)) + }).catch(exception => { + // console.log(exception) + }) api.post('/pld/schedule', { "limit": 20, @@ -102,7 +109,9 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN "order": [{ "field": "hour", "direction": "asc" }] }).then(res => { setNorte(res.data.data) - }).catch(exception => console.log(exception)) + }).catch(exception => { + // console.log(exception) + }) api.post('/pld/schedule', { "limit": 20, @@ -114,7 +123,9 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN "order": [{ "field": "hour", "direction": "asc" }] }).then(res => { setNordeste(res.data.data) - }).catch(exception => console.log(exception)) + }).catch(exception => { + // console.log(exception) + }) } function handleColorNorte(value, region) { @@ -128,8 +139,6 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN return 'dullRed' } - const dateFormated = new Date() - function downloadCSVFile(csv, filename) { const csv_file = new Blob(["\ufeff",csv], {type: "text/csv"}); @@ -166,7 +175,6 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN useEffect(() => { getDataByHour() getDataByDay() - console.log(dataByDay) }, [date, day, select]) return ( @@ -176,10 +184,11 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN Smart Energia - PLD -
    - {'< Voltar para Visão Geral'} - +
    + {'< Voltar para Visão Geral'} + +
    @@ -200,7 +209,7 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN return 0 }).map(data => { return <> - + @@ -331,7 +340,6 @@ export default function pld({tableData, graphByHourData, graphByMonthData, userN
    setDate(value.target.value)}/> - {/* console.log()}/> */}
    { await apiClient.post('/pld/list').then(res => { tableData = res.data }).catch(res => { - console.log(res) + // console.log(res) }) await apiClient.post('/pld', { @@ -364,7 +372,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { }).then(res => { clientMonth = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) if (!token) { diff --git a/src/pages/resumoOperacao/index.tsx b/src/pages/resumoOperacao/index.tsx index 7eebb84..3fa95a8 100644 --- a/src/pages/resumoOperacao/index.tsx +++ b/src/pages/resumoOperacao/index.tsx @@ -37,7 +37,6 @@ export default function ResumoOperacao({tableData, clientsData, userName, client }; function downloadCSVFile(csv, filename) { - const csv_file = new Blob(["\ufeff",csv], {type: "text/csv"}); const download_link = document.createElement("a"); download_link.download = filename; @@ -81,7 +80,7 @@ export default function ResumoOperacao({tableData, clientsData, userName, client ).then(res => { setTableDataState(res.data.data) }).catch(res => { - console.log(res) + // console.log(res) }) } else { setTableDataState(tableData) @@ -93,8 +92,9 @@ export default function ResumoOperacao({tableData, clientsData, userName, client Smart Energia - Resumo de Operação -
    - +
    + +

    Filtrar por Unidade e/ou Mês

    @@ -106,7 +106,7 @@ export default function ResumoOperacao({tableData, clientsData, userName, client label="Unidade" onChange={handleChangeUnidade} > - Nenhum + Todas { clientsData.map((value) => { return {value.cod_smart_unidade} @@ -124,7 +124,7 @@ export default function ResumoOperacao({tableData, clientsData, userName, client label="Month" onChange={handleChangeMonth} > - Nenhum + Todos { clientMonth.map((value) => { return {monthLabels[parseFloat(value.mes.slice(3, 4))-1]} @@ -139,10 +139,10 @@ export default function ResumoOperacao({tableData, clientsData, userName, client
    - - + + @@ -153,10 +153,10 @@ export default function ResumoOperacao({tableData, clientsData, userName, client - - + + }) @@ -188,7 +188,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { }).then(res => { tableData = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) await apiClient.post('/operation', { @@ -198,7 +198,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { }).then(res => { clientsData = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) await apiClient.post('/operation', { @@ -208,7 +208,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { }).then(res => { clientMonth = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) if (!token) { diff --git a/src/pages/telemetria/index.tsx b/src/pages/telemetria/index.tsx index 689e671..4febdbb 100644 --- a/src/pages/telemetria/index.tsx +++ b/src/pages/telemetria/index.tsx @@ -20,6 +20,8 @@ import { api } from '../../services/api'; import Snackbar from '@mui/material/Snackbar' import MuiAlert, { AlertProps } from '@mui/material/Alert' import getAPIClient from '../../services/ssrApi'; +import router from 'next/router'; +import { DemRegXDemConChart } from '../../components/graph/DemRegXDemConChart'; const style = { position: 'absolute' as const, @@ -48,6 +50,7 @@ export default function Telemetria({userName, clients}: any) { const [openSnackSuccess, setOpenSnackSuccess] = useState(false) const [openSnackError, setOpenSnackError] = useState(false) + const [openSnackFields, setOpenSnackFields] = useState(false) const handleCloseSnack = ( event?: React.SyntheticEvent | Event, reason?: string @@ -58,6 +61,7 @@ export default function Telemetria({userName, clients}: any) { setOpenSnackError(false) setOpenSnackSuccess(false) + setOpenSnackFields(false) } function downloadCSVFile(csv, filename) { @@ -104,6 +108,8 @@ export default function Telemetria({userName, clients}: any) { const [open, setOpen] = useState(false); + const [demRegXDemCon, setDemRegXDemCon] = useState(null); + async function getTableData() { if (startDate!=='' && endDate!=='' && send) setOpen(true) @@ -123,7 +129,42 @@ export default function Telemetria({userName, clients}: any) { setSend(false) setOpenSnackError(true) setOpenSnackSuccess(false) - console.log(res) + }) + } + + function openSnackFieldError() { + setOpenSnackFields(true) + } + + function handleVerifyFields() { + if (unity != '' && startDate != '' && endDate != '' && discretization != '') { + router.push({ + pathname: '/chartTelemetry', + query: { + startDate, + endDate, + discretization, + unity + }, + }) + return true + } else { + setOpenSnackFields(true) + return false + } + } + + async function getChartData() { + await api.post('/telemetry/demand', { + "filters": [ + {"type" : "=", "field": "med_5min.ponto", "value": unity}, + {"type" : "between", "field": "dia_num", "value": [startDate, endDate]} + ] + }).then(res => { + setDemRegXDemCon(res.data.data) + }).catch(res => { + // console.log(res) + router.push('/telemetria') }) } @@ -131,6 +172,11 @@ export default function Telemetria({userName, clients}: any) { setSend(false) }, [startDate, endDate]) + useEffect(() => { + if (send===true) + getChartData() + }, [send]) + return( @@ -147,7 +193,7 @@ export default function Telemetria({userName, clients}: any) { severity="success" sx={{ width: '100%' }} > - Dados coletados com sucesso com Sucesso! + Dados disponíveis para Visualização/Download! + + + Verifique os campos! + + +

    Data inicial

    - setStartDate(value.target.value)} onSelect={value => console.log(value)}/> + setStartDate(value.target.value)} min="2021-01-01"/>

    Data final

    - setEndDate(value.target.value)}/> + setEndDate(value.target.value)} min="2021-01-01"/>
    @@ -232,7 +293,7 @@ export default function Telemetria({userName, clients}: any) { + }}>Selecionar! @@ -283,30 +344,15 @@ export default function Telemetria({userName, clients}: any) { - + value.hora)} title='Demanda Contratada X Registrada' subtitle='' red/> - - - - - { + setShowChart(!showChart)} purple /> + handleVerifyFields()} orange /> + { const html = document.querySelector("table").outerHTML; htmlToCSV(html, "telemetria.csv"); - console.log('clicando') }}/> - setShowChart(!showChart)} green />

    @@ -339,7 +385,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { }).then(res => { clients = res.data.data }).catch(res => { - console.log(res) + // console.log(res) }) if (!token) { diff --git a/src/services/auth.ts b/src/services/auth.ts index 9fec2a0..3da9188 100644 --- a/src/services/auth.ts +++ b/src/services/auth.ts @@ -59,7 +59,6 @@ export default async function recoverUserInformation(id) { let user: UserObjectType await api.get(`/user/${id}`).then(res => { - console.log(res) user = { name: res.data.user.name, email: res.data.user.email, @@ -69,7 +68,7 @@ export default async function recoverUserInformation(id) { profile_picture: res.data.user.profile_picture } }).catch(res => { - console.log(res) + // console.log(res) }) return { diff --git a/src/services/consumoEstimado.js b/src/services/consumoEstimado.js index 51b6922..7b20bed 100644 --- a/src/services/consumoEstimado.js +++ b/src/services/consumoEstimado.js @@ -2,5 +2,5 @@ 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'] + label: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'] } diff --git a/src/styles/layouts/Telemetria/TelemetriaView.ts b/src/styles/layouts/Telemetria/TelemetriaView.ts index 34266df..185258e 100644 --- a/src/styles/layouts/Telemetria/TelemetriaView.ts +++ b/src/styles/layouts/Telemetria/TelemetriaView.ts @@ -18,7 +18,7 @@ export const TelemetriaView = styled.main` left: 0; width: 100%; - height: 100vh; + height: 100%; z-index: 999; } @@ -71,7 +71,7 @@ export const TelemetriaView = styled.main` } .sendButton { - width: 60px; + width: 100px; height: 40px; background:#254F7F; @@ -201,7 +201,6 @@ export const TelemetriaView = styled.main` } .paragraph { - color: #22d1f0; text-align: center; margin-top: 60px; } @@ -256,7 +255,8 @@ export const Buttons = styled.div` color: #FFFFFF; - :first-child { + :nth-child(2) { + font-size: 11px; background: linear-gradient(200.86deg, #F48665 8.03%, #F48665 91.97%), #FFFFFF; } diff --git a/src/styles/layouts/aboutUs/AboutUsView.ts b/src/styles/layouts/aboutUs/AboutUsView.ts index 76e14a3..e6b85c0 100644 --- a/src/styles/layouts/aboutUs/AboutUsView.ts +++ b/src/styles/layouts/aboutUs/AboutUsView.ts @@ -3,14 +3,6 @@ import styled from "styled-components"; export const AboutUsView = styled.main` width: 100%; - p { - font-family: 'Poppins'; - font-style: normal; - font-weight: 300; - font-size: 80%; - line-height: 26px; - } - ul { list-style: none; diff --git a/src/styles/layouts/commonQuestions/FaqView.ts b/src/styles/layouts/commonQuestions/FaqView.ts index b4975b6..96652d0 100644 --- a/src/styles/layouts/commonQuestions/FaqView.ts +++ b/src/styles/layouts/commonQuestions/FaqView.ts @@ -34,13 +34,6 @@ export const FaqView = styled.main` border: 1px solid #DDDDDD; } - /* .modal{ - display: flex; - justify-self: flex-end; - align-self: center; - margin-left: 100px; - - } */ .btn2{ background: #254F7F; border-radius: 8px; diff --git a/src/styles/layouts/industryInfo/IndustryInfoView.ts b/src/styles/layouts/industryInfo/IndustryInfoView.ts index f7b589e..3a9483e 100644 --- a/src/styles/layouts/industryInfo/IndustryInfoView.ts +++ b/src/styles/layouts/industryInfo/IndustryInfoView.ts @@ -19,6 +19,7 @@ export const IndustryInfoView = styled.main` font-family: 'Poppins'; font-size: 90%; color: #FFFFFF; + margin-top: 30px; } form { diff --git a/src/styles/layouts/pld/PldView.ts b/src/styles/layouts/pld/PldView.ts index d9239cf..028b35e 100644 --- a/src/styles/layouts/pld/PldView.ts +++ b/src/styles/layouts/pld/PldView.ts @@ -3,6 +3,11 @@ import styled from "styled-components" export const PldTableView = styled.main` width: 100%; + .actual { + font-weight: bold!important; + background-color: red!important; + } + .tg{ border-collapse:collapse; border-spacing:0; @@ -22,7 +27,6 @@ export const PldTableView = styled.main` word-break:normal; } - .tg th{ border-color:#DDDFE1; border-style:solid; @@ -35,7 +39,6 @@ export const PldTableView = styled.main` word-break:normal; } .tg .tg-8oo6{ - color:#464a53; font-size:13px; text-align:center; vertical-align:top; @@ -44,25 +47,22 @@ export const PldTableView = styled.main` } .tg .tg-uulg{ background-color:#efefef; - color:#abafb3; font-size:14px; text-align:center; vertical-align:top } .tg .tg-gceh{ background-color:#efefef; - color:#6a707e; font-size:14px; text-align:center; vertical-align:top } .tg .tg-0tzy{ - color:#abafb3; font-size:14px; text-align:center; vertical-align:top } - .tg .tg-hq65{color:#6a707e; + .tg .tg-hq65{ font-size:14px; text-align:center; vertical-align:top diff --git a/yarn.lock b/yarn.lock index 65ed182..6f24770 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1390,11 +1390,6 @@ version "2.11.5" resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz" -"@react-pdf-viewer/core@^3.5.0": - version "3.5.0" - resolved "https://registry.yarnpkg.com/@react-pdf-viewer/core/-/core-3.5.0.tgz#bb18b87330bfd01d5c31980b820ef58dc1c50a19" - integrity sha512-fu9vi8lzpFtQQqu8XUzSzp5aQYD5YxmJQ0CxOuRrANU7z1kft+TbdyiDOpWoeX2VC0/oyclBxUwleVYv+g1f1w== - "@rushstack/eslint-patch@^1.1.3": version "1.1.3" resolved "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.1.3.tgz" @@ -1967,6 +1962,7 @@ chart.js@^3.7.1: chartjs-plugin-datalabels@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/chartjs-plugin-datalabels/-/chartjs-plugin-datalabels-2.0.0.tgz#caacefb26803d968785071eab012dde8746c5939" + integrity sha512-WBsWihphzM0Y8fmQVm89+iy99mmgejmj5/jcsYqwxSioLRL/zqJ4Scv/eXq5ZqvG3TpojlGzZLeaOaSvDm7fwA== chownr@^2.0.0: version "2.0.0" @@ -3642,6 +3638,7 @@ node-releases@^2.0.3: nookies@^2.5.2: version "2.5.2" resolved "https://registry.yarnpkg.com/nookies/-/nookies-2.5.2.tgz#cc55547efa982d013a21475bd0db0c02c1b35b27" + integrity sha512-x0TRSaosAEonNKyCrShoUaJ5rrT5KHRNZ5DwPCuizjgrnkpE5DRf3VL7AyyQin4htict92X1EQ7ejDbaHDVdYA== dependencies: cookie "^0.4.1" set-cookie-parser "^2.4.6"

    {data.year_month_formatted} {parseFloat(data.nordeste).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})} {parseFloat(data.norte).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}Mês Unidade OperaçãoMontante (MWh) ContrapartePreço(R$/MWh)Montante (MWh) ValorNF/Crédito(R$)Preço(R$/MWh)
    {value.mes} {value.cod_smart_unidade} {value.operacao}{parseFloat(value.montante_nf).toLocaleString('pt-br')} {value.contraparte}{parseFloat(value.nf_c_icms).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}{parseFloat(value.montante_nf).toLocaleString('pt-br')} {parseFloat(value.preco_nf).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}{parseFloat(value.nf_c_icms).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}