fix
This commit is contained in:
parent
a8dd640f39
commit
fc460bf343
@ -10,23 +10,23 @@ import TablePagination from '@mui/material/TablePagination';
|
|||||||
import TableRow from '@mui/material/TableRow';
|
import TableRow from '@mui/material/TableRow';
|
||||||
import TableSortLabel from '@mui/material/TableSortLabel';
|
import TableSortLabel from '@mui/material/TableSortLabel';
|
||||||
import { visuallyHidden } from '@mui/utils';
|
import { visuallyHidden } from '@mui/utils';
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import Image from 'next/image'
|
import Image from 'next/image';
|
||||||
|
|
||||||
import Snackbar from '@mui/material/Snackbar';
|
|
||||||
import MuiAlert, { AlertProps } from '@mui/material/Alert';
|
import MuiAlert, { AlertProps } from '@mui/material/Alert';
|
||||||
|
import Snackbar from '@mui/material/Snackbar';
|
||||||
|
|
||||||
import Modal from '@mui/material/Modal';
|
import Modal from '@mui/material/Modal';
|
||||||
|
|
||||||
import FormData from 'form-data'
|
import { FormControl, InputLabel, MenuItem, Select, TextField, Typography } from '@mui/material';
|
||||||
import { InputUploadView } from '../inputUploadImg/inputUploadView'
|
import FormData from 'form-data';
|
||||||
import { FormControl, InputLabel, MenuItem, Select, TextField, Typography } from '@mui/material'
|
import { InputUploadView } from '../inputUploadImg/inputUploadView';
|
||||||
|
|
||||||
import { TableView, StyledStatus } from './TableView';
|
|
||||||
import { api } from '../../services/api';
|
import { api } from '../../services/api';
|
||||||
import FaqButton1 from '../buttons/faqButton/FaqButton1';
|
import FaqButton1 from '../buttons/faqButton/FaqButton1';
|
||||||
import FaqButton2 from '../buttons/faqButton/FaqButton2';
|
import FaqButton2 from '../buttons/faqButton/FaqButton2';
|
||||||
|
import { StyledStatus, TableView } from './TableView';
|
||||||
|
|
||||||
const style = {
|
const style = {
|
||||||
position: 'absolute' as const,
|
position: 'absolute' as const,
|
||||||
@ -107,19 +107,19 @@ const headCells: readonly HeadCell[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'name',
|
id: 'name',
|
||||||
numeric: true,
|
numeric: false,
|
||||||
disablePadding: false,
|
disablePadding: false,
|
||||||
label: 'name',
|
label: 'name',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'unity',
|
id: 'unity',
|
||||||
numeric: true,
|
numeric: false,
|
||||||
disablePadding: false,
|
disablePadding: false,
|
||||||
label: 'unity',
|
label: 'unity',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'status',
|
id: 'status',
|
||||||
numeric: true,
|
numeric: false,
|
||||||
disablePadding: false,
|
disablePadding: false,
|
||||||
label: 'status',
|
label: 'status',
|
||||||
},
|
},
|
||||||
@ -189,7 +189,7 @@ interface ClientsTableInterface {
|
|||||||
|
|
||||||
export default function ClientTable({ clients, onChange }: ClientsTableInterface) {
|
export default function ClientTable({ clients, onChange }: ClientsTableInterface) {
|
||||||
const [order, setOrder] = useState<Order>('asc');
|
const [order, setOrder] = useState<Order>('asc');
|
||||||
const [orderBy, setOrderBy] = useState<keyof Data | string>('status');
|
const [orderBy, setOrderBy] = useState<keyof Data | string>('asc');
|
||||||
const [selected, setSelected] = useState<readonly string[]>([]);
|
const [selected, setSelected] = useState<readonly string[]>([]);
|
||||||
const [page, setPage] = useState<number>(0);
|
const [page, setPage] = useState<number>(0);
|
||||||
const [dense, setDense] = useState<boolean>(false);
|
const [dense, setDense] = useState<boolean>(false);
|
||||||
@ -202,7 +202,6 @@ export default function ClientTable({clients, onChange}: ClientsTableInterface)
|
|||||||
const handleOpen = () => setOpen(true);
|
const handleOpen = () => setOpen(true);
|
||||||
const handleClose = () => setOpen(false);
|
const handleClose = () => setOpen(false);
|
||||||
|
|
||||||
const [cod_client, setCod_client] = useState()
|
|
||||||
const [units, setUnits] = useState([])
|
const [units, setUnits] = useState([])
|
||||||
|
|
||||||
function getClientUnits(client_id: number) {
|
function getClientUnits(client_id: number) {
|
||||||
@ -296,7 +295,7 @@ export default function ClientTable({clients, onChange}: ClientsTableInterface)
|
|||||||
const [imageURLS, setImageURLs] = useState([])
|
const [imageURLS, setImageURLs] = useState([])
|
||||||
const [images, setImages] = useState([] as any)
|
const [images, setImages] = useState([] as any)
|
||||||
const [nivelAcess, setnivelAcess] = useState<any>(2);
|
const [nivelAcess, setnivelAcess] = useState<any>(2);
|
||||||
const [openEditUserModal, setOpenEditUserModal] = useState<any>(2);
|
const [openEditUserModal, setOpenEditUserModal] = useState<any>(false);
|
||||||
|
|
||||||
const [selectedClient, setSelectedClient] = useState<any>(2);
|
const [selectedClient, setSelectedClient] = useState<any>(2);
|
||||||
|
|
||||||
|
|||||||
@ -1,29 +1,29 @@
|
|||||||
|
import MuiAlert, { AlertProps } from '@mui/material/Alert'
|
||||||
import Box from '@mui/material/Box'
|
import Box from '@mui/material/Box'
|
||||||
import Modal from '@mui/material/Modal'
|
import Modal from '@mui/material/Modal'
|
||||||
|
import Snackbar from '@mui/material/Snackbar'
|
||||||
import TextField from '@mui/material/TextField'
|
import TextField from '@mui/material/TextField'
|
||||||
import Typography from '@mui/material/Typography'
|
import Typography from '@mui/material/Typography'
|
||||||
import React, { useState, useEffect } from 'react'
|
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import Snackbar from '@mui/material/Snackbar'
|
import React, { useEffect, useState } from 'react'
|
||||||
import MuiAlert, { AlertProps } from '@mui/material/Alert'
|
|
||||||
import ClientsTable from '../../../components/administrativeTables/ClientsTable'
|
import ClientsTable from '../../../components/administrativeTables/ClientsTable'
|
||||||
import BasicButton from '../../../components/buttons/basicButton/BasicButton'
|
import BasicButton from '../../../components/buttons/basicButton/BasicButton'
|
||||||
import FaqButton1 from '../../../components/buttons/faqButton/FaqButton1'
|
import FaqButton1 from '../../../components/buttons/faqButton/FaqButton1'
|
||||||
import FaqButton2 from '../../../components/buttons/faqButton/FaqButton2'
|
import FaqButton2 from '../../../components/buttons/faqButton/FaqButton2'
|
||||||
import Header from '../../../components/header/Header'
|
import Header from '../../../components/header/Header'
|
||||||
|
|
||||||
import { ClientsView } from '../../../styles/layouts/clients/ClientsView'
|
|
||||||
import PageTitle from '../../../components/pageTitle/PageTitle'
|
|
||||||
import ConfirmModal from '../../../components/modal/ConfirmModal'
|
|
||||||
import { ConfirmModalView } from '../../../styles/layouts/modals/confirmModalView'
|
|
||||||
import { api } from '../../../services/api'
|
|
||||||
import { parseCookies } from 'nookies'
|
|
||||||
import { GetServerSideProps } from 'next'
|
import { GetServerSideProps } from 'next'
|
||||||
|
import { parseCookies } from 'nookies'
|
||||||
|
import ConfirmModal from '../../../components/modal/ConfirmModal'
|
||||||
|
import PageTitle from '../../../components/pageTitle/PageTitle'
|
||||||
|
import { api } from '../../../services/api'
|
||||||
import getAPIClient from '../../../services/ssrApi'
|
import getAPIClient from '../../../services/ssrApi'
|
||||||
|
import { ClientsView } from '../../../styles/layouts/clients/ClientsView'
|
||||||
|
import { ConfirmModalView } from '../../../styles/layouts/modals/confirmModalView'
|
||||||
|
|
||||||
|
import { FormControl, InputLabel, MenuItem, Select } from '@mui/material'
|
||||||
import FormData from 'form-data'
|
import FormData from 'form-data'
|
||||||
import { InputUploadView } from '../../../components/inputUploadImg/inputUploadView'
|
import { InputUploadView } from '../../../components/inputUploadImg/inputUploadView'
|
||||||
import { FormControl, InputLabel, MenuItem, Select } from '@mui/material'
|
|
||||||
|
|
||||||
const style = {
|
const style = {
|
||||||
position: 'absolute' as const,
|
position: 'absolute' as const,
|
||||||
@ -70,6 +70,7 @@ export default function clients({ clients, userName }) {
|
|||||||
const [nivelAcess, setnivelAcess] = useState<any>(2);
|
const [nivelAcess, setnivelAcess] = useState<any>(2);
|
||||||
const [openSnackSuccess, setOpenSnackSuccess] = useState<boolean>(false)
|
const [openSnackSuccess, setOpenSnackSuccess] = useState<boolean>(false)
|
||||||
const [openSnackError, setOpenSnackError] = useState<boolean>(false)
|
const [openSnackError, setOpenSnackError] = useState<boolean>(false)
|
||||||
|
const [openSnackWarning, setOpenSnackWarning] = useState<boolean>(false)
|
||||||
const [openSnackSuccessDelete, setOpenSnackSuccessDelete] =
|
const [openSnackSuccessDelete, setOpenSnackSuccessDelete] =
|
||||||
useState<boolean>(false)
|
useState<boolean>(false)
|
||||||
const [openSnackErrorDelete, setOpenSnackErrorDelete] =
|
const [openSnackErrorDelete, setOpenSnackErrorDelete] =
|
||||||
@ -114,6 +115,9 @@ export default function clients({ clients, userName }) {
|
|||||||
formData.append('profile_picture', logo)
|
formData.append('profile_picture', logo)
|
||||||
formData.append('role', nivelAcess)
|
formData.append('role', nivelAcess)
|
||||||
|
|
||||||
|
if (!name.length || !email.length || !password.length || !password_confirmation.length || !client_id.length || !logo || !nivelAcess.length)
|
||||||
|
setOpenSnackWarning(true)
|
||||||
|
|
||||||
api.post('/user', formData)
|
api.post('/user', formData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
setOpenSnackSuccess(true)
|
setOpenSnackSuccess(true)
|
||||||
@ -152,12 +156,6 @@ export default function clients({ clients, userName }) {
|
|||||||
setLogo(e.target.files[0])
|
setLogo(e.target.files[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
console.table(clients.map(client => {
|
|
||||||
if (Number.parseInt(client.client_id) === 59641651) return client
|
|
||||||
return
|
|
||||||
}))
|
|
||||||
console.table(clients[417])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', width: '100%' }}>
|
<div style={{ display: 'flex', flexDirection: 'column', width: '100%' }}>
|
||||||
<Snackbar
|
<Snackbar
|
||||||
@ -186,6 +184,19 @@ export default function clients({ clients, userName }) {
|
|||||||
Cliente não cadastrado!
|
Cliente não cadastrado!
|
||||||
</Alert>
|
</Alert>
|
||||||
</Snackbar>
|
</Snackbar>
|
||||||
|
<Snackbar
|
||||||
|
open={openSnackWarning}
|
||||||
|
autoHideDuration={4000}
|
||||||
|
onClose={handleCloseSnack}
|
||||||
|
>
|
||||||
|
<Alert
|
||||||
|
onClose={handleCloseSnack}
|
||||||
|
severity="warning"
|
||||||
|
sx={{ width: '100%' }}
|
||||||
|
>
|
||||||
|
Preencha todos os campos!
|
||||||
|
</Alert>
|
||||||
|
</Snackbar>
|
||||||
|
|
||||||
<Snackbar
|
<Snackbar
|
||||||
open={openSnackSuccessDelete}
|
open={openSnackSuccessDelete}
|
||||||
|
|||||||
@ -39,7 +39,9 @@ const style = {
|
|||||||
boxShadow: 24,
|
boxShadow: 24,
|
||||||
p: 4,
|
p: 4,
|
||||||
|
|
||||||
borderRadius: 3
|
borderRadius: 3,
|
||||||
|
|
||||||
|
overflow: 'scroll'
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Dashboard({ grossAnualGraph, grossAnualYears, grossMensalGraph, grossMensalYears, acumulatedGraph, mapsInfo, userName, costIndicator }: any) {
|
export default function Dashboard({ grossAnualGraph, grossAnualYears, grossMensalGraph, grossMensalYears, acumulatedGraph, mapsInfo, userName, costIndicator }: any) {
|
||||||
@ -157,6 +159,44 @@ export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensal
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Typography id="modal-modal-description" sx={{ mt: 2 }}>
|
<Typography id="modal-modal-description" sx={{ mt: 2 }}>
|
||||||
<p>
|
<p>
|
||||||
|
Bem-vindo ao Smart Energy View, a Plataforma Web da SMART ENERGIA!
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Agora você terá a Gestão da sua Energia na palma da sua mão!!!!
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Visualize os principais indicadores, dados de economia, resumo de operações, PLD, notícias além de acompanhar o consumo de energia em intervalos mínimos de 5 minutos.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Estamos na última fase de testes da plataforma e em breve também iremos disponibilizar os aplicativos para seu celular, nos sistemas operacionais IOS e Android.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Encontrando qualquer dificuldade, eventuais inconsistências ou dúvidas, nos contate!
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Lembrando que conforme nosso contrato de serviços vigente, todas as informações entregues são estritamente privadas, sendo seu sigilo protegido por lei, não podendo ser compartilhadas com terceiros sendo destinadas a seu uso exclusivo.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
A divulgação não autorizada das informações adquiridas nesta plataforma (ou seu uso), de forma integral ou parcial, é proibida, não sendo permitido o compartilhamento dos acessos e senhas ou qualquer informação que tiver acesso junto a esta plataforma, sendo que o acesso a esta plataforma é restrito e individual.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Destacamos que os resultados informados são meramente indicativos, não vinculantes a resultados e que as premissas disponibilizadas na plataforma são as mesmas utilizadas nos Energys Reports e estudos encaminhados.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<strong>Aproveite essa nova ferramenta de acompanhar sua Gestão de Energia!</strong>
|
||||||
|
</p>
|
||||||
|
{/* <p>
|
||||||
Bem-vindo a Plataforma Web – SMART ENERGIA!
|
Bem-vindo a Plataforma Web – SMART ENERGIA!
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@ -170,7 +210,7 @@ export default function Dashboard({grossAnualGraph, grossAnualYears, grossMensal
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Ressaltamos que os resultados informados são meramente indicativos.
|
Ressaltamos que os resultados informados são meramente indicativos.
|
||||||
</p>
|
</p> */}
|
||||||
<BasicButton title="Aceito os termos" onClick={() => {
|
<BasicButton title="Aceito os termos" onClick={() => {
|
||||||
setCookie(undefined, 'terms', 'true')
|
setCookie(undefined, 'terms', 'true')
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
|
|||||||
@ -41,7 +41,7 @@ const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
|||||||
})
|
})
|
||||||
|
|
||||||
export default function Telemetria({ userName, clients }: any) {
|
export default function Telemetria({ userName, clients }: any) {
|
||||||
const [unity, setUnity] = useState(clients[0].codigo_scde);
|
const [unity, setUnity] = useState(clients[0]?.codigo_scde);
|
||||||
const [startDate, setStartDate] = useState(new Date());
|
const [startDate, setStartDate] = useState(new Date());
|
||||||
const [endDate, setEndDate] = useState(new Date());
|
const [endDate, setEndDate] = useState(new Date());
|
||||||
const [month, setMonth] = useState(new Date().getMonth() + 1);
|
const [month, setMonth] = useState(new Date().getMonth() + 1);
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import axios, { AxiosRequestConfig } from "axios";
|
import axios from "axios";
|
||||||
import * as cookie from 'cookie';
|
|
||||||
import * as express from 'express';
|
import * as express from 'express';
|
||||||
import * as next from 'next';
|
import * as next from 'next';
|
||||||
import { parseCookies } from "nookies";
|
import { parseCookies } from "nookies";
|
||||||
@ -13,7 +12,8 @@ export default function getAPIClient(ctx?: Pick<next.NextPageContext, 'req'> | {
|
|||||||
const { '@smartAuth-token': token } = parseCookies(ctx)
|
const { '@smartAuth-token': token } = parseCookies(ctx)
|
||||||
|
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
baseURL: "https://api.energiasmart.com.br/api",
|
// baseURL: "https://api.energiasmart.com.br/api",
|
||||||
|
baseURL: "https://api.energiasmart.klupp.com.br/api",
|
||||||
});
|
});
|
||||||
|
|
||||||
api.interceptors.request.use(config => {
|
api.interceptors.request.use(config => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user