Merge branch 'administativePages' of https://gitlab.com/kluppsoftware/smart-energia-web into administativePages
This commit is contained in:
commit
65ca7b792a
@ -20,7 +20,7 @@ export const TableView = styled.main`
|
||||
border-radius: 16px;
|
||||
tr {
|
||||
th {
|
||||
font-family: 'poppins';
|
||||
font-family: 'Poppins';
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
color: #6A707E;
|
||||
@ -28,13 +28,13 @@ export const TableView = styled.main`
|
||||
|
||||
td {
|
||||
:nth-child(3) {
|
||||
font-family: 'poppins';
|
||||
font-family: 'Poppins';
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
color: #6A707E;
|
||||
}
|
||||
:nth-child(4) {
|
||||
font-family: 'poppins';
|
||||
font-family: 'Poppins';
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
color: #828282;
|
||||
|
||||
@ -11,7 +11,7 @@ export const LoginButtonView = styled.button`
|
||||
background: rgb(2,0,36);
|
||||
background: linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(37,79,127,1) 35%, rgba(136,136,136,1) 100%);
|
||||
|
||||
font-family: 'Nunito Sans';
|
||||
font-family: 'Poppins';
|
||||
font-weight: 700;
|
||||
font-size: calc(99.98% + 10px);
|
||||
line-height: 44px;
|
||||
|
||||
@ -8,7 +8,7 @@ import PageTitle from '../../../components/pageTitle/PageTitle'
|
||||
import { IndustryInfoView } from '../../../styles/layouts/industryInfo/IndustryInfoView'
|
||||
import InputUploadPdf from '../../../components/inputUploadPdf/inputUpload';
|
||||
import { api } from '../../../services/api'
|
||||
import PdfThumbnail from 'react-pdf-thumbnail';
|
||||
// import PdfThumbnail from 'react-pdf-thumbnail';
|
||||
|
||||
import FormData from 'form-data';
|
||||
|
||||
@ -58,12 +58,12 @@ export default function industryInfo({userName}: any) {
|
||||
<IndustryInfoView>
|
||||
<Snackbar open={openSnackSuccess} autoHideDuration={4000} onClose={handleCloseSnack}>
|
||||
<Alert onClose={handleCloseSnack} severity="success" sx={{ width: '100%' }}>
|
||||
PDF Baixado com Sucesso!
|
||||
PDF enviado com Sucesso!
|
||||
</Alert>
|
||||
</Snackbar>
|
||||
<Snackbar open={openSnackError} autoHideDuration={4000} onClose={handleCloseSnack}>
|
||||
<Alert onClose={handleCloseSnack} severity="error" sx={{ width: '100%' }}>
|
||||
PDF não baixado!
|
||||
Falha ao enviar PDF!
|
||||
</Alert>
|
||||
</Snackbar>
|
||||
<Head>
|
||||
|
||||
@ -64,3 +64,4 @@ export default function ForgotPassword() {
|
||||
</ForgotPasswordView>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ export default function Home() {
|
||||
}else{
|
||||
try {
|
||||
await signIn({email, password}).then((res: any) => {
|
||||
if (res.response.status === 422 || res.response.status === 401) {
|
||||
if (res.response.status === 422 || res.response.status === 401 || res.response.status === 500 ) {
|
||||
setOpenSnackError(true)
|
||||
}
|
||||
})
|
||||
@ -91,8 +91,8 @@ export default function Home() {
|
||||
|
||||
useEffect(() => {
|
||||
setValues({
|
||||
password: null,
|
||||
showPassword: false,
|
||||
password: (''),
|
||||
showPassword: null,
|
||||
});
|
||||
setEmail("")
|
||||
}, [rota])
|
||||
|
||||
@ -36,8 +36,24 @@ 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([csv], {type: "text/csv"});
|
||||
|
||||
const csv_file = new Blob(["\ufeff",csv], {type: "text/csv"});
|
||||
|
||||
const download_link = document.createElement("a");
|
||||
|
||||
@ -63,7 +79,8 @@ export default function ResumoOperacao({tableData, clientsData, userName, client
|
||||
row.push(cols[j].innerText);
|
||||
}
|
||||
|
||||
data.push(row.join(","));
|
||||
|
||||
data.push(row.join(";"));
|
||||
}
|
||||
|
||||
downloadCSVFile(data.join("\n"), filename);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user