feat
This commit is contained in:
parent
fc460bf343
commit
682181d130
@ -334,7 +334,7 @@ export default function ClientTable({ clients, onChange }: ClientsTableInterface
|
||||
.then((res) => {
|
||||
setOpenSnackSuccess(true)
|
||||
setOpenModalInativar(false)
|
||||
window.location.reload()
|
||||
// window.location.reload()
|
||||
})
|
||||
.catch((res) => {
|
||||
setOpenSnackError(true)
|
||||
|
||||
@ -1,21 +1,20 @@
|
||||
import React from 'react'
|
||||
|
||||
import { draw } from 'patternomaly'
|
||||
import { draw } from 'patternomaly';
|
||||
|
||||
import { Bar } from 'react-chartjs-2';
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
BarElement,
|
||||
CategoryScale,
|
||||
Chart as ChartJS,
|
||||
Legend,
|
||||
LinearScale,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend
|
||||
} from 'chart.js'
|
||||
Tooltip
|
||||
} from 'chart.js';
|
||||
import { Bar } from 'react-chartjs-2';
|
||||
|
||||
import { CostIndicatorChartView } from './CostIndicatorChartView';
|
||||
import ChartTitle from '../ChartTitle';
|
||||
import { config } from '../config';
|
||||
import { CostIndicatorChartView } from './CostIndicatorChartView';
|
||||
|
||||
ChartJS.register(
|
||||
CategoryScale,
|
||||
@ -42,11 +41,13 @@ export default function CostIndicatorChart({ title, data1, data2, label, subtitl
|
||||
|
||||
const options: any = config(miniature)
|
||||
|
||||
console.log(new Date().getFullYear())
|
||||
|
||||
const data = {
|
||||
labels,
|
||||
datasets: [
|
||||
{
|
||||
label: '2021',
|
||||
label: new Date().getFullYear() - 1,
|
||||
data: data1?.map(value => value),
|
||||
skipNull: data2?.map(value => value)?.includes(null),
|
||||
borderRadius: 8,
|
||||
@ -64,7 +65,7 @@ export default function CostIndicatorChart({ title, data1, data2, label, subtitl
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '2022',
|
||||
label: new Date().getFullYear(),
|
||||
data: data2?.map(value => value),
|
||||
skipNull: data1?.map(value => value)?.includes(null),
|
||||
borderRadius: 8,
|
||||
|
||||
@ -356,7 +356,6 @@ export default function clients({ clients, userName }) {
|
||||
</div>
|
||||
</InputUploadView>
|
||||
|
||||
|
||||
<div className='select'>
|
||||
|
||||
<FormControl sx={{ width: 350, ml: 5, mt: 2 }}>
|
||||
|
||||
@ -1,31 +1,28 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
import { DashboardView } from '../../styles/layouts/dashboard/DashboardView'
|
||||
|
||||
import MapCard from '../../components/mapCard/MapCard'
|
||||
import Link from 'next/link'
|
||||
import GraphCard from '../../components/graph/graphCard/ChartCard'
|
||||
import Header from '../../components/header/Header'
|
||||
import MapCard from '../../components/mapCard/MapCard'
|
||||
import PageTitle from '../../components/pageTitle/PageTitle'
|
||||
import Link from 'next/link'
|
||||
|
||||
import { parseCookies, setCookie } from 'nookies'
|
||||
import { GetServerSideProps } from 'next'
|
||||
import getAPIClient from '../../services/ssrApi'
|
||||
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'
|
||||
import AccumulatedEconomyTitle from '../../components/accumulatedEconomyTitle/AccumulatedEconomyTitle'
|
||||
import { format } from 'date-fns'
|
||||
import { GetServerSideProps } from 'next'
|
||||
import Head from 'next/head'
|
||||
import { parseCookies, setCookie } from 'nookies'
|
||||
import AccumulatedEconomyTitle from '../../components/accumulatedEconomyTitle/AccumulatedEconomyTitle'
|
||||
import { CativoXLivreChart } from '../../components/graph/cativoXLivreChart'
|
||||
import CostIndicatorChart from '../../components/graph/costIndicatorChart'
|
||||
import { GrossAnualChart } from '../../components/graph/grossAnualChart/GrossAnualChart'
|
||||
import GrossMensalChart from '../../components/graph/grossMensalChart/GrossMensalChart'
|
||||
import getAPIClient from '../../services/ssrApi'
|
||||
|
||||
import Box from '@mui/material/Box';
|
||||
import Button from '@mui/material/Button';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import Modal from '@mui/material/Modal';
|
||||
import RenderIf from '../../utils/renderIf'
|
||||
import Box from '@mui/material/Box'
|
||||
import Modal from '@mui/material/Modal'
|
||||
import Typography from '@mui/material/Typography'
|
||||
import BasicButton from '../../components/buttons/basicButton/BasicButton'
|
||||
import ConfirmModal from '../../components/modal/ConfirmModal'
|
||||
|
||||
const style = {
|
||||
position: 'absolute' as const,
|
||||
@ -141,8 +138,8 @@ export default function Dashboard({ grossAnualGraph, grossAnualYears, grossMensa
|
||||
|
||||
<GraphCard title='Indicador de Custo' subtitle='Indicador de Custo - Valores em R$/MWh'>
|
||||
<CostIndicatorChart title='' subtitle=''
|
||||
data1={costIndicator?.filter((value, index) => value?.mes.slice(0, 4).includes('2021')).map(value => value?.custo_unit && !!parseInt(value?.custo_unit) ? value.custo_unit : null)}
|
||||
data2={costIndicator?.filter((value, index) => value?.mes.slice(0, 4).includes('2022')).map(value => value?.custo_unit && !!parseInt(value?.custo_unit) ? value.custo_unit : null)}
|
||||
data1={costIndicator?.filter((value, index) => value?.mes.slice(0, 4).includes(costIndicator[0].mes.slice(0, 4))).map(value => value?.custo_unit && !!parseInt(value?.custo_unit) ? value.custo_unit : null)}
|
||||
data2={costIndicator?.filter((value, index) => value?.mes.slice(0, 4).includes(costIndicator[costIndicator.length - 1].mes.slice(0, 4))).map(value => value?.custo_unit && !!parseInt(value?.custo_unit) ? value.custo_unit : null)}
|
||||
label={months}
|
||||
miniature
|
||||
/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user