update
This commit is contained in:
parent
2631df84f5
commit
891d7acab5
@ -9,7 +9,7 @@ interface PageTitleInterface {
|
|||||||
export default function PageTitle({ title, subtitle }: PageTitleInterface) {
|
export default function PageTitle({ title, subtitle }: PageTitleInterface) {
|
||||||
return (
|
return (
|
||||||
<PageTitleView>
|
<PageTitleView>
|
||||||
<h1>{title}</h1>
|
<h1 style={{fontSize:'2em'}} >{title}</h1>
|
||||||
<p>{subtitle}</p>
|
<p>{subtitle}</p>
|
||||||
</PageTitleView>
|
</PageTitleView>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -36,53 +36,27 @@ export default function ResumoOperacao({tableData, clientsData, userName, client
|
|||||||
setUnidade(event.target.value);
|
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) {
|
function downloadCSVFile(csv, filename) {
|
||||||
|
|
||||||
const csv_file = new Blob(["\ufeff",csv], {type: "text/csv"});
|
const csv_file = new Blob(["\ufeff",csv], {type: "text/csv"});
|
||||||
|
|
||||||
const download_link = document.createElement("a");
|
const download_link = document.createElement("a");
|
||||||
|
|
||||||
download_link.download = filename;
|
download_link.download = filename;
|
||||||
|
|
||||||
download_link.href = window.URL.createObjectURL(csv_file);
|
download_link.href = window.URL.createObjectURL(csv_file);
|
||||||
|
|
||||||
download_link.style.display = "none";
|
download_link.style.display = "none";
|
||||||
|
|
||||||
document.body.appendChild(download_link);
|
document.body.appendChild(download_link);
|
||||||
|
|
||||||
download_link.click();
|
download_link.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
function htmlToCSV(html, filename) {
|
function htmlToCSV(html, filename) {
|
||||||
const data = [];
|
const data = [];
|
||||||
const rows = document.querySelectorAll("table tr");
|
const rows = document.querySelectorAll("table tr");
|
||||||
|
|
||||||
for (let i = 0; i < rows.length; i++) {
|
for (let i = 0; i < rows.length; i++) {
|
||||||
const row = [], cols: any = rows[i].querySelectorAll("td, th");
|
const row = [], cols: any = rows[i].querySelectorAll("td, th");
|
||||||
|
|
||||||
for (let j = 0; j < cols.length; j++) {
|
for (let j = 0; j < cols.length; j++) {
|
||||||
row.push(cols[j].innerText);
|
row.push(cols[j].innerText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
data.push(row.join(";"));
|
data.push(row.join(";"));
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadCSVFile(data.join("\n"), filename);
|
downloadCSVFile(data.join("\n"), filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +97,6 @@ export default function ResumoOperacao({tableData, clientsData, userName, client
|
|||||||
</Head>
|
</Head>
|
||||||
<Header name={userName} />
|
<Header name={userName} />
|
||||||
<PageTitle title='Resumo de Operações' subtitle='Operações detalhadas' />
|
<PageTitle title='Resumo de Operações' subtitle='Operações detalhadas' />
|
||||||
|
|
||||||
<h3>Filtrar por Unidade e/ou Mês</h3>
|
<h3>Filtrar por Unidade e/ou Mês</h3>
|
||||||
<div className='select'>
|
<div className='select'>
|
||||||
<FormControl fullWidth>
|
<FormControl fullWidth>
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import styled from "styled-components";
|
|||||||
export const IndustryInfoView = styled.main`
|
export const IndustryInfoView = styled.main`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
@ -13,17 +12,12 @@ export const IndustryInfoView = styled.main`
|
|||||||
button{
|
button{
|
||||||
height: 70px;
|
height: 70px;
|
||||||
width: 30%;
|
width: 30%;
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
background: #254F7F;
|
background: #254F7F;
|
||||||
|
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border-style: none;
|
border-style: none;
|
||||||
|
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
|
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,36 +44,5 @@ export const IndustryInfoView = styled.main`
|
|||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
border-radius: 6px;
|
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;
|
|
||||||
} */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user