From 30d5d5c9e73dcd4cc0b871ddec79faed291fc7cf Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Thu, 24 Apr 2025 15:05:55 +0900 Subject: [PATCH 1/4] =?UTF-8?q?header=20span=20=EC=A4=91=EB=B3=B5=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=83=9D=EC=84=B1=EB=90=98=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/table/HeadMakeColSpan.tsx | 78 +++++++++++-------- .../src/ui/table/index.tsx | 2 +- 2 files changed, 46 insertions(+), 34 deletions(-) diff --git a/packages/common/business_components/src/ui/table/HeadMakeColSpan.tsx b/packages/common/business_components/src/ui/table/HeadMakeColSpan.tsx index cedc0bd7f..dc859a55d 100644 --- a/packages/common/business_components/src/ui/table/HeadMakeColSpan.tsx +++ b/packages/common/business_components/src/ui/table/HeadMakeColSpan.tsx @@ -12,41 +12,53 @@ interface TableUpperProps { const HeadMakeColSpan = ({ upHeadList }: { upHeadList: TableUpperProps[] }) => { const maxRow = upHeadList.reduce((max, head) => Math.max(max, head.row || 0), 0); - return ( - <> - {Array.from({ length: maxRow + 1 }, (_, rowIndex) => ( - + + if(maxRow == 0){ + return ( + <> + {upHeadList.map((head: TableUpperProps) => { - if (head.row === rowIndex) { - return ( - - {head.title} - - ); - }else{ - return ( - - {head.title} - - ); - } - })} + return ( + + {head.title} + + ); + })} - ))} - - ); + + ); + }else{ + return ( + <> + {Array.from({ length: maxRow + 1 }, (_, rowIndex) => ( + + {upHeadList.map((head: TableUpperProps) => { + if (head.row === rowIndex) { + return ( + + {head.title} + + ); + } + })} + + ))} + + ); + } + } export { HeadMakeColSpan }; diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index ae4960a03..45748fb37 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -13,7 +13,7 @@ type UiTableProps = { onPageChange: (page: number) => void; className?: string; resetPageNo?: boolean; - children: React.ReactNode | undefined; + children?: React.ReactNode | undefined; } type UiHeadProps = { From 636337ac46c4c69fc681c949f6392a161803ddd6 Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Thu, 24 Apr 2025 15:24:52 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=20children=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=20=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 | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index 60c457544..45748fb37 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -52,12 +52,9 @@ export function UiTable({ tableData, headlist, pageSize, total, headName, childr : <>}
- {children?children: {children ? children : } - } - {tableData.length > 0 ? tableData?.map((el: { [key: string]: any}, index) => ( From 3de10413cf500e4cd04f57c47dd9a89d7ae5e6bb Mon Sep 17 00:00:00 2001 From: truthwing Date: Thu, 24 Apr 2025 15:27:51 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=ED=97=A4=EB=8D=94=20=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/excel_download/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/common/business_components/src/ui/excel_download/index.tsx b/packages/common/business_components/src/ui/excel_download/index.tsx index 48341bc12..24f8cb4bf 100644 --- a/packages/common/business_components/src/ui/excel_download/index.tsx +++ b/packages/common/business_components/src/ui/excel_download/index.tsx @@ -14,7 +14,7 @@ export const downloadExcel = ({ data, fileName = new Date().getTime().toString() //XLSX.write(workbook, { bookType: "xlsx", type: "binary" }); XLSX.writeFile(workbook, fileName + '.xlsx'); }; -export const filePicked=(oFile: File) =>{ +export const filePicked=(oFile: File, headerNum:number) =>{ // Create A File Reader HTML5 const reader = new FileReader(); @@ -31,7 +31,7 @@ export const filePicked=(oFile: File) =>{ // Obtain The Current Row As CSV const sheet = wb.Sheets[sheetName]; if (sheet) { - const jsonXls = XLSX.utils.sheet_to_json(sheet); + const jsonXls = XLSX.utils.sheet_to_json(sheet, {range:headerNum}); console.log(jsonXls); } else { console.error(`Sheet "${sheetName}" is undefined.`); From fb307527b6837120e52301298041595bb4ee924b Mon Sep 17 00:00:00 2001 From: truthwing Date: Thu, 24 Apr 2025 15:28:37 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=EA=B8=B0=EB=B3=B8=EA=B0=92=200=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=84=A4=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/business_components/src/ui/excel_download/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/business_components/src/ui/excel_download/index.tsx b/packages/common/business_components/src/ui/excel_download/index.tsx index 24f8cb4bf..034643f92 100644 --- a/packages/common/business_components/src/ui/excel_download/index.tsx +++ b/packages/common/business_components/src/ui/excel_download/index.tsx @@ -14,7 +14,7 @@ export const downloadExcel = ({ data, fileName = new Date().getTime().toString() //XLSX.write(workbook, { bookType: "xlsx", type: "binary" }); XLSX.writeFile(workbook, fileName + '.xlsx'); }; -export const filePicked=(oFile: File, headerNum:number) =>{ +export const filePicked=(oFile: File, headerNum:number=0) =>{ // Create A File Reader HTML5 const reader = new FileReader();