updates
This commit is contained in:
parent
cb7e212953
commit
8ed111fc6a
@ -10,8 +10,6 @@ export const FaqQuestionsCardHeader = styled.div`
|
|||||||
|
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
margin-top: 53px;
|
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ export const FaqQuestionsCardHeader = styled.div`
|
|||||||
|
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
margin-top: 53px;
|
/* margin-bottom: 53px; */
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export const ChartCardView = styled.article`
|
|||||||
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
border-radius: 20px;
|
border-radius: 10px;
|
||||||
|
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,6 @@ import { api } from '../../services/api';
|
|||||||
import Snackbar from '@mui/material/Snackbar'
|
import Snackbar from '@mui/material/Snackbar'
|
||||||
import MuiAlert, { AlertProps } from '@mui/material/Alert'
|
import MuiAlert, { AlertProps } from '@mui/material/Alert'
|
||||||
import getAPIClient from '../../services/ssrApi';
|
import getAPIClient from '../../services/ssrApi';
|
||||||
import router from 'next/router';
|
|
||||||
import { DemRegXDemConChart } from '../../components/graph/DemRegXDemConChart';
|
import { DemRegXDemConChart } from '../../components/graph/DemRegXDemConChart';
|
||||||
|
|
||||||
import Tabs from '@mui/material/Tabs';
|
import Tabs from '@mui/material/Tabs';
|
||||||
@ -29,7 +28,6 @@ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
|||||||
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
||||||
import BasicButton from '../../components/buttons/basicButton/BasicButton';
|
import BasicButton from '../../components/buttons/basicButton/BasicButton';
|
||||||
import { DiscretizedConsumptionChart } from '../../components/graph/DiscretizedConsumptionChart';
|
import { DiscretizedConsumptionChart } from '../../components/graph/DiscretizedConsumptionChart';
|
||||||
import DiscretizedConsumptionChartLine from '../../components/graph/DiscretizedConsumptionChartLine';
|
|
||||||
import FatorPotenciaChart from '../../components/graph/fatorPotenciaChart';
|
import FatorPotenciaChart from '../../components/graph/fatorPotenciaChart';
|
||||||
import { getDiscretization } from '../../services/charts/telemetry/getDiscretization';
|
import { getDiscretization } from '../../services/charts/telemetry/getDiscretization';
|
||||||
import { getPowerFactorData } from '../../services/charts/telemetry/getPowerFactor';
|
import { getPowerFactorData } from '../../services/charts/telemetry/getPowerFactor';
|
||||||
@ -103,6 +101,8 @@ export default function Telemetria({userName, clients}: any) {
|
|||||||
|
|
||||||
const [tableData, setTableData] = useState(null)
|
const [tableData, setTableData] = useState(null)
|
||||||
|
|
||||||
|
const [loader, setLoader] = useState(false)
|
||||||
|
|
||||||
const [menu, setMenu] = useState(0);
|
const [menu, setMenu] = useState(0);
|
||||||
|
|
||||||
const [showChart, setShowChart] = useState(false);
|
const [showChart, setShowChart] = useState(false);
|
||||||
@ -136,9 +136,11 @@ export default function Telemetria({userName, clients}: any) {
|
|||||||
setOpenSnackError(false)
|
setOpenSnackError(false)
|
||||||
setOpenSnackSuccess(true)
|
setOpenSnackSuccess(true)
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
|
setLoader(true)
|
||||||
htmlToCSV(html, "telemetria.csv")
|
htmlToCSV(html, "telemetria.csv")
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
setSend(false)
|
setSend(false)
|
||||||
|
setLoader(false)
|
||||||
setException(true)
|
setException(true)
|
||||||
setOpenSnackError(true)
|
setOpenSnackError(true)
|
||||||
setOpenSnackSuccess(false)
|
setOpenSnackSuccess(false)
|
||||||
@ -155,10 +157,8 @@ export default function Telemetria({userName, clients}: any) {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
setDemRegXDemCon2(res.data.data)
|
setDemRegXDemCon2(res.data.data)
|
||||||
htmlToCSV(html, "telemetria.csv")
|
htmlToCSV(html, "telemetria.csv")
|
||||||
}).catch(res => {
|
|
||||||
// console.log(res)
|
|
||||||
// router.push('/telemetria')
|
|
||||||
})
|
})
|
||||||
|
setLoader(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const [filters, setFilters] = useState()
|
const [filters, setFilters] = useState()
|
||||||
@ -326,10 +326,10 @@ export default function Telemetria({userName, clients}: any) {
|
|||||||
</LocalizationProvider>
|
</LocalizationProvider>
|
||||||
<div className='select'>
|
<div className='select'>
|
||||||
<BasicButton title='Selecionar!' onClick={() => {
|
<BasicButton title='Selecionar!' onClick={() => {
|
||||||
setSend(true)
|
setLoader(true)
|
||||||
getDiscretization(unity, startDate, endDate, discretization)
|
getDiscretization(unity, startDate, endDate, discretization)
|
||||||
.then(result => {setDiscretizedConsumptionData(result); setSend(false)})
|
.then(result => {setDiscretizedConsumptionData(result); setSend(false); setLoader(false)})
|
||||||
.catch(exception => {setSend(false); setOpenSnackFields(true)})
|
.catch(exception => {setSend(false); setOpenSnackFields(true); setLoader(false)})
|
||||||
}}/>
|
}}/>
|
||||||
</div>
|
</div>
|
||||||
</ChartFilters>
|
</ChartFilters>
|
||||||
@ -423,10 +423,10 @@ export default function Telemetria({userName, clients}: any) {
|
|||||||
</LocalizationProvider>
|
</LocalizationProvider>
|
||||||
<div className='select'>
|
<div className='select'>
|
||||||
<BasicButton title='Selecionar!' onClick={() => {
|
<BasicButton title='Selecionar!' onClick={() => {
|
||||||
setSend(true)
|
setLoader(true)
|
||||||
getDemand(unity, startDate, endDate, discretization)
|
getDemand(unity, startDate, endDate, discretization)
|
||||||
.then(result => {setDemRegXDemCon(result); setSend(false)})
|
.then(result => {setDemRegXDemCon(result); setSend(false); setLoader(false)})
|
||||||
.catch(exception => {setSend(false); setOpenSnackFields(true)})
|
.catch(exception => {setSend(false); setOpenSnackFields(true); setLoader(false)})
|
||||||
}}/>
|
}}/>
|
||||||
</div>
|
</div>
|
||||||
</ChartFilters>
|
</ChartFilters>
|
||||||
@ -516,10 +516,10 @@ export default function Telemetria({userName, clients}: any) {
|
|||||||
</LocalizationProvider>
|
</LocalizationProvider>
|
||||||
<div className='select'>
|
<div className='select'>
|
||||||
<BasicButton title='Selecionar!' onClick={() => {
|
<BasicButton title='Selecionar!' onClick={() => {
|
||||||
setSend(true)
|
setLoader(true)
|
||||||
getPowerFactorData(unity, startDate, endDate, discretization)
|
getPowerFactorData(unity, startDate, endDate, discretization)
|
||||||
.then(result => {setFatorPotenciaData(result); setSend(false)})
|
.then(result => {setFatorPotenciaData(result); setSend(false); setLoader(false)})
|
||||||
.catch(exception => {setSend(false); setOpenSnackFields(true)})
|
.catch(exception => {setSend(false); setOpenSnackFields(true); setLoader(false)})
|
||||||
}}/>
|
}}/>
|
||||||
</div>
|
</div>
|
||||||
</ChartFilters>
|
</ChartFilters>
|
||||||
@ -578,10 +578,9 @@ export default function Telemetria({userName, clients}: any) {
|
|||||||
</div>
|
</div>
|
||||||
<div style={{marginBottom: '8px'}}>
|
<div style={{marginBottom: '8px'}}>
|
||||||
<BasicButton title='Selecionar!' onClick={() => {
|
<BasicButton title='Selecionar!' onClick={() => {
|
||||||
|
setLoader(true)
|
||||||
setSend(true)
|
setSend(true)
|
||||||
getDemand(unity, startDate, endDate, discretization)
|
getChartData()
|
||||||
.then(result => {setDiscretizedConsumptionData(result); setSend(false)})
|
|
||||||
.catch(exception => {setSend(false); setOpenSnackFields(true)})
|
|
||||||
}}/>
|
}}/>
|
||||||
</div>
|
</div>
|
||||||
</ChartFilters>
|
</ChartFilters>
|
||||||
@ -591,7 +590,7 @@ export default function Telemetria({userName, clients}: any) {
|
|||||||
</RenderIf>
|
</RenderIf>
|
||||||
</RenderIf>
|
</RenderIf>
|
||||||
|
|
||||||
<RenderIf isTrue={startDate.toLocaleDateString()!=='' && endDate.toLocaleDateString()!=='' && tableData===null && exception === false && send}>
|
<RenderIf isTrue={loader}>
|
||||||
<div className='modal'>
|
<div className='modal'>
|
||||||
<div id="preloader_1">
|
<div id="preloader_1">
|
||||||
<span></span>
|
<span></span>
|
||||||
|
|||||||
@ -8,18 +8,14 @@ export async function getDiscretization(
|
|||||||
unity: string,
|
unity: string,
|
||||||
startDate: Date,
|
startDate: Date,
|
||||||
endDate: Date,
|
endDate: Date,
|
||||||
discretization: string
|
discretization: string,
|
||||||
) {
|
) {
|
||||||
const { data } = await api.post('/telemetry/discretization', {
|
const { data } = await api.post('/telemetry/discretization', {
|
||||||
"type": discretization,
|
"type": discretization,
|
||||||
// "type": "1_hora",
|
|
||||||
"filters": [
|
"filters": [
|
||||||
{"type" : "=", "field": "med_5min.ponto", "value": unity},
|
{"type" : "=", "field": "med_5min.ponto", "value": unity},
|
||||||
{"type" : "between", "field": "dia_num", "value": [startDate.toLocaleDateString().split('/').reverse().join('-'), endDate.toLocaleDateString().split('/').reverse().join('-')]}
|
{"type" : "between", "field": "dia_num", "value": [startDate.toLocaleDateString().split('/').reverse().join('-'), endDate.toLocaleDateString().split('/').reverse().join('-')]}
|
||||||
]
|
]
|
||||||
// "filters": [
|
|
||||||
// {"type" : "=", "field": "med_5min.ponto", "value": "RSZFNAENTR101P"}
|
|
||||||
// ]
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -14,12 +14,10 @@ export const TelemetriaView = styled.main`
|
|||||||
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
border-radius: 20px;
|
border-radius: 10px;
|
||||||
|
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
/* margin-top: 10px; */
|
|
||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
||||||
@ -34,7 +32,7 @@ export const TelemetriaView = styled.main`
|
|||||||
left: 0;
|
left: 0;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 150vh;
|
||||||
|
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export const AboutUsView = styled.main`
|
|||||||
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
border-radius: 20px;
|
border-radius: 10px;
|
||||||
|
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export const FaqView = styled.main`
|
|||||||
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
border-radius: 20px;
|
border-radius: 10px;
|
||||||
|
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ export const EconomyView = styled.main`
|
|||||||
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
border-radius: 20px;
|
border-radius: 10px;
|
||||||
|
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export const IndustryInfoView = styled.main`
|
|||||||
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
border-radius: 20px;
|
border-radius: 10px;
|
||||||
|
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export const NewsView = styled.main`
|
|||||||
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
border-radius: 20px;
|
border-radius: 10px;
|
||||||
|
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
|
|||||||
@ -432,7 +432,7 @@ export const PldGraphView = styled.main`
|
|||||||
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-webkit-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
-moz-box-shadow: 0 0 11px rgba(0, 0, 0, 0.2) ;
|
||||||
border-radius: 20px;
|
border-radius: 10px;
|
||||||
|
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user