From 9a854339ab617fd90cefb54cd52fa91dc3b36f61 Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Wed, 21 May 2025 13:22:00 +0900 Subject: [PATCH 1/5] =?UTF-8?q?lineBarChcart=20=EC=83=81=EB=8B=A8=20?= =?UTF-8?q?=EC=98=81=EC=97=AD=EC=9D=B4=20=EC=83=9D=EA=B8=B0=EB=8A=94=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/business_components/src/ui/chart/LineBarChart.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/common/business_components/src/ui/chart/LineBarChart.tsx b/packages/common/business_components/src/ui/chart/LineBarChart.tsx index 17deacd73..2e83458d8 100644 --- a/packages/common/business_components/src/ui/chart/LineBarChart.tsx +++ b/packages/common/business_components/src/ui/chart/LineBarChart.tsx @@ -130,7 +130,7 @@ export default function LineBarchart({ className="text-[12px] font-bold" tickCount={6} orientation="left" - domain={[0, Math.ceil(lineMaxValue * 1.1)]} + domain={[0, Math.ceil(lineMaxValue * 1)]} label={{ value: yFieldText, angle: -90, position: 'insideLeft' }} />} {/* 오른쪽 Y축: barVal */} @@ -139,7 +139,7 @@ export default function LineBarchart({ className="text-[12px] font-bold" tickCount={6} orientation="right" - domain={[0, Math.ceil(barMaxValue * 1.1)]} + domain={[0, Math.ceil(barMaxValue * 1)]} label={{ value: yFieldText2, angle: -90, position: 'insideRight' }} reversed={true} />} From 56dd0734a0df770d72113b4608a1f775bdca14ad Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Wed, 21 May 2025 16:54:48 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=20number?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EC=84=B8=EC=9E=90=EB=A6=AC=EB=A7=88?= =?UTF-8?q?=EB=8B=A4=20,=20=ED=8F=AC=EB=A7=B7=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/business_components/src/ui/table/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index c9d0bf251..791eddffe 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -72,7 +72,7 @@ export function UiTable({ tableData, headlist, pageSize, total, headName, childr onClick={() => handleCellClick(index, head.id)} key={`cell-${head.id}-${index}`} > - {String(el[head.id]).includes('.') + {typeof el[head.id] !== 'number'?String(el[head.id] ?? ''): String(el[head.id]).includes('.') ? String(el[head.id]).split('.').map((part, index) => index === 0 ? part.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : part ).join('.') @@ -86,7 +86,7 @@ export function UiTable({ tableData, headlist, pageSize, total, headName, childr onClick={() => handleCellClick(index, head.id)} key={`cell-${head.id}-${index}`} > - {String(el[head.id]).includes('.') + {typeof el[head.id] !== 'number'?String(el[head.id] ?? ''): String(el[head.id]).includes('.') ? String(el[head.id]).split('.').map((part, index) => index === 0 ? part.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : part ).join('.') From 07bd859563d03465d81942d121c74476e2d12751 Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Thu, 22 May 2025 16:52:31 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=EC=97=91=EC=85=80=20=EB=8B=A4=EC=A4=91=20?= =?UTF-8?q?=EC=8B=9C=ED=8A=B8=20=EB=B0=8F=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/excel/excelStyle.tsx | 12 ++++++- .../src/ui/excel/index.tsx | 32 +++++++++++++++---- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/packages/common/business_components/src/ui/excel/excelStyle.tsx b/packages/common/business_components/src/ui/excel/excelStyle.tsx index adc21880b..6674720dc 100644 --- a/packages/common/business_components/src/ui/excel/excelStyle.tsx +++ b/packages/common/business_components/src/ui/excel/excelStyle.tsx @@ -47,7 +47,17 @@ export const excelArrayStyle = async (data: ArrayBuffer, range: [typeof sheetPar rangeCells?.style((styleQ)=>{ makeCellStyle(styleQ) }); - } ) + + // 모든 데이터 셀에 세로 가운데 정렬 적용 + if (item.data && item.data.length > 0) { + const numCols = item.data[0]?.length || 0; + const numRows = item.data.length; + const dataRange = workbook.activeSheet(index)?.sheet(index)?.range(`A1:${String.fromCharCode(65 + numCols - 1)}${numRows}`); + dataRange?.style((styleQ) => { + styleQ.verticalAlignment("center"); + }); + } + }); } makeExcelFile(workbook, fileNm) diff --git a/packages/common/business_components/src/ui/excel/index.tsx b/packages/common/business_components/src/ui/excel/index.tsx index e33b0c88d..edc1c707a 100644 --- a/packages/common/business_components/src/ui/excel/index.tsx +++ b/packages/common/business_components/src/ui/excel/index.tsx @@ -15,6 +15,27 @@ export const downloadExcel = ({ data, fileName = new Date().getTime().toString() excelStyle(XLSX.write(workbook, { bookType: "xlsx", type: "buffer" }), headerRange, fileName); }; +export const sheetParameter ={ + data:[[]], headerNum:0, headerRange:'A1:V3', sheetName:'Sheet1', startCol:0 +} + +export const downloadMultipleExcel = (fileName = new Date().getTime().toString() + '.xlsx', sheetArray: Array): Promise => { + const workbook = XLSX.utils.book_new(); + for (let i = 0; i < sheetArray.length; i++) { + // Create a new worksheet for each sheet + const worksheet = XLSX.utils.aoa_to_sheet(sheetArray[i]?.data || [[]]); + // Add data to the worksheet starting from the specified header number + if (sheetArray&&sheetArray[i]?.headerNum) { + XLSX.utils.sheet_add_aoa(worksheet, sheetArray[i]?.data || [[]], { origin: `A${sheetArray[i]?.headerNum}` }); + } + // Append the worksheet to the workbook with the specified sheet name + XLSX.utils.book_append_sheet(workbook, worksheet, sheetArray[i]?.sheetName); + } + if (sheetArray.length > 0) { + excelArrayStyle(XLSX.write(workbook, { bookType: "xlsx", type: "buffer" }), sheetArray, fileName); + } + return Promise.resolve(undefined); +}; export const filePicked=(oFile: File, headerNum:number=0):Promise =>{ @@ -104,7 +125,7 @@ export const filePickedArray=(oFile: File, headerNum:number=0):Promise =>{ // Create A File Reader HTML5 +export const filePickedBlob=(oFile: ArrayBuffer, data:[][],fileNm:string, headerNum:number=0, headerRange='A1:V3', startCol?:number):Promise =>{ // Create A File Reader HTML5 return new Promise(() => { // Ready The Event For When A File Gets Selected const wb = XLSX.read(oFile, { type: 'binary' }); @@ -116,7 +137,8 @@ export const filePickedBlob=(oFile: ArrayBuffer, data:[][],fileNm:string, header if (sheet) { //오리진 확인 test 필요 // const sheet = XLSX.utils.json_to_sheet(data); - XLSX.utils.sheet_add_aoa(sheet, data, { origin: 'A'+headerNum }); + const excelStartCol = startCol?startCol.toString():'A'; + XLSX.utils.sheet_add_aoa(sheet, data, { origin: excelStartCol+headerNum }); // XLSX.utils.book_append_sheet(wb, sheet, 'test'); await excelStyle(XLSX.write(wb, { bookType: "xlsx", type: "buffer" }), headerRange, fileNm) } else { @@ -127,9 +149,6 @@ export const filePickedBlob=(oFile: ArrayBuffer, data:[][],fileNm:string, header }); } -export const sheetParameter ={ - data:[[]], headerNum:0, headerRange:'A1:V3' - } export const filePickedBlobArray= (oFile: ArrayBuffer,fileNm:string, sheetArray: [typeof sheetParameter]):Promise =>{ // Create A File Reader HTML5 return new Promise (async () => { // Ready The Event For When A File Gets Selected @@ -142,7 +161,8 @@ export const sheetParameter ={ if (sheet) { //오리진 확인 test 필요 // const sheet = XLSX.utils.json_to_sheet(data); - XLSX.utils.sheet_add_aoa(sheet, sheetArray[index].data, { origin: 'A'+sheetArray[index].headerNum }); + const startCol = sheetArray[index].startCol?sheetArray[index].startCol.toString():'A'; + XLSX.utils.sheet_add_aoa(sheet, sheetArray[index].data, { origin: startCol+sheetArray[index].headerNum }); // XLSX.utils.book_append_sheet(wb, sheet, 'test'); } else { console.error(`Sheet "${sheetName}" is undefined.`); From 7f7a780b7a1d9aa12a598460ea01ad0f0abdf62c Mon Sep 17 00:00:00 2001 From: swcho Date: Thu, 22 May 2025 16:59:14 +0900 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20filePicked=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=EC=97=90=20dateType=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/business_components/src/ui/excel/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/common/business_components/src/ui/excel/index.tsx b/packages/common/business_components/src/ui/excel/index.tsx index edc1c707a..76b4ba2f9 100644 --- a/packages/common/business_components/src/ui/excel/index.tsx +++ b/packages/common/business_components/src/ui/excel/index.tsx @@ -38,7 +38,7 @@ export const downloadMultipleExcel = (fileName = new Date().getTime().toString() }; -export const filePicked=(oFile: File, headerNum:number=0):Promise =>{ +export const filePicked=(oFile: File, headerNum:number=0, dateType="yyyymmdd"):Promise =>{ // Create A File Reader HTML5 const reader = new FileReader(); return new Promise((resolve, reject) => { @@ -51,7 +51,7 @@ export const filePicked=(oFile: File, headerNum:number=0):Promise Date: Thu, 22 May 2025 17:43:29 +0900 Subject: [PATCH 5/5] =?UTF-8?q?SearchFormRight=20className=20=ED=8C=8C?= =?UTF-8?q?=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/search_form_right/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/common/business_components/src/ui/search_form_right/index.tsx b/packages/common/business_components/src/ui/search_form_right/index.tsx index fda7eefd6..f5a92dde7 100644 --- a/packages/common/business_components/src/ui/search_form_right/index.tsx +++ b/packages/common/business_components/src/ui/search_form_right/index.tsx @@ -1,8 +1,8 @@ import React from 'react'; -function SearchFormRight(props: {children: React.ReactNode}) { +function SearchFormRight(props: {children: React.ReactNode, className?: string}) { return ( -
+
{props.children}
)