Merge branch 'telemetry' into 'dev'
Telemetry See merge request kluppsoftware/smart-energia-web!122
This commit is contained in:
commit
b8d7fd138c
@ -114,8 +114,6 @@ export function LineBarChart({ title, subtitle, data1, data2, data3, label, red,
|
||||
},
|
||||
};
|
||||
|
||||
console.log(data3)
|
||||
|
||||
const data = data2? {
|
||||
labels: label.length < 28? ['1', '2', '3', '4', '5', '6', '7', '8', '8', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'] : label,
|
||||
datasets: [
|
||||
|
||||
@ -82,8 +82,6 @@ export default function FatorPotenciaChart({ title, subtitle, data1, data2, labe
|
||||
|
||||
const labels = label;
|
||||
|
||||
console.log(data1)
|
||||
|
||||
const data = {
|
||||
labels,
|
||||
datasets: [
|
||||
|
||||
@ -32,8 +32,6 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba
|
||||
function spacement(string) {
|
||||
const spaces = string.length===1?'' : string.length===2? '' : string.length===3? ' ' : string.length===4? ' ' : string.length===5? ' ' : ''
|
||||
|
||||
console.log(string.length)
|
||||
|
||||
return spaces
|
||||
}
|
||||
|
||||
@ -76,13 +74,12 @@ export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, ba
|
||||
},
|
||||
display: true,
|
||||
anchor: "end",
|
||||
offset: !miniature?20 : -30,
|
||||
offset: !miniature?20 : 10,
|
||||
align: "start",
|
||||
font: {
|
||||
size: !miniature? 30 : 10,
|
||||
},
|
||||
color: (value) => {
|
||||
console.log(value.dataset.label)
|
||||
return value.dataset.label==='Consolidada'? '#fff' : '#255488'
|
||||
},
|
||||
},
|
||||
|
||||
@ -46,8 +46,6 @@ export default function GrossMensalChart({ title, data1, data2, label, subtitle,
|
||||
const spaces = string.length===1?'' : string.length===2? '' : string.length===3? ' ' : string.length===4? ' ' : string.length===5? ' ' : ''
|
||||
// const spaces = string.length===1?'' : string.length===2? '⠀⠀⠀⠀' : string.length===3? '⠀⠀⠀' : string.length===4? '⠀⠀' : string.length===5? '⠀' : ''
|
||||
|
||||
console.log(string.length)
|
||||
|
||||
return spaces
|
||||
}
|
||||
|
||||
|
||||
@ -145,15 +145,11 @@ export default function clients({ clients, userName }) {
|
||||
newImageUrls.push(URL.createObjectURL(image))
|
||||
)
|
||||
setImageURLs(newImageUrls)
|
||||
|
||||
console.log('ola')
|
||||
}, [images])
|
||||
|
||||
function onImageChange(e: any) {
|
||||
console.log('olá');
|
||||
setImages([...e.target.files])
|
||||
setLogo(e.target.files[0])
|
||||
console.log(e.target.files[0]);
|
||||
}
|
||||
|
||||
return (
|
||||
@ -315,7 +311,6 @@ export default function clients({ clients, userName }) {
|
||||
<div className="imgContainer">
|
||||
<article>
|
||||
{imageURLS.map((imageSrc, index) => {
|
||||
console.log('olá')
|
||||
return <Image
|
||||
src={imageSrc}
|
||||
key={index}
|
||||
|
||||
@ -25,7 +25,6 @@ export default function industryInfo({userName, pdfUrl}: any) {
|
||||
|
||||
const [pdf, setPdf] = useState<any>();
|
||||
function onChange(e) {
|
||||
console.log(e.target.files)
|
||||
setPdf(e.target.files[0])
|
||||
}
|
||||
|
||||
@ -55,7 +54,7 @@ export default function industryInfo({userName, pdfUrl}: any) {
|
||||
api.get('/download').then(res => {
|
||||
window.open(res.data.path);
|
||||
}).catch(res => {
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
})
|
||||
}
|
||||
|
||||
@ -79,7 +78,7 @@ export default function industryInfo({userName, pdfUrl}: any) {
|
||||
<PageTitle title='Info Setorial' subtitle='Realize o upload da última versão de info setorial' />
|
||||
<form action="">
|
||||
<label htmlFor="">Escolher arquivo</label>
|
||||
<input type="file" name='arquivo' id='arquivo' onChange={onChange}/>
|
||||
<input type="file" name='arquivo' placeholder='' id='arquivo' onChange={onChange}/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -107,7 +106,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
apiClient.get('/download').then(res => {
|
||||
pdfUrl = res.data.path
|
||||
}).catch(res => {
|
||||
console.log('exception', res)
|
||||
// console.log('exception', res)
|
||||
})
|
||||
|
||||
if (!token) {
|
||||
|
||||
@ -43,7 +43,6 @@ export default function CostIndicator({graphData, userName, clients}: any) {
|
||||
]
|
||||
}:{}).then(res => {
|
||||
setGraphDataState(res.data.data)
|
||||
console.log()
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
@ -113,7 +112,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
"codigo_scde"],
|
||||
"distinct": true
|
||||
}).then(res => {
|
||||
console.log(res.data.data)
|
||||
clients = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
|
||||
@ -105,15 +105,15 @@ export default function economy({userName, anual, years, brutaMensal, yearsBruta
|
||||
</TableHeader>
|
||||
{
|
||||
economyMenu === 0?
|
||||
<p style={{marginLeft: '3%'}}>Economia Bruta Anual - Valores em R$ x mil</p>
|
||||
<p style={{marginLeft: '3%'}}>Economia Bruta Estimada e Acumulada Anual - Valores em R$ x mil</p>
|
||||
:
|
||||
economyMenu === 1?
|
||||
<p style={{marginLeft: '3%'}}>Economia Bruta Mensal - Valores em R$ x mil</p>
|
||||
<p style={{marginLeft: '3%'}}>Economia Bruta Estimada e Acumulada Anual - Valores em R$ x mil</p>
|
||||
:
|
||||
economyMenu === 2?
|
||||
<p style={{marginLeft: '3%'}}>Economia Estimada x Consolidada - Valores em R$ x mil</p>
|
||||
<p style={{marginLeft: '3%'}}>Comparativo de Custo Estimado - Valores em R$ x mil</p>
|
||||
:
|
||||
<p style={{marginLeft: '3%'}}>Economia Custo R$/MWH - Valores em R$ x mil</p>
|
||||
<p style={{marginLeft: '3%'}}>Indicador de Custo - Valores em R$/MWh</p>
|
||||
}
|
||||
{
|
||||
typeof window === 'undefined' || typeof window === undefined? null :
|
||||
@ -141,7 +141,7 @@ export default function economy({userName, anual, years, brutaMensal, yearsBruta
|
||||
|
||||
<RenderIf isTrue={economyMenu===2}>
|
||||
<div style={{paddingLeft: '3%'}}>
|
||||
<FormControl sx={{ m: 1, minWidth: 120, width: 200, height: '64px' }} size="small">
|
||||
<FormControl sx={{ m: 1, minWidth: 120, width: 200, height: '65px'}} size="small">
|
||||
<InputLabel id="demo-select-small">Unidade</InputLabel>
|
||||
<Select
|
||||
labelId="demo-select-small"
|
||||
@ -248,7 +248,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
"codigo_scde"],
|
||||
"distinct": true
|
||||
}).then(res => {
|
||||
console.log(res.data.data)
|
||||
clients = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
|
||||
@ -30,7 +30,6 @@ export default function EstimatedCost({graphData, userName, clients}: any) {
|
||||
]
|
||||
}:{}).then(res => {
|
||||
setGraphDataState(res.data.data)
|
||||
console.log()
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
})
|
||||
@ -92,7 +91,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
"codigo_scde"],
|
||||
"distinct": true
|
||||
}).then(res => {
|
||||
console.log(res.data.data)
|
||||
clients = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
|
||||
@ -124,7 +124,7 @@ export default function Home() {
|
||||
|
||||
|
||||
<TextField id="outlined-basic"
|
||||
sx={{ m: 1, width: '90%' }} label="Login" value={email} variant="outlined" onKeyDown={(e) => e.key==='Enter'? console.log(field.current.children[0].focus()) : null}
|
||||
sx={{ m: 1, width: '90%' }} label="Login" value={email} variant="outlined" onKeyDown={(e) => e.key==='Enter'? field.current.children[0].focus() : null}
|
||||
onChange={value => {
|
||||
setEmail(value.target.value.toLowerCase())
|
||||
}}/>
|
||||
|
||||
@ -62,7 +62,6 @@ export default function pld({tableData, userName, clientMonth}: pldInterface) {
|
||||
|
||||
function getPageYAfterScroll(){
|
||||
setPageYPosition(window.scrollY);
|
||||
console.log(window.scrollY)
|
||||
}
|
||||
|
||||
const handleChange = (event: SelectChangeEvent) => {
|
||||
@ -70,18 +69,14 @@ export default function pld({tableData, userName, clientMonth}: pldInterface) {
|
||||
};
|
||||
const handleChangeDay = (event: SelectChangeEvent) => {
|
||||
setMonth(event.target.value);
|
||||
console.log(new Date().toLocaleDateString().slice(3, 10))
|
||||
console.log('select', event.target.value)
|
||||
};
|
||||
|
||||
const handleChangeDate = (newValue: Date | null) => {
|
||||
setDate(newValue)
|
||||
|
||||
console.log(newValue.toLocaleDateString().replace('/', '-').split('-').reverse().join('-'))
|
||||
};
|
||||
|
||||
function getDataByDay() {
|
||||
console.log(month)
|
||||
api.post('/pld/daily', {
|
||||
"filters": [
|
||||
{"type" : "=", "field" : "year_month_formatted", "value": month},
|
||||
@ -91,7 +86,7 @@ export default function pld({tableData, userName, clientMonth}: pldInterface) {
|
||||
}).then(res => {
|
||||
setDataByDay(res.data.data)
|
||||
}).catch(exception => {
|
||||
console.log(exception)
|
||||
// console.log(exception)
|
||||
})
|
||||
}
|
||||
|
||||
@ -201,7 +196,6 @@ export default function pld({tableData, userName, clientMonth}: pldInterface) {
|
||||
useEffect(() => {
|
||||
getDataByHour()
|
||||
getDataByDay()
|
||||
console.log(month)
|
||||
}, [date, month, select])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@ -44,7 +44,6 @@ export default function ResumoOperacao({tableData, clients, userName, clientMont
|
||||
|
||||
function getPageYAfterScroll(){
|
||||
setPageYPosition(window.scrollY);
|
||||
console.log(window.scrollY)
|
||||
}
|
||||
|
||||
function downloadCSVFile(csv, filename) {
|
||||
@ -71,7 +70,6 @@ export default function ResumoOperacao({tableData, clients, userName, clientMont
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log(unidade)
|
||||
if (unidade!=='' || month!==''){
|
||||
api.post('/operation/summary', month && !unidade? {
|
||||
"filters": [
|
||||
@ -91,7 +89,7 @@ export default function ResumoOperacao({tableData, clients, userName, clientMont
|
||||
} : {}
|
||||
).then(res => {
|
||||
setTableDataState(res.data.data)
|
||||
}).catch(res => console.log(res))
|
||||
})
|
||||
} else {
|
||||
setTableDataState(tableData)
|
||||
}
|
||||
@ -249,7 +247,6 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
"codigo_scde"],
|
||||
"distinct": true
|
||||
}).then(res => {
|
||||
console.log(res.data)
|
||||
clients = res.data.data
|
||||
}).catch(res => {
|
||||
// console.log(res)
|
||||
|
||||
@ -113,16 +113,12 @@ export default function Telemetria({userName, clients}: any) {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const handleChangeStartDate = (newValue: Date | null) => {
|
||||
console.log(newValue)
|
||||
setStartDate(newValue)
|
||||
};
|
||||
const handleChangeEndDate = (newValue: Date | null) => {
|
||||
console.log(newValue)
|
||||
setEndDate(newValue)
|
||||
};
|
||||
|
||||
console.log(currentDate.slice(0, 8) + '01')
|
||||
|
||||
const [demRegXDemCon2, setDemRegXDemCon2] = useState([]);
|
||||
|
||||
async function getTableData() {
|
||||
|
||||
@ -82,7 +82,4 @@ export async function logout() {
|
||||
await api.post('/auth/logout', {})
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
.then(res => {})
|
||||
.catch(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
|
||||
@ -10,7 +10,6 @@ export async function getDiscretization(
|
||||
endDate: Date,
|
||||
discretization: string
|
||||
) {
|
||||
console.log(new Date(startDate).toLocaleDateString().split('/').reverse().join('-'), endDate.toLocaleDateString())
|
||||
const { data } = await api.post('/telemetry/discretization', {
|
||||
"type": discretization,
|
||||
// "type": "1_hora",
|
||||
|
||||
@ -40,11 +40,18 @@ export const GlobalStyle = createGlobalStyle`
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* .MuiInputLabel-outlined {
|
||||
margin-top: 11px;
|
||||
}
|
||||
.Mui-focused {
|
||||
margin-top: 0!important;
|
||||
} */
|
||||
|
||||
.datePicker {
|
||||
.MuiOutlinedInput-input, .MuiInputBase-input, .MuiInputBase-inputAdornedEnd, .css-nxo287-MuiInputBase-input-MuiOutlinedInput-input {
|
||||
padding: 0 0 0 15px;
|
||||
width: 100%;
|
||||
height: 63px;
|
||||
height: 63px!important;
|
||||
}
|
||||
.css-1u3bzj6-MuiFormControl-root-MuiTextField-root,
|
||||
.css-o9k5xi-MuiInputBase-root-MuiOutlinedInput-root,
|
||||
|
||||
@ -188,9 +188,12 @@ export const TelemetriaView = styled.main`
|
||||
}
|
||||
|
||||
.input {
|
||||
.MuiInputLabel-root, .MuiInputLabel-formControl {
|
||||
.MuiInputLabel-outlined {
|
||||
margin-top: 11px;
|
||||
}
|
||||
.Mui-focused {
|
||||
margin-top: 0!important;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
|
||||
@ -13,20 +13,23 @@ export const EconomyView = styled.main`
|
||||
|
||||
margin-top: 10px;
|
||||
|
||||
.MuiInputLabel-root, .MuiInputLabel-formControl {
|
||||
margin-top: 11px;
|
||||
}
|
||||
|
||||
section {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.MuiInputLabel-outlined {
|
||||
margin-top: 11px;
|
||||
}
|
||||
.Mui-focused {
|
||||
margin-top: 0!important;
|
||||
}
|
||||
|
||||
.chartBox {
|
||||
}
|
||||
|
||||
input {
|
||||
/* input {
|
||||
width: 16.6rem;
|
||||
height: 63px!important;
|
||||
|
||||
@ -37,5 +40,5 @@ export const EconomyView = styled.main`
|
||||
border: solid gray 1px;
|
||||
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
} */
|
||||
`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user