pld table fix

This commit is contained in:
joseCorte-exe 2022-07-08 17:52:06 -03:00
parent 001f8530ee
commit e10c88e9cb
5 changed files with 17 additions and 15 deletions

View File

@ -72,6 +72,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
"fields": ["cod_smart_unidade", "codigo_scde"],
"distinct": true
}).then(res => {
console.log(res.data.data)
clients = res.data.data
}).catch(res => {
// console.log(res)

View File

@ -210,13 +210,13 @@ export default function pld({tableData, userName, clientMonth}: pldInterface) {
}, [])
return (
<main style={{width: '100%',}}>
<main style={{width: '100%'}}>
<Head>
<title>Smart Energia - PLD</title>
</Head>
<div id='title'/>
<Header name={userName}>
<PageTitle title='PLD Histórico' subtitle='Tabela de consumo PLD'/>
<PageTitle title='PLD' subtitle='Evolução PLD - Valores em R$/MWh'/>
</Header>
<TableHeader>
<Tabs value={page} onChange={(e, nv) => setPage(nv)} aria-label="">
@ -236,7 +236,7 @@ export default function pld({tableData, userName, clientMonth}: pldInterface) {
<table className="tg">
<thead>
<tr>
<th className='tg-8oo6'>Mês<p>(R$/MWh)</p></th>
<th className='tg-8oo6'>Mês</th>
<th className='tg-8oo6'>Nordeste<p>(R$/MWh)</p></th>
<th className='tg-8oo6'>Norte<p>(R$/MWh)</p></th>
<th className='tg-8oo6'>Sudeste<p>(R$/MWh)</p></th>
@ -301,7 +301,7 @@ export default function pld({tableData, userName, clientMonth}: pldInterface) {
}
</tbody>
</table>
<section>
{/* <section>
<article onClick={() => setPage(1)} className="btn btn-1">
<svg height='100px'>
<rect x="0" y="0" fill="none" width="100%" height="100%"/>
@ -314,7 +314,7 @@ export default function pld({tableData, userName, clientMonth}: pldInterface) {
</svg>
<p>Valores Horários</p>
</article>
</section>
</section> */}
</PldTableView>
</RenderIf>

View File

@ -20,7 +20,7 @@ import data from '../../services/dados.json'
import getAPIClient from '../../services/ssrApi';
import { Pagination, TableHeader, TableView } from '../../styles/layouts/ResumoOperacao/ResumoOperacaoView';
export default function ResumoOperacao({tableData, clientsData, userName, clientMonth}: any) {
export default function ResumoOperacao({tableData, clients, userName, clientMonth}: any) {
const csvData = tableData;
const [month, setMonth] = useState('');
@ -114,7 +114,7 @@ export default function ResumoOperacao({tableData, clientsData, userName, client
>
<MenuItem key={1} value={''}>Todas</MenuItem>
{
clientsData.map((value) => {
clients.map((value) => {
return <MenuItem key={1} value={value.cod_smart_unidade}>{value.cod_smart_unidade}</MenuItem>
})
}
@ -195,7 +195,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
const { ['user-name']: userName } = parseCookies(ctx)
let tableData = [];
let clientsData = [];
let clientMonth = [];
await apiClient.post('/operation/summary', {
@ -206,6 +205,8 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
// console.log(res)
})
let clients = [];
await apiClient.post('/units', {
"filters": [
{"type" : "not_in", "field": "dados_cadastrais.codigo_scde", "value":["0P"]},
@ -215,9 +216,9 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
"distinct": true
}).then(res => {
console.log(res.data.data)
clientsData = res.data.data
clients = res.data.data
}).catch(res => {
console.log(res)
// console.log(res)
})
await apiClient.post('/operation', {
@ -244,7 +245,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
return {
props: {
tableData,
clientsData,
clients,
clientMonth,
userName
}

View File

@ -11,7 +11,7 @@ export const PldTableView = styled.main`
}
thead {
border-radius: 8px!important;
/* border-radius: 2px!important; */
}
}
@ -120,12 +120,12 @@ export const PldTableView = styled.main`
table, th:last-child{
border: transparent;
border-top-right-radius: 20px;
border-top-right-radius: 8px;
}
table, th:first-child {
border: transparent;
border-top-left-radius: 20px;
border-top-left-radius: 8px;
}
h3{