@@ -457,15 +457,11 @@ function populateTableOfContents(tocSheet, sheetNames) {
457457 // 기존 내용 모두 삭제
458458 tocSheet . spliceRows ( 1 , tocSheet . rowCount ) ;
459459
460- // 헤더 추가 (쿼리문 컬럼 추가 )
461- tocSheet . addRow ( [ 'No' , msg . sheetName , msg . records , 'Aggregate Info' , 'Query' , 'Note '] ) ;
460+ // 헤더 추가 (원본 시트명/ 쿼리문 컬럼 포함, Note 제거 )
461+ tocSheet . addRow ( [ 'No' , msg . sheetName , 'Original Name' , msg . records , 'Aggregate Info' , 'Query' ] ) ;
462462
463463 // 시트 목록 추가
464464 sheetNames . forEach ( ( obj , idx ) => {
465- // 시트명이 잘렸는지 확인
466- const isTruncated = obj . originalName && obj . originalName !== obj . tabName ;
467- const noteText = isTruncated ? '(31자 초과로 잘림)' : '' ;
468-
469465 // 집계 정보 텍스트 생성 (템플릿 사용)
470466 let aggregateInfo = '' ;
471467
@@ -523,7 +519,14 @@ function populateTableOfContents(tocSheet, sheetNames) {
523519 }
524520 }
525521
526- const row = tocSheet . addRow ( [ idx + 1 , obj . displayName , obj . recordCount || 0 , aggregateInfo , queryText ] ) ;
522+ const row = tocSheet . addRow ( [
523+ idx + 1 ,
524+ obj . displayName ,
525+ obj . originalName || '' ,
526+ obj . recordCount || 0 ,
527+ aggregateInfo ,
528+ queryText
529+ ] ) ;
527530
528531 // 하이퍼링크 설정 - 실제 시트명(tabName) 사용
529532 const sheetNameForLink = obj . tabName . replace ( / ' / g, "''" ) ; // 작은따옴표 이스케이프
@@ -559,8 +562,8 @@ function populateTableOfContents(tocSheet, sheetNames) {
559562 }
560563 }
561564
562- // 데이터 건수 스타일링 및 하이퍼링크
563- const recordCountCell = row . getCell ( 3 ) ;
565+ // 데이터 건수 스타일링 및 하이퍼링크 (이제 4번째 컬럼)
566+ const recordCountCell = row . getCell ( 4 ) ;
564567 const recordCountText = ( obj . recordCount || 0 ) . toString ( ) ;
565568
566569 // 데이터 건수에도 하이퍼링크 적용
@@ -595,8 +598,8 @@ function populateTableOfContents(tocSheet, sheetNames) {
595598 recordCountCell . numFmt = '#,##0' ; // 천 단위 구분자
596599 recordCountCell . alignment = { horizontal : 'right' } ;
597600
598- // 집계 데이터 컬럼에 하이퍼링크 적용
599- const aggregateCell = row . getCell ( 4 ) ;
601+ // 집계 데이터 컬럼에 하이퍼링크 적용 (이제 5번째 컬럼)
602+ const aggregateCell = row . getCell ( 5 ) ;
600603 if ( aggregateInfo ) {
601604 // 집계 정보에도 하이퍼링크 적용
602605 const aggregateFormula = `HYPERLINK("#'${ sheetNameForLink } '!A1","${ aggregateInfo . replace ( / " / g, '""' ) } ")` ;
@@ -639,8 +642,8 @@ function populateTableOfContents(tocSheet, sheetNames) {
639642 aggregateCell . font = { color : { argb : '999999' } } ;
640643 }
641644
642- // 쿼리문 컬럼 스타일링 (5번째 컬럼)
643- const queryCell = row . getCell ( 5 ) ;
645+ // 쿼리문 컬럼 스타일링 (이제 6번째 컬럼)
646+ const queryCell = row . getCell ( 6 ) ;
644647 if ( queryText ) {
645648 queryCell . font = {
646649 size : 9 ,
@@ -655,35 +658,16 @@ function populateTableOfContents(tocSheet, sheetNames) {
655658 queryCell . value = '' ;
656659 queryCell . font = { color : { argb : '999999' } } ;
657660 }
658-
659- // 비고 컬럼 스타일링 (6번째 컬럼)
660- if ( isTruncated ) {
661- row . getCell ( 6 ) . font = {
662- italic : true ,
663- color : { argb : 'D2691E' } // 주황색으로 경고 표시
664- } ;
665-
666- // 원본 시트명을 셀 주석으로 추가
667- row . getCell ( 2 ) . note = {
668- texts : [
669- { text : msg . originalSheetName , font : { bold : true } } ,
670- { text : obj . originalName , font : { italic : true } } ,
671- { text : msg . actualTabName , font : { bold : true } } ,
672- { text : obj . tabName , font : { color : { argb : 'FF0000' } } } ,
673- { text : msg . sheetNameLimit , font : { size : 9 , color : { argb : '666666' } } }
674- ]
675- } ;
676- }
677661 } ) ;
678662
679- // 컬럼 설정 (쿼리문 컬럼 추가)
663+ // 컬럼 설정 (Original Name 추가, Note 제거 )
680664 tocSheet . columns = [
681665 { header : 'No' , key : 'no' , width : 6 } ,
682666 { header : msg . sheetName , key : 'name' , width : 25 } ,
667+ { header : 'Original Name' , key : 'original' , width : 25 } ,
683668 { header : msg . records , key : 'records' , width : 12 } ,
684669 { header : 'Aggregate Info' , key : 'aggregate' , width : 20 } ,
685- { header : 'Query' , key : 'query' , width : 40 } ,
686- { header : 'Note' , key : 'note' , width : 18 }
670+ { header : 'Query' , key : 'query' , width : 40 }
687671 ] ;
688672
689673 // 헤더 스타일
0 commit comments