diff --git a/src/components/pageTitle/PageTitle.tsx b/src/components/pageTitle/PageTitle.tsx index 091dd06..5a861ab 100644 --- a/src/components/pageTitle/PageTitle.tsx +++ b/src/components/pageTitle/PageTitle.tsx @@ -9,7 +9,7 @@ interface PageTitleInterface { export default function PageTitle({ title, subtitle }: PageTitleInterface) { return ( -

{title}

+

{title}

{subtitle}

) diff --git a/src/pages/chartTelemetry.tsx b/src/pages/chartTelemetry.tsx index 4c833ed..f195025 100644 --- a/src/pages/chartTelemetry.tsx +++ b/src/pages/chartTelemetry.tsx @@ -68,7 +68,7 @@ export default function chartTelemetry({userName}) { console.log(router.query) await api.post('/telemetry/powerFactor', { "filters": [ - {"type" : "=", "field": discretization, "value": unity}, + {"type" : "=", "field": "med_5min.ponto", "value": unity}, {"type" : "between", "field": "dia_num", "value": [startDate, endDate]} ] }).then(res => { @@ -78,9 +78,9 @@ export default function chartTelemetry({userName}) { }) await api.post('/telemetry/discretization', { - "type": "5_min", + "type": discretization, "filters": [ - {"type" : "=", "field": discretization, "value": unity}, + {"type" : "=", "field": "med_5min.ponto", "value": unity}, {"type" : "between", "field": "dia_num", "value": [startDate, endDate]} ] }).then(res => { @@ -90,9 +90,9 @@ export default function chartTelemetry({userName}) { }) await api.post('/telemetry/discretization', { - "type": "5_min", + "type": discretization, "filters": [ - {"type" : "=", "field": discretization, "value": unity}, + {"type" : "=", "field": "med_5min.ponto", "value": unity}, {"type" : "between", "field": "dia_num", "value": [startDate, endDate]} ] }).then(res => { @@ -103,7 +103,7 @@ export default function chartTelemetry({userName}) { await api.post('/telemetry/demand', { "filters": [ - {"type" : "=", "field": discretization, "value": unity}, + {"type" : "=", "field": 'med_5min.ponto', "value": unity}, {"type" : "between", "field": "dia_num", "value": [startDate, endDate]} ] }).then(res => { @@ -154,7 +154,10 @@ export default function chartTelemetry({userName}) {
setOpenConsumoDiscretizado1(true)}> - parseFloat(data.reativa).toFixed(3))} /> + parseFloat(data.reativa).toFixed(3))} />
- data.reativa)} /> + data.reativa)} />
setOpenConsumoDiscretizado2(true)}> - value.minut)} dataset={'Consumo'} dataset1='Estimado' month/> + value.minut)} dataset={'Consumo'} dataset1='Estimado' month/>
- value.minut)} dataset={'Consumo'} dataset1='Estimado' month/> + value.minut)} dataset={'Consumo'} dataset1='Estimado' month/> diff --git a/src/pages/resumoOperacao.tsx b/src/pages/resumoOperacao.tsx index eba2f17..fd36784 100644 --- a/src/pages/resumoOperacao.tsx +++ b/src/pages/resumoOperacao.tsx @@ -36,53 +36,27 @@ export default function ResumoOperacao({tableData, clientsData, userName, client setUnidade(event.target.value); }; - function stringToBytes(text) { - const length = text.length; - const result = new Uint8Array(length); - for (let i = 0; i < length; i++) { - const code = text.charCodeAt(i); - const byte = code > 255 ? 32 : code; - result[i] = byte; - } - return result; - } - - // const originalString = 'ååå'; - // const bytes = stringToBytes(originalString); - // const blob = new Blob([bytes.buffer], { type: 'text/plain; charset=ISO-8859-1' }); - function downloadCSVFile(csv, filename) { const csv_file = new Blob(["\ufeff",csv], {type: "text/csv"}); - const download_link = document.createElement("a"); - download_link.download = filename; - download_link.href = window.URL.createObjectURL(csv_file); - download_link.style.display = "none"; - document.body.appendChild(download_link); - download_link.click(); } function htmlToCSV(html, filename) { const data = []; const rows = document.querySelectorAll("table tr"); - for (let i = 0; i < rows.length; i++) { const row = [], cols: any = rows[i].querySelectorAll("td, th"); - for (let j = 0; j < cols.length; j++) { row.push(cols[j].innerText); } - - data.push(row.join(";")); } - downloadCSVFile(data.join("\n"), filename); } @@ -121,7 +95,6 @@ export default function ResumoOperacao({tableData, clientsData, userName, client
-

Filtrar por Unidade e/ou Mês

diff --git a/src/pages/telemetria.tsx b/src/pages/telemetria.tsx index ffc2c5a..765eb78 100644 --- a/src/pages/telemetria.tsx +++ b/src/pages/telemetria.tsx @@ -108,7 +108,7 @@ export default function Telemetria({userName, clients}: any) { if (startDate!=='' && endDate!=='' && send) setOpen(true) await api.post('/telemetry/powerFactor', { - "type": "15_min", + "type": discretization, "filters": [ {"type" : "=", "field": "med_5min.ponto", "value": "RSZFNAENTR101P"}, {"type" : "between", "field": "dia_num", "value": ["2022-01-03", "2022-01-03"]} @@ -292,7 +292,7 @@ export default function Telemetria({userName, clients}: any) { query: { startDate, endDate, - discretization: discretization==='5_min'? 'med_5min.ponto' : discretization==='15_min'? '15min.ponto' : discretization==='1_hora'? 'med_1hora.ponto' : discretization==='1_dia'? 'med_1dia.ponto' : 'med_5min.ponto', + discretization, unity }, }} > diff --git a/src/styles/layouts/industryInfo/IndustryInfoView.ts b/src/styles/layouts/industryInfo/IndustryInfoView.ts index 624cc92..f7b589e 100644 --- a/src/styles/layouts/industryInfo/IndustryInfoView.ts +++ b/src/styles/layouts/industryInfo/IndustryInfoView.ts @@ -3,7 +3,6 @@ import styled from "styled-components"; export const IndustryInfoView = styled.main` display: flex; flex-direction: column; - width: 100%; .title { @@ -13,17 +12,12 @@ export const IndustryInfoView = styled.main` button{ height: 70px; width: 30%; - cursor: pointer; - background: #254F7F; - border-radius: 8px; border-style: none; - font-family: 'Poppins'; font-size: 90%; - color: #FFFFFF; } @@ -50,36 +44,5 @@ export const IndustryInfoView = styled.main` border: 1px solid black; border-radius: 6px; } - label { - } - - /* .inputTeste{ - display: flex; - align-items: center; - width: 50%; - height: 50px; - background: white; - border-radius:10px; - } - - input[type="file"] { - display: block; - } - - label { - display: flex; - justify-content: flex-start; - padding: 2px 10px; - width: 200px; - background-color: #333; - color: #FFF; - text-transform: uppercase; - text-align: center; - display: block; - margin-top: 10px; - cursor: pointer; - } */ - - `