From e991ff8fd7a9512b31e4c9cca12579c179d45a09 Mon Sep 17 00:00:00 2001 From: leoho2fi Date: Fri, 26 Apr 2024 15:34:25 +0800 Subject: [PATCH] report style update --- .../Report/ReportSearchBox/SearchBox.tsx | 16 ++++++++-------- .../Report/ReportSearchBox2/SearchBox2.tsx | 16 ++++++++-------- .../Report/ReportSearchBox3/SearchBox3.tsx | 16 ++++++++-------- .../Report/ReportSearchBox4/SearchBox4.tsx | 16 ++++++++-------- .../Report/ReportSearchBox5/SearchBox5.tsx | 16 ++++++++-------- .../Report/ReportSearchBox6/SearchBox6.tsx | 16 ++++++++-------- 6 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/components/Report/ReportSearchBox/SearchBox.tsx b/src/components/Report/ReportSearchBox/SearchBox.tsx index 26a5016..67af5f2 100644 --- a/src/components/Report/ReportSearchBox/SearchBox.tsx +++ b/src/components/Report/ReportSearchBox/SearchBox.tsx @@ -151,14 +151,6 @@ function SearchBox({ }); }); - // Apply calculated widths to each column, skipping column A - worksheet['!cols'] = colWidths.map((width, index) => { - if (index === 0) { - return { wch: 8 }; // Set default or specific width for column A if needed - } - return { wch: width + 2 }; // Add padding to width - }); - // Style for cell A1: Font size 16 and bold if (worksheet['A1']) { worksheet['A1'].s = { @@ -202,6 +194,14 @@ function SearchBox({ while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { lastRowOfFirstTable++; } + + // Apply calculated widths to each column, skipping column A + worksheet['!cols'] = colWidths.map((width, index) => { + if (index === 0) { + return { wch: 8 }; // Set default or specific width for column A if needed + } + return { wch: width + 2 }; // Add padding to width + }); // Format filename with date const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD diff --git a/src/components/Report/ReportSearchBox2/SearchBox2.tsx b/src/components/Report/ReportSearchBox2/SearchBox2.tsx index 39364dd..7e3d6e9 100644 --- a/src/components/Report/ReportSearchBox2/SearchBox2.tsx +++ b/src/components/Report/ReportSearchBox2/SearchBox2.tsx @@ -151,14 +151,6 @@ function SearchBox({ }); }); - // Apply calculated widths to each column, skipping column A - worksheet['!cols'] = colWidths.map((width, index) => { - if (index === 0) { - return { wch: 8 }; // Set default or specific width for column A if needed - } - return { wch: width + 2 }; // Add padding to width - }); - // Style for cell A1: Font size 16 and bold if (worksheet['A1']) { worksheet['A1'].s = { @@ -202,6 +194,14 @@ function SearchBox({ while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { lastRowOfFirstTable++; } + + // Apply calculated widths to each column, skipping column A + worksheet['!cols'] = colWidths.map((width, index) => { + if (index === 0) { + return { wch: 8 }; // Set default or specific width for column A if needed + } + return { wch: width + 2 }; // Add padding to width + }); // Format filename with date const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD diff --git a/src/components/Report/ReportSearchBox3/SearchBox3.tsx b/src/components/Report/ReportSearchBox3/SearchBox3.tsx index bd524b2..b4a252d 100644 --- a/src/components/Report/ReportSearchBox3/SearchBox3.tsx +++ b/src/components/Report/ReportSearchBox3/SearchBox3.tsx @@ -151,14 +151,6 @@ function SearchBox({ }); }); - // Apply calculated widths to each column, skipping column A - worksheet['!cols'] = colWidths.map((width, index) => { - if (index === 0) { - return { wch: 8 }; // Set default or specific width for column A if needed - } - return { wch: width + 2 }; // Add padding to width - }); - // Style for cell A1: Font size 16 and bold if (worksheet['A1']) { worksheet['A1'].s = { @@ -202,6 +194,14 @@ function SearchBox({ while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { lastRowOfFirstTable++; } + + // Apply calculated widths to each column, skipping column A + worksheet['!cols'] = colWidths.map((width, index) => { + if (index === 0) { + return { wch: 8 }; // Set default or specific width for column A if needed + } + return { wch: width + 2 }; // Add padding to width + }); // Format filename with date const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD diff --git a/src/components/Report/ReportSearchBox4/SearchBox4.tsx b/src/components/Report/ReportSearchBox4/SearchBox4.tsx index 2f57320..1ac6e7e 100644 --- a/src/components/Report/ReportSearchBox4/SearchBox4.tsx +++ b/src/components/Report/ReportSearchBox4/SearchBox4.tsx @@ -151,14 +151,6 @@ function SearchBox({ }); }); - // Apply calculated widths to each column, skipping column A - worksheet['!cols'] = colWidths.map((width, index) => { - if (index === 0) { - return { wch: 8 }; // Set default or specific width for column A if needed - } - return { wch: width + 2 }; // Add padding to width - }); - // Style for cell A1: Font size 16 and bold if (worksheet['A1']) { worksheet['A1'].s = { @@ -202,6 +194,14 @@ function SearchBox({ while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { lastRowOfFirstTable++; } + + // Apply calculated widths to each column, skipping column A + worksheet['!cols'] = colWidths.map((width, index) => { + if (index === 0) { + return { wch: 8 }; // Set default or specific width for column A if needed + } + return { wch: width + 2 }; // Add padding to width + }); // Format filename with date const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD diff --git a/src/components/Report/ReportSearchBox5/SearchBox5.tsx b/src/components/Report/ReportSearchBox5/SearchBox5.tsx index 207e5ff..2b0b7db 100644 --- a/src/components/Report/ReportSearchBox5/SearchBox5.tsx +++ b/src/components/Report/ReportSearchBox5/SearchBox5.tsx @@ -151,14 +151,6 @@ function SearchBox({ }); }); - // Apply calculated widths to each column, skipping column A - worksheet['!cols'] = colWidths.map((width, index) => { - if (index === 0) { - return { wch: 8 }; // Set default or specific width for column A if needed - } - return { wch: width + 2 }; // Add padding to width - }); - // Style for cell A1: Font size 16 and bold if (worksheet['A1']) { worksheet['A1'].s = { @@ -202,6 +194,14 @@ function SearchBox({ while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { lastRowOfFirstTable++; } + + // Apply calculated widths to each column, skipping column A + worksheet['!cols'] = colWidths.map((width, index) => { + if (index === 0) { + return { wch: 8 }; // Set default or specific width for column A if needed + } + return { wch: width + 2 }; // Add padding to width + }); // Format filename with date const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD diff --git a/src/components/Report/ReportSearchBox6/SearchBox6.tsx b/src/components/Report/ReportSearchBox6/SearchBox6.tsx index 82d5df4..4e7c82d 100644 --- a/src/components/Report/ReportSearchBox6/SearchBox6.tsx +++ b/src/components/Report/ReportSearchBox6/SearchBox6.tsx @@ -151,14 +151,6 @@ function SearchBox({ }); }); - // Apply calculated widths to each column, skipping column A - worksheet['!cols'] = colWidths.map((width, index) => { - if (index === 0) { - return { wch: 8 }; // Set default or specific width for column A if needed - } - return { wch: width + 2 }; // Add padding to width - }); - // Style for cell A1: Font size 16 and bold if (worksheet['A1']) { worksheet['A1'].s = { @@ -205,6 +197,14 @@ function SearchBox({ // Insert the first data form into the worksheet at the desired location XLSX.utils.sheet_add_aoa(worksheet, firstTableData, { origin: { c: 0, r: lastRowOfFirstTable } }); + + // Apply calculated widths to each column, skipping column A + worksheet['!cols'] = colWidths.map((width, index) => { + if (index === 0) { + return { wch: 8 }; // Set default or specific width for column A if needed + } + return { wch: width + 2 }; // Add padding to width + }); // Format filename with date const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD