+
handleChangeEndDate(newValue)}
- renderInput={(params) => }
+ renderInput={(params) => }
/>
+
+ {
+ setLoader(true)
+ getDemand(unity, startDate, endDate, discretization)
+ .then(result => { setDemRegXDemCon(result); setSend(false); setLoader(false); setTableData(result) })
+ .catch(exception => { setSend(false); setOpenSnackFields(true); setLoader(false) })
+ }} />
+
+
+
value.hora)} title='Demanda Contratada X Registrada' subtitle='' red />
+
+
+ {/* power factor chart */}
+
+
+
+
+ Unidade
+ setUnity(value.target.value)}
+ sx={{ height: 63, mb: 2 }}
+ fullWidth
+ >
+
+ Nenhum
+
+ {/* RSZFNAENTR101P COMENTARIO DE OPÇAO COM DADOS TESTES */}
+ {
+ clients.map((value) => {
+ return {value.unidade}
+ })
+ }
+
+
+
+
+
+ Discretização
+ setDiscretization(value.target.value)}
+ sx={{ height: 63, mb: 2 }}
+ fullWidth
+ >
+
+ Nenhum
+
+ 5 minutos
+ 15 minutos
+ 1 hora
+ 1 dia
+ 1 mês
+
+
+
+
+
+ }
+ />
+
+
+ handleChangeEndDate(newValue)}
+ renderInput={(params) => }
+ />
+
+
+
+ {
+ setLoader(true)
+ getPowerFactorData(unity, startDate, endDate, discretization)
+ .then(result => { setFatorPotenciaData(result); setSend(false); setLoader(false); setTableData(result) })
+ .catch(exception => { setSend(false); setOpenSnackFields(true); setLoader(false) })
+ }} />
+
+
+ (value.day_formatted))} />
+
+
+
+
+
+
+
+
+
+
+ Unidade
+ Ponto
+ Numero do dia
+ Dia formatado
+ Hora
+ Minuto
+ f_ref
+ Consumo
+ Reativa
+ fp
+ dem contratada
+ dem registrada
+ dem tolerancia
+
+
+
+ {
+ fatorPotenciaData !== null ?
+ fatorPotenciaData?.map((value, index) => {
+ return <>
+
+ {unity}
+ {value?.ponto}
+ {parseFloat(value?.dia_num)}
+ {value?.day_formatted}
+ {value?.hora}
+ {value.minut}
+ {value?.f_ref}
+ {parseFloat(value?.consumo).toLocaleString('pt-br', { style: 'currency', currency: 'BRL', minimumFractionDigits: 2 })}
+ {parseFloat(value?.reativa).toLocaleString('pt-br', { style: 'currency', currency: 'BRL', minimumFractionDigits: 2 })}
+ {parseFloat(value?.fp)}
+ {value?.dem_cont}
+ {value?.dem_reg}
+ {value?.dem_tolerancia}
+
+ >
+ })
+ :
+ null
}
-
- {
- setLoader(true)
- getDiscretization(unity, startDate, endDate, discretization)
- .then(result => {setDiscretizedConsumptionData(result); setSend(false); setLoader(false); setTableData(result)})
- .catch(exception => {setSend(false); setOpenSnackFields(true); setLoader(false)})
- }}/>
-
-
- value.minut)} dataset={'Consumo'} dataset1='Estimado' month/>
-
+
+
- {/* demand chart */}
-
-
-
-
- Unidade
- setUnity(value.target.value)}
- sx={{height: 63, mb: 2}}
- fullWidth
- >
-
- Nenhum
-
- {/* RSZFNAENTR101P COMENTARIO DE OPÇAO COM DADOS TESTES */}
- {
- clients.map((value) => {
- return {value.unidade}
- })
- }
-
-
-
-
-
- Discretização
- setDiscretization(value.target.value)}
- sx={{height: 63, mb: 2}}
- fullWidth
- >
-
- Nenhum
-
- 5 minutos
- 15 minutos
- 1 hora
- {/* 1 dia
- 1 mês */}
-
-
-
-
-
- }
- />
-
-
- handleChangeEndDate(newValue)}
- renderInput={(params) => }
- />
-
-
-
- {
- setLoader(true)
- getDemand(unity, startDate, endDate, discretization)
- .then(result => {setDemRegXDemCon(result); setSend(false); setLoader(false); setTableData(result)})
- .catch(exception => {setSend(false); setOpenSnackFields(true); setLoader(false)})
- }}/>
-
-
- value.hora)} title='Demanda Contratada X Registrada' subtitle='' red/>
-
+
+ value.hora)} title='Demanda Contratada X Registrada' subtitle='' red />
+
- {/* power factor chart */}
-
-
-
-
- Unidade
- setUnity(value.target.value)}
- sx={{height: 63, mb: 2}}
- fullWidth
- >
-
- Nenhum
-
- {/* RSZFNAENTR101P COMENTARIO DE OPÇAO COM DADOS TESTES */}
- {
- clients.map((value) => {
- return {value.unidade}
- })
- }
-
-
-
-
-
- Discretização
- setDiscretization(value.target.value)}
- sx={{height: 63, mb: 2}}
- fullWidth
- >
-
- Nenhum
-
- 5 minutos
- 15 minutos
- 1 hora
- 1 dia
- 1 mês
-
-
-
-
-
- }
- />
-
-
- handleChangeEndDate(newValue)}
- renderInput={(params) => }
- />
-
-
-
- {
- setLoader(true)
- getPowerFactorData(unity, startDate, endDate, discretization)
- .then(result => {setFatorPotenciaData(result); setSend(false); setLoader(false); setTableData(result)})
- .catch(exception => {setSend(false); setOpenSnackFields(true); setLoader(false)})
- }}/>
-
-
- (value.day_formatted))} />
-
-
-
-
-
-
-
-
-
-
-
- Ponto
- Numero do dia
- Dia formatado
- Hora
- f_ref
- Consumo
- Reativa
- fp
-
-
-
- {
- fatorPotenciaData!==null?
- fatorPotenciaData?.map((value, index) => {
- return <>
-
- {value.ponto}
- {parseFloat(value.dia_num)}
- {value.day_formatted}
- {value.hora}
- {value.f_ref}
- {parseFloat(value.consumo).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}
- {parseFloat(value.reativa).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}
- {parseFloat(value.fp)}
-
- >
- })
- :
- null
- }
-
-
-
-
-
-
-
- Ponto
- Numero do dia
- Dia formatado
- Hora
- {/* Minuto não temos */}
- Consumo
- Reativa
- dem contratada
- dem registrada
- dem tolerancia
-
-
-
- {
- demRegXDemCon!==null?
- demRegXDemCon?.map((value, index) => {
- return <>
-
- {value.ponto}
- {parseFloat(value.dia_num)}
- {value.day_formatted}
- {value.hora}
- {/* {value.minut} */}
- {parseFloat(value.consumo).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}
- {parseFloat(value.reativa).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}
- {value.dem_cont}
- {value.dem_reg}
- {value.dem_tolerancia}
-
- >
- })
- :
- null
- }
-
-
-
-
-
-
-
- Ponto
- Numero do dia
- Dia formatado
- Hora
- Minuto
- Consumo
- Reativa
-
-
-
- {
- discretizedConsumptionData!==null?
- discretizedConsumptionData?.map((value, index) => {
- return <>
-
- {value.ponto}
- {parseFloat(value.dia_num)}
- {value.day_formatted}
- {value.hora}
- {value.minut}
- {parseFloat(value.consumo).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}
- {parseFloat(value.reativa).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})}
-
- >
- })
- :
- null
- }
-
-
-
-
-
- value.hora)} title='Demanda Contratada X Registrada' subtitle='' red/>
-
-
-
- {/* setShowChart(!showChart)} purple /> */}
- {/* handleVerifyFields()} orange /> */}
- {
- const html = document.querySelector("table")?.outerHTML;
- htmlToCSV(html, `${menu === 2 ? 'fator_potencia' : menu === 1 ? 'demanda' : 'consumo_discretizado'}.csv`);
- }}/>
-
-
-
- Fonte: Dados coletados do Sistema de Coleta de Dados
- de Energia - SCDE da Câmara de Comercialização
- Energia Elétrica – CCEE, sendo que as quantidades aqui
- informadas são de responsabilidade do agente de
- medição - Distribuidora.
-
-
-
+
+ {/* setShowChart(!showChart)} purple /> */}
+ {/* handleVerifyFields()} orange /> */}
+ {
+ const html = document.querySelector("table")?.outerHTML;
+ htmlToCSV(html, `${menu === 2 ? 'fator_potencia' : menu === 1 ? 'demanda' : 'consumo_discretizado'}.csv`);
+ }} />
+
+
+
+ Fonte: Dados coletados do Sistema de Coleta de Dados
+ de Energia - SCDE da Câmara de Comercialização
+ Energia Elétrica – CCEE, sendo que as quantidades aqui
+ informadas são de responsabilidade do agente de
+ medição - Distribuidora.
+
+
+
}
)
@@ -706,15 +636,15 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
let clients = []
await apiClient.post('/units', {
- "filters": [
- {"type" : "=", "field": "dados_cadastrais.cod_smart_cliente", "value": client_id},
- {"type" : "not_in", "field": "dados_cadastrais.codigo_scde", "value":["0P"]}
- ],
- "fields": [
- "unidade",
- "cod_smart_unidade",
- "codigo_scde"],
- "distinct": true
+ "filters": [
+ { "type": "=", "field": "dados_cadastrais.cod_smart_cliente", "value": client_id },
+ { "type": "not_in", "field": "dados_cadastrais.codigo_scde", "value": ["0P"] }
+ ],
+ "fields": [
+ "unidade",
+ "cod_smart_unidade",
+ "codigo_scde"],
+ "distinct": true
}).then(res => {
console.log(res.data)
clients = res.data.data