commit f5a2061480b9482ed58be07b86937f95ddade51a Author: leebj Date: Mon Jun 17 16:32:39 2024 +0900 no message diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..33570d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +logs/ +files/ \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..6e3b418 --- /dev/null +++ b/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + cokr.xit.app + app-support-res + 0.0.1-SNAPSHOT + app-support-res + app-support-res + jar + + + + maven-public + https://nas.xit.co.kr:8888/repository/maven-public/ + + + + + install + ${basedir}/target + ${project.artifactId}-${project.version} + + + + ${basedir}/src/main/webapp/resources + META-INF/resources/webjars + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + META-INF/resources/webjars/** + + + + + + + + + + maven-snapshot + https://nas.xit.co.kr:8888/repository/maven-snapshots/ + + + + maven-release + https://nas.xit.co.kr:8888/repository/maven-releases/ + + + + + \ No newline at end of file diff --git a/src/main/webapp/resources/applib/css/applib.css b/src/main/webapp/resources/applib/css/applib.css new file mode 100644 index 0000000..b81f673 --- /dev/null +++ b/src/main/webapp/resources/applib/css/applib.css @@ -0,0 +1,212 @@ +@charset "UTF-8"; + +/** 앱 공통 */ + +input[type=text]:disabled, +input[type=text]:read-only { + background-color: #eceef1; +} + +input[data-fmt-type=number] { + text-align: right; + padding-right: 10px; +} +/* 셀내용에 관계없이 셀 너비 고정 */ +.table-layout-fixed { + table-layout: fixed; + padding-right : 10px; +} + +.dummy-th { + width:auto; + background-color: #ECEEF1!important; +} +.dummy-td { + background-color: #ECEEF1; +} + +/* 스크롤 시에도 그리드 타이틀 표시 */ +.sticky-thead { + position: sticky; + top: 0; +} +table:has(.sticky-thead) { + border-collapse: separate; + border-spacing: 0; +} + +table:has(.sticky-thead) th, +table:has(.sticky-thead) td { + border-width: 1px; + border-color: #d9dee3; +} + + +/** 텍스트,배경,선 색상 추가 */ + +.text-red { + --bs-text-opacity: 1; + color: red !important; +} + +.text-orange { + --bs-text-opacity: 1; + color: orange !important; +} + +.text-blue { + --bs-text-opacity: 1; + color: blue !important; +} + +.text-green{ + --bs-text-opacity: 1; + color: green !important; +} + +.bg-bordergray { + background-color: #D9DEE3; +} + +.bg-orange { + --bs-bg-opacity: 1; + background-color: orange !important; +} + +.bg-yellow { + --bs-bg-opacity: 1; + background-color: yellow !important; +} + +.bg-green { + --bs-bg-opacity: 1; + background-color: green !important; +} + +.bg-yellowgreen { + --bs-bg-opacity: 1; + background-color: yellowgreen !important; +} + +.border-card { + border: 1px solid #d9dee3; +} + +/** 루트 탭 */ +#main-tab-content { + padding-bottom: 0px; +} + + +/* 조회조건 영역 */ +.container-search { + clear: both; + position: relative; + padding: 10px 15px; + background-color: var(--bs-nav-link-color); + border: 1px solid #d0d0d0; + box-shadow: rgb(0 0 0 / 15%) 1.95px 1.95px 2.6px; + line-height: 24px; +} + +.container-search-detail { + background-color: #f2f2f2; +} + +.form-search-title { + display: inline-block; + min-width: 6.25rem; +} + +.form-search-linebox { + display: inline-block; + width: max-content; +} + +/* 날짜입력 */ +.form-date, .form-time { + width: 7.5rem; + color: #515151; + border: 1px solid #a9a9a9; + text-align: center; +} + + +/* 버튼영역 */ +.container-page-btn { + min-height : 30px; + margin:8px 0; + clear: both; + position: relative; + overflow: hidden; + display: flex; + justify-content: space-between; + align-items: center; +} +.container-page-btn .btn{ + margin:0 3px; +} + +.container-window-btn-right { + display: flex; + align-items: center; + margin-left: auto; + column-gap: 3px; +} + +.btns .btn { + margin:0 3px; +} + +/* 버튼 추가 */ +.btn-search { + --bs-btn-color: #fff; + --bs-btn-bg: #44539e; + + --bs-btn-hover-color: #fff; + --bs-btn-hover-bg:#44539e; +} + +.btn-excel { + --bs-btn-color: #fff; + --bs-btn-bg: #217346; + + --bs-btn-hover-color: #fff; + --bs-btn-hover-bg:#217346; +} + +.btn-open-detail { + --bs-btn-color: #fff; + --bs-btn-bg: #44539e; + + --bs-btn-hover-color: #fff; + --bs-btn-hover-bg:#44539e; + + float:right; +} + + +.resize-handle { + position: absolute; + top: 0; width: 7px; height: 40px; + background: transparent; + cursor: col-resize; +} + + + +.ox-auto { + overflow-x: auto; +} + +.oy-auto { + overflow-y: auto; +} + +.ox-scroll { + overflow-x: scroll; +} + +.oy-scroll { + overflow-y: scroll; +} \ No newline at end of file diff --git a/src/main/webapp/resources/applib/css/overwrite.css b/src/main/webapp/resources/applib/css/overwrite.css new file mode 100644 index 0000000..22743b9 --- /dev/null +++ b/src/main/webapp/resources/applib/css/overwrite.css @@ -0,0 +1,317 @@ +@charset "UTF-8"; + +/** 스타일 재정의 */ + +/** 컨테이너 사이즈 */ +@media (min-width: 1400px) { + .container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container { + max-width: 1600px; + } +} + +/** 기본 폰트,버튼 배경 */ +:root{ + --bs-font-sans-serif: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + --bs-root-font-size: 14px; + --bs-body-font-size: 14px; /* body 폰트사이즈 */ + --bs-body-bg: #ffffff; + --bs-btn-hover-bg : #eee; + --bs-btn-active-bg : #d2d2d2; + --bs-btn-disabled-bg : #676767; +} + +/** 버튼 폰트,패딩,높이,색상 */ +.btn { + --bs-btn-font-family: "Public Sans"; + --bs-btn-padding-x: 0.9375rem; + --bs-btn-padding-y: 0.9375rem; + --bs-btn-font-size: 1rem; + --bs-btn-height: var(--bs-btn-font-size); + --bs-btn-font-weight: 600; + --bs-btn-line-height: 1.875rem; + --bs-btn-hover-bg: #eee; +} + +.btn-xl, .btn-group-xl > .btn { + --bs-btn-font-size: 1.25rem; + --bs-btn-padding-x: 2.125rem; + --bs-btn-padding-y: 1.25rem; + --bs-btn-border-radius: 0.625rem; +} + +/** 카드 */ +.card { + --bs-card-title-spacer-y: 0.175rem; + --bs-card-border-width: 1px; + --bs-card-body-border-width: 0; + --bs-card-box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px; + --bs-card-cap-padding-y: 0.75rem; + --bs-card-cap-padding-x: 0.75rem; +} + +/** 모달 해더 패딩 */ +.modal { + --bs-modal-header-padding: 0.5rem 1.5rem 0.25rem; +} + +/** 네비게이션 링크 폰트 크기,굵기*/ +.nav { + --bs-nav-link-font-size: 1rem; + --bs-nav-link-font-weight: 600; +} + +/** 모달 닫기 버튼 */ +.modal .modal-header .btn-close { + margin-top: 0; +} + +.modal-header .btn-close { + margin-top: 0; + margin-right: calc(-0.5* var(--bs-modal-header-padding-x)); + margin-bottom: calc(-0.5* var(--bs-modal-header-padding-y)); + margin-left: auto; +} + +/** 모달 마진 */ +.modal-dialog:not(.modal-dialog-centered) { + margin-top: 30px; +} + +/** 카드 헤더 */ +.card-header { + border-bottom: var(--bs-card-body-border-width) solid var(--bs-card-border-color); +} + +/** 내비게이션 탭 */ +.nav-tabs { + --bs-nav-tabs-border-radius: 0rem; + --bs-nav-tabs-link-border-radius: 0.375rem; + --bs-nav-tabs-bg-image: none; + --bs-nav-tabs-padding-top: 0rem; + --bs-nav-tabs-padding-left: 0rem; + padding-top: var(--bs-nav-tabs-padding-top); + padding-left: var(--bs-nav-tabs-padding-left); + border-radius: var(--bs-nav-tabs-border-radius); +} + +/** 내비게이션 아이템 */ +ul.nav-tabs > li.nav-item { + align-items: center; +} + +/** 내비게이션 링크 */ +.nav-link { + height: 1.875rem +} + +.nav-tabs .nav-item .nav-link { + border: 1px solid #d9dee3; +} + +.menu-vertical .menu-item .menu-link { + font-size: 1rem; +} + +.menu-vertical .menu-sub .menu-link { + padding-left: 2rem; +} + +/** 메뉴 링크 */ +.bg-menu-theme .menu-sub > .menu-item > .menu-link:before { + display: none; +} + +ol > li::marker { + font-weight: bold +} + +/** 내비게이션 링크 */ +.nav-align-top .nav-tabs .nav-item .nav-link.active, .nav-align-top .nav-tabs .nav-item .nav-link:active { + border-bottom-color: #fff; +} + +.nav-tabs .nav-item .nav-link.active, .nav-tabs .nav-item .nav-link:active { + box-shadow: none !important; +} + +/** 폼 컨트롤 길이 */ +.form-control { + width: initial; +} + +/** 레이아웃 네비게이션바 */ +.layout-navbar { + height: 4rem; + color : #000000; +} + +/** 라벨 폰트사이즈 */ +.form-label, .col-form-label { + font-size: 1rem; +} + +/** 모달 닫기 버튼 */ +.modal .modal-header .btn-close { + border: 1px solid black !important; +} + + +/** 버튼 */ +.btn { + min-width: max-content; + height: 1rem; +} + +.btn-outline-dark { + background: white; +} + +/** 체크박스,라디오 */ +.custom-option-basic .custom-option-content { + padding: 0.2rem; +} + +/** 레이아웃 네비게이션바 컨테이너 */ +.layout-navbar.navbar-detached.container-xxl { + max-width: 1600px; +} + +/** 굵은 글씨 */ +b, +strong { + font-weight: 700; +} + + +/** 폼컨트롤 폰트크기,패딩,디스플레이 */ +.form-control { + font-size: 1rem; + display: inline-block; + padding: 0.25rem 0.625rem; +} + +/** 폼셀렉트 */ +.form-select { + display: inline-block; + color: #515151; + font-size: 1rem; + padding-top: 0.25rem; + padding-bottom: 0.25rem; + padding-left: 0.625rem; + padding-right: 1.25rem; + background-position: right 0.25rem center; + width: max-content; + min-width: 6.25rem; + max-width: 16.25rem; +} + +/** 테이블 */ +.table-responsive { + overflow-x: auto; + border: solid 1px #d9dee3; +} + +.table > :not(caption) > * > * { + padding: 0.625rem 1rem; +} + +/* 그리드 테이블 */ +.dataTable thead{ + background-color:#FCFDFD; +} + +.dataTable th{ + text-align: center; +} + +.dataTable td, +.dataTable th { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + + + +/* 모달 사이즈 */ +.modal-sm { min-width: 250px; --bs-modal-width: 310px; } +.modal-md { min-width: 400px; --bs-modal-width: 500px; } +.modal-lg { min-width: 800px; --bs-modal-width: 1000px; } +.modal-xl { min-width: 1000px; --bs-modal-width: 1140px; } +.modal-xxl { min-width: 1400px; --bs-modal-width: 1600px; } + + + + +/** 길이,높이 설정 추가 */ +.w-px-10 { width: 10px !important; } +.w-px-60 { width: 60px !important; } +.w-px-70 { width: 70px !important; } +.w-px-80 { width: 80px !important; } +.w-px-90 { width: 90px !important; } +.w-px-110 { width: 110px !important; } +.w-px-120 { width: 120px !important; } +.w-px-130 { width: 130px !important; } +.w-px-140 { width: 140px !important; } +.w-px-160 { width: 160px !important; } +.w-px-170 { width: 170px !important; } +.w-px-180 { width: 180px !important; } +.w-px-190 { width: 190px !important; } +.w-px-210 { width: 210px !important; } +.w-px-220 { width: 220px !important; } +.w-px-230 { width: 230px !important; } +.w-px-240 { width: 240px !important; } +.w-px-300 { width: 300px !important; } +.w-px-320 { width: 320px !important; } +.w-px-450 { width: 450px !important; } +.w-px-550 { width: 550px !important; } +.w-px-900 { width: 900px !important; } +.w-px-1000 { width: 1000px !important; } +.w-px-1100 { width: 1100px !important; } +.w-px-1150 { width: 1150px !important; } +.w-px-1200 { width: 1200px !important; } +.w-px-1300 { width: 1300px !important; } +.w-px-1400 { width: 1400px !important; } +.w-px-1500 { width: 1500px !important; } + +.w-10 { width: 10% !important; } +.w-15 { width: 15% !important; } +.w-20 { width: 20% !important; } +.w-30 { width: 30% !important; } +.w-35 { width: 35% !important; } +.w-40 { width: 40% !important; } +.w-45 { width: 45% !important; } +.w-55 { width: 55% !important; } +.w-60 { width: 60% !important; } +.w-65 { width: 65% !important; } +.w-70 { width: 70% !important; } +.w-78 { width: 78% !important; } +.w-80 { width: 80% !important; } +.w-85 { width: 85% !important; } +.w-87 { width: 87% !important; } +.w-90 { width: 90% !important; } +.w-95 { width: 95% !important; } + +.h-px-10 { height: 10px !important; } +.h-px-25 { height: 25px !important; } +.h-px-60 { height: 60px !important; } +.h-px-70 { height: 70px !important; } +.h-px-80 { height: 80px !important; } +.h-px-125 { height: 125px !important; } +.h-px-175 { height: 175px !important; } +.h-px-450 { height: 450px !important; } +.h-px-550 { height: 550px !important; } +.h-px-650 { height: 650px !important; } +.h-px-750 { height: 750px !important; } +.h-px-850 { height: 850px !important; } +.h-px-900 { height: 900px !important; } +.h-px-950 { height: 950px !important; } + + +/** 폰트 사이즈 재정의 */ +.fs-1 { font-size: 2.375rem !important; } +.fs-2 { font-size: 2rem !important; } +.fs-3 { font-size: 1.625rem !important; } +.fs-4 { font-size: 1.375rem !important; } +.fs-5 { font-size: 1.125rem !important; } +.fs-6 { font-size: 0.9375rem !important; } \ No newline at end of file diff --git a/src/main/webapp/resources/applib/js/cmmnDateUtil.js b/src/main/webapp/resources/applib/js/cmmnDateUtil.js new file mode 100644 index 0000000..b6c012a --- /dev/null +++ b/src/main/webapp/resources/applib/js/cmmnDateUtil.js @@ -0,0 +1,624 @@ +/* + * 현재날짜를 YYYY-MM-DD 포맷으로 반환 + */ +function TODAY(){ + return dateFormat.format(new Date()); +} + +function inputDateComparison(sndngYmd, sndngEndYmd) { + let startDate = inputDateSplit(sndngYmd); // 시작일 + let endDate = inputDateSplit(sndngEndYmd); // 종료일 + + if (typeof startDate == "undefined" || startDate == null || startDate == "") { + alert("시작일이 입력되지 않았습니다.\n시작일을 입력해주세요."); + $("#sndngYmd").focus(); + + return false; + } + if (typeof endDate == "undefined" || endDate == null || endDate == "") { + alert("종료일이 입력되지 않았습니다.\n종료일을 입력해주세요."); + $("#sndngEndYmd").focus(); + + return false; + } + // 입력일을 확인하는 이유는 현재 작성한 일자가 시작일인지 종료일인지 확인하기 위해서이다. + if (startDate > endDate) { + alert("시작일이 종료일보다 이 후 일수는 없습니다.\n다시 선택하여 주시기 바랍니다."); + $("#sndngYmd").focus(); + + return false; + } + + return true; +} + +// 날짜형식에 "-"이 사용된 경우에 한하여 날짜값에서 "-" 기호를 제거한다. +function inputDateSplit(obj) { + if (obj == "") { + return obj; + } else { + let dateArray = obj.split("-"); + + return dateArray[0] + dateArray[1] + dateArray[2]; + } +} + +var DateUtil = { + /*============================ + * 현재날짜로부터 월 단위로 계산된 날짜(yyyymmdd) 반환 + * -addMonth가 0 이면 현재월 + * -음의 숫자면 전월 (ex: -1 전월, -2 전전월, -3 ...) + * -양의 숫자면 차월 (ex: 1 차월, 2 차차월, 3 ...) + ============================*/ + getDate : function(){ + var result = new Object(); + switch (arguments.length) { + case 1: + result = calcDate(arguments[0]); + break; + case 2: + result = calcDate(arguments[0], arguments[1]); + break; + default: + result = calcDate(); + break; + } + return result; + + //날짜 계산 + function calcDate(addMonth, stdDay){ + if(addMonth!=undefined) + addMonth = addMonth + 1; + addMonth = addMonth==undefined?1:addMonth; + + + /* + * 필수값 설정 + * -날짜 설정 + * -ago OR after 여부 설정 + */ + var date = new Date(); + var yyyy = date.getFullYear(); + var mm = ( date.getMonth() + (addMonth) ); + var dd = date.getDate(); + if(stdDay!=undefined){ + stdDay = stdDay.replace(/[^0-9]/gi,''); + yyyy = stdDay.substring(0,4); + mm = stdDay.substring(4,6); + dd = stdDay.substring(6,8); + + if(addMonth==13) + yyyy = Number(yyyy)+1; + } + + var isAfter = false; + if((addMonth*1)>0) + isAfter = true; + + /* + * 유효성 처리 + * -해(year) 넘김 처리 + * -말일(last day) 처리 + */ + var newYear = DateUtil.getNewYear(isAfter, yyyy, mm); + yyyy = newYear.yyyy; + mm = newYear.mm; + var ago_last_dd = DateUtil.getEndOfMonthDay(yyyy, mm); + dd = dd>ago_last_dd?ago_last_dd:dd; + + + /* + * format 설정 + */ + if( (''+dd).length == 1 ) + dd = "0"+ dd; + + + /* + * 결과 반환 + */ + var obj = new Object(); + obj.date = ""+yyyy+mm+dd; + obj.yyyy = ""+yyyy; + obj.mm = ""+mm; + obj.dd = ""+dd; + return obj; + } + }, + + //+ 한달 후 말일 계산 + getAddMonth : function(stdDay){ + //날짜 계산 + + var rtnVal = calcDate(0,stdDay); + return rtnVal; + + + function calcDate(addMonth, stdDay){ + if(addMonth!=undefined) + addMonth = addMonth + 1; + addMonth = addMonth==undefined?1:addMonth; + + + /* + * 필수값 설정 + * -날짜 설정 + * -ago OR after 여부 설정 + */ + stdDay = stdDay.replace(/[^0-9]/gi,''); + var yyyy = stdDay.substring(0,4); + var mm = stdDay.substring(4,6); + var dd = stdDay.substring(6,8); + mm = Number(mm)+addMonth; + if(addMonth==13) + yyyy = Number(yyyy)+1; + + var isAfter = false; + if((addMonth*1)>0) + isAfter = true; + + /* + * 유효성 처리 + * -해(year) 넘김 처리 + * -말일(last day) 처리 + */ + var newYear = DateUtil.getNewYear(isAfter, yyyy, mm); + yyyy = newYear.yyyy; + mm = newYear.mm; + var ago_last_dd = DateUtil.getEndOfMonthDay(yyyy, mm); + dd = ago_last_dd; + + + /* + * format 설정 + */ + if( (''+dd).length == 1 ) + dd = "0"+ dd; + + + /* + * 결과 반환 + */ + var obj = new Object(); + obj.date = ""+yyyy+mm+dd; + obj.yyyy = ""+yyyy; + obj.mm = ""+mm; + obj.dd = ""+dd; + return obj; + } + }, + + /*============================ + * 현재날짜(or 기준일)로부터 일 단위로 계산된 날짜(yyyymmdd) 반환 + * -addDay가 0 이면 금일 + * -음의 숫자면 전일 (ex: -1 작일, -2 재작일, -3 ...) + * -양의 숫자면 차일 (ex: 1 명일, 2 재명일, 3 ...) + ============================*/ + getDateDay: function(addDay){ + var result = new Object(); + switch (arguments.length) { + case 1: + result = calcDate(arguments[0], DateUtil.getDate().date); + break; + default: + result = calcDate(0, DateUtil.getDate().date); + break; + } + return result; + + + //날짜 계산 + function calcDate(addDay, stdDay){ + addDay = addDay==undefined||addDay==null?0:addDay*1; + + /* + * 필수값 설정 + * -날짜 설정 + * -ago OR after 여부 설정 + */ + var yyyy = stdDay.substring(0,4); + var mm = stdDay.substring(4,6); + var dd = stdDay.substring(6,8); + var dateObj = new Date(yyyy, (mm-1)*1, dd*1); + dateObj.setDate(dateObj.getDate()+(addDay)); + + yyyy = dateObj.getFullYear(); + mm = dateObj.getMonth()+1; + dd = dateObj.getDate(); + + if( (''+mm).length == 1 ) + mm = "0"+ mm; + if( (''+dd).length == 1 ) + dd = "0"+ dd; + + /* + * 결과 반환 + */ + var obj = new Object(); + obj.date = ""+yyyy+"-"+mm+"-"+dd; + obj.yyyy = yyyy; + obj.mm = mm; + obj.dd = dd; + return obj; + } + }, + /*============================ + * 달의 마지막 날짜(dd) 반환 + ============================*/ + getEndOfMonthDay : function(yy, mm){ + var max_days=0; + if(mm == 1 || mm == '01') { + max_days = 31 ; + } else if(mm == 2 || mm == '02') { + if ((( yy % 4 == 0) && (yy % 100 != 0)) || (yy % 400 == 0)) + max_days = 29; + else + max_days = 28; + } + else if (mm == 3 || mm == '03') max_days = 31; + else if (mm == 4 || mm == '04') max_days = 30; + else if (mm == 5 || mm == '05') max_days = 31; + else if (mm == 6 || mm == '06') max_days = 30; + else if (mm == 7 || mm == '07') max_days = 31; + else if (mm == 8 || mm == '08') max_days = 31; + else if (mm == 9 || mm == '09') max_days = 30; + else if (mm == 10 || mm == '10') max_days = 31; + else if (mm == 11 || mm == '11') max_days = 30; + else if (mm == 12 || mm == '12') max_days = 31; + else return ''; + return max_days; + }, + + /*============================ + * 해(year) 넘김 처리 + ============================*/ + getNewYear : function(isAfter, yyyy, mm){ + /* + * 해(year) 넘김 처리 + */ + if(isAfter){ + if(mm>12){ + var formula = Math.floor(mm/12); + yyyy = Number(yyyy)+(formula); + mm = mm - ((formula)*12); + } + }else{ + if(mm<1){ + var formula = Math.floor((mm*(-1))/12)+1; + yyyy = yyyy-(formula); + mm = mm + ((formula)*12); + } + } + + /* + * 포맷 설정 + * -월(month) 두자리 설정 + */ + if( (''+mm).length == 1 ) + mm = "0"+ mm; + + /* + * 결과 반환 + */ + var obj = new Object(); + obj.yyyy = ''+yyyy; + obj.mm = ''+mm; + return obj; + } +} + + +function getDateObject(dateStr){ + var year = dateStr.substr(0,4); + var month = dateStr.substr(4,2) - 1; + var day = dateStr.substr(6,2); + + return new Date(year,month,day); +} + +function getDateString(dateObj) { + var result = ""; + + var dateFormat = "YYYYMMDD"; + + for (var i = 0; i < dateFormat.length; i++) { + result += dateFormat.indexOf("YYYY", i) == i ? (i+=3, dateObj.getFullYear() ) : + dateFormat.indexOf("MM", i) == i ? (i+=1, to2(dateObj.getMonth()+1) ) : + dateFormat.indexOf("DD", i) == i ? (i+=1, to2(dateObj.getDate()) ) : + (dateFormat.charAt(i) ); + } + return result; +}; + +function to2(numberObj) { + return (numberObj > 9 ? "" : "0") + numberObj; +}; + +/** + * 입력일의 이전일 계산 + */ +function getPrevDay(datestr, days) { + if ( days == "0") + return datestr; + datestr = datestr.replace(/-/g, ""); + if (datestr == "") + return ""; + + var dateObj = window.getDateObject(datestr); + + dateObj.setDate(dateObj.getDate() - parseInt(days, 10)); + + return window.getDateString(dateObj); +}; + +/** + * 입력일의 다음일 계산 + */ +function getNextDay(datestr, days) { + if ( days == "0") return datestr; + datestr = datestr.replace(/-/g, ""); + if (datestr == "") return ""; + var dateObj = window.getDateObject(datestr); + + dateObj.setDate(dateObj.getDate()+ parseInt(days, 10)); + + return window.getDateString(dateObj); +}; + +/** + * 해당월의 마지막날 + */ +function getLastDay(datestr) { + datestr = datestr.replace(/-/g, ""); + if (datestr == "") return ""; + var strNextMonth = window.addMonth(datestr, 1); + strNextMonth = strNextMonth.replace(/-/g, ""); + datestr = strNextMonth.substring(0, 6) + '01'; + var strLastDay = window.addDate(datestr, -1); + strLastDay = strLastDay.replace(/-/g, ""); + var dateObj = window.getDateObject(strLastDay); + return dateObj.getDate(); +}; + +/** + * 년, 월, 일을 입력 받아 Date String으로 변환 + */ +function getDatetime(nYear, nMonth, nDate){ + var dateObj = null; + + if (nYear.toString().trim().length >= 5) { + var sDate = new String(nYear); + var nYear = sDate.substr(0,4); + var nMonth = sDate.substr(4,2); + var nDate = ((sDate.substr(6,2) == "") ? 1 : sDate.substr(6,2)); + var nHours = ((sDate.substr(8,2) == "") ? 0 : sDate.substr(8,2)); + var nMinutes = ((sDate.substr(10,2) == "") ? 0 : sDate.substr(10,2)); + var nSeconds = ((sDate.substr(12,2) == "") ? 0 : sDate.substr(12,2)); + + dateObj = new Date(parseInt(nYear), parseInt(nMonth)-1, parseInt(nDate), parseInt(nHours), parseInt(nMinutes), parseInt(nSeconds)); + } else { + dateObj = new Date(parseInt(nYear), parseInt(nMonth)-1, parseInt(((nDate == null) ? 1 : nDate))); + } + + var strYear = dateObj.getFullYear().toString(); + var strMonth = (dateObj.getMonth() + 1).toString(); + var strDate = dateObj.getDate().toString(); + if (strMonth.length == 1) strMonth = "0" + strMonth; + if (strDate.length == 1) strDate = "0" + strDate; + return strYear + "-" + strMonth + "-" + strDate; +}; + +/** + * 년 계산 + */ +function addYear(date, nOffSet){ + date = date.replace(/-/g, ""); + var nYear = parseInt(date.substr(0, 4), 10) + nOffSet; + var nMonth = parseInt(date.substr(4, 2), 10); + var nDate = parseInt(date.substr(6, 2), 10); + return window.getDatetime(nYear, nMonth, nDate); +}; + +/** + * 월 계산 + */ +function addMonth(date, nOffSet) { + date = date.replace(/-/g, ""); + var nYear = parseInt(date.substr(0, 4), 10); + var nMonth = parseInt(date.substr(4, 2), 10) + nOffSet; + var nDate = parseInt(date.substr(6, 2), 10); + return window.getDatetime(nYear, nMonth, nDate); +}; + +/** + * 일 계산 + */ +function addDate(date, nOffSet) { + date = date.replace(/-/g, ""); + var nYear = parseInt(date.substr(0, 4), 10); + var nMonth = parseInt(date.substr(4, 2), 10); + var nDate = parseInt(date.substr(6, 2), 10) + nOffSet; + return window.getDatetime(nYear, nMonth, nDate); +}; + +/** + * 이전해 계산 + */ +function getPrevYear(datestr, year) { + if ( year == "0") return datestr; + datestr = datestr.replace(/-/g, ""); + if (datestr == "") return ""; + var dateObj = window.getDateObject(datestr); + + dateObj.setYear(dateObj.getFullYear() - year); + + return window.getDateString(dateObj); +}; + +/** + * 다음해 계산 + */ +function getNextYear(datestr, year) { + if ( year == "0") return datestr; + datestr = datestr.replace(/-/g, ""); + if (datestr == "") return ""; + var dateObj = window.getDateObject(datestr); + + dateObj.setYear(dateObj.getFullYear() + year); + + return window.getDateString(dateObj); +}; + +/** + * select 연도 + */ +function setYearCombo(id,isAll,isSelect,range){ + var now = new Date(); + var dayYear = now.getFullYear(); + var str = ""; + if(range == null || range <= 0){ + range = 5; + } + if(isAll){ + str += ""; + } + for(var year=dayYear-range; year"+year+""; + + } + + $("#"+id).append(str); + + if(isSelect){ + $("#"+id).val(dayYear).attr("selected", "selected"); + } +}; + +/** + * select 연도(올해이후) + */ +function setYearComboNext(id,isAll,isSelect,range){ + var now = new Date(); + var dayYear = now.getFullYear(); + var str = ""; + if(range == null || range <= 0){ + range = 5; + } + if(isAll){ + str += ""; + } + for(var year=dayYear; year"+year+""; + + } + + $("#"+id).append(str); + + if(isSelect){ + $("#"+id).val(dayYear).attr("selected", "selected"); + } +}; + + +/** + * select 년월 + */ +function setYearMonCombo(id,isAll,isSelect){ + var day = new Date(); + var dayYear = day.getFullYear().toString(); + var now = day.getMonth()+1; + now = dayYear + (now < 10 ? "0" : "") + now; + var month = ""; + var str = ""; + + if(isAll){ + str += ""; + } + for(var i = 1; i <13 ; i++){ + month = i < 10 ? "0" + i : "" + i; + str += ""; + } + $("#"+id).append(str); + if(isSelect){ + $("#"+id).val(now).attr("selected", "selected"); + } +}; + + +/** + * 두 일자간의 일수 계산 + * @param1 day1 : 일자 8자리 - 'YYYYMMDD', 'YYYY-MM-DD', 'YYYY/MM/DD', etc + * @param2 day2 : 일자 8자리 - 'YYYYMMDD', 'YYYY-MM-DD', 'YYYY/MM/DD', etc + * @return 두 일자간의 일수 + */ +function calcDayCount(day1, day2) { + day1 = day1.replace(/-/g, ""); + day2 = day2.replace(/-/g, ""); + if (day1 == "" || day2 == "") return ""; + var date1 = window.getDateObject(day1); + var date2 = window.getDateObject(day2); + + if(date1 > date2) return ((date1.getTime() - date2.getTime()) / 1000 / 60 / 60 / 24) + 1; + else return ((date2.getTime() - date1.getTime()) / 1000 / 60 / 60 / 24) + 1; +}; + +/** + * Get 요일 + */ +function getWeek(datestr, isConvert){ + datestr = datestr.replace(/-/g, ""); + var dateObj = window.getDateObject(datestr); + var week = dateObj.getDay() + 1; + + if(!isConvert) return week; + + if(week == 1) week = '일'; + else if(week == 2) week = '월'; + else if(week == 3) week = '화'; + else if(week == 4) week = '수'; + else if(week == 5) week = '목'; + else if(week == 6) week = '금'; + else if(week == 7) week = '토'; + return week; +}; + + +/** + * 날짜형식이 올바른지 검사 + * + * @param astrValue 날짜포맷(yyyymmdd, yyyy/mm/dd, yyyy-mm-dd) + * @param astrNotNull: nn:not null, "": null 허용 + * @return true/false + **/ +function blnOkDate(astrValue, astrNotNull) { + var arrDate; + + if (astrValue==''){ + if (astrNotNull == "nn") + return false; + else + return true; + } + + if (astrValue.indexOf("-") != -1){ + arrDate = astrValue.split("-"); + } else if (astrValue.indexOf("/") != -1){ + arrDate = astrValue.split("/"); + } else { + if (astrValue.length != 8) return false; + astrValue = astrValue.substring(0,4)+"/"+astrValue.substring(4,6)+"/" +astrValue.substring(6,8); + arrDate = astrValue.split("/"); + } + + if (arrDate.length != 3) return false; + + var chkDate = new Date(arrDate[0] + "/" + arrDate[1] + "/" + arrDate[2]); + if (isNaN(chkDate) == true + || (arrDate[1] != chkDate.getMonth() + 1 || arrDate[2] != chkDate.getDate())) { + return false; + } + + return true; +} + + diff --git a/src/main/webapp/resources/applib/js/cmmnUtil.js b/src/main/webapp/resources/applib/js/cmmnUtil.js new file mode 100644 index 0000000..7d6f96a --- /dev/null +++ b/src/main/webapp/resources/applib/js/cmmnUtil.js @@ -0,0 +1,455 @@ +/************************************************************************** +* 동기식 대화상자 +**************************************************************************/ +async function confirm2(msg){ + return await dialog2(msg, "confirm"); +} + +async function alert2(msg){ + return await dialog2(msg, "alert"); +} + +async function prompt2(msg){ + return await dialog2(msg, "prompt"); +} + +async function dialog2(msg, type, buttons){ + var dlgId = "dlg-" + uuid(); + var resp = await fetch(wctx.url("/webjars/html/dialog.html")); + var template = await resp.text(); + var container = "
{content}
"; + if(type == "prompt"){ + var rsn = '
'; + content = container.replace(/{content}/g, msg + rsn); + } else { + content = container.replace(/{content}/g, msg); + } + var backdropID = dlgId + "-backdrop"; + var tmpl = template.replace(/{id}/g, dlgId).replace(/{title}/g, "").replace(/{size}/, "").replace("",""); + tmpl = tmpl.replace("modal-dialog", "modal-dialog-centered modal-dialog"); + tmpl = tmpl.replace("data-bs-backdrop=\"static\"", "data-bs-backdrop=\"static\" data-bs-keyboard=\"false\""); + tmpl = tmpl.replace("text-end hidden","text-end"); + tmpl = tmpl.replace("btn-primary","btn-primary btn-ok"); + var dlg = $(tmpl).appendTo("body"); + if(type == "confirm" || type == "alert" || type == "prompt"){ + if(type == "confirm" || type == "prompt"){ + dlg.find(".modal-footer").append(''); + } + } else { + dlg.find(".modal-footer").find(".btn-ok").remove(); + + for(var i=0; i < buttons.length; i++){ + dlg.find(".modal-footer").append( + ''); + } + + } + + dlg.find(".modal-header").remove(); + dlg.find(".modal-body").html(content).fadeIn(); + dlg.on("hidden.bs.modal", function() { + $("#" + dlgId +",#" + backdropID).remove(); + }); + dlg.modal("show"); + $(".modal-backdrop").each(function() { + var backdrop = $(this); + if (!backdrop.prop("id")){ + backdrop.prop("id", backdropID); + } + }); + + setDialogZindex(); + + return new Promise(resolve => { + if(type == "confirm" || type == "alert" || type == "prompt"){ + if(type == "prompt"){ + dlg[0].querySelector(".btn-ok").addEventListener("click", () => { + dlg.modal("hide"); + resolve($("#rsn").val()); + }); + } else { + dlg[0].querySelector(".btn-ok").addEventListener("click", () => { + dlg.modal("hide"); + resolve(true); + }); + } + + if(type == "confirm"){ + dlg[0].querySelector(".btn-cancel").addEventListener("click", () => { + dlg.modal("hide"); + resolve(false); + }); + } + if(type == "prompt"){ + dlg[0].querySelector(".btn-cancel").addEventListener("click", () => { + dlg.modal("hide"); + resolve(null); + }); + } + } else { + dlg.find(".btn-custom").each(function(){ + this.addEventListener("click", () => { + dlg.modal("hide"); + resolve(this.dataset.key); + }); + }); + } + + }); +} + +/************************************************************************** +* 모달창 z-index 초기화 +**************************************************************************/ +function setDialogZindex(){ + var parentDialog = getLastOpenDialog(); + var childDialog = getLastDialog(); + + if($(parentDialog).length == 0 || parentDialog == childDialog){ + return; + } + + var parentZ = $(parentDialog).css("z-index"); + $(childDialog).css("z-index", Number(parentZ)+10); + + var backdrop = $(childDialog).next(); + if(backdrop.hasClass("modal-backdrop")){ + backdrop.css("z-index", Number(parentZ)+9); + }; +} + +/************************************************************************** +* 모달창 닫기 버튼 포커스 +**************************************************************************/ +function focusClose() { + $(document).find("div.modal").last().on('shown.bs.modal', function () { + $(this).find(".btn-close").trigger('focus'); + }); +} + +/************************************************************************** +* 모달창 확인 버튼 포커스 +**************************************************************************/ +function focusOK() { + $(document).find("div.modal").last().on('shown.bs.modal', function () { + $(this).find(".modal-footer").find("button").each(function(){ + if($(this).text() == "확인"){ + $(this).trigger('focus'); + } + }); + }); +} + +/************************************************************************** +* validation +**************************************************************************/ +function customValidate(targetArr) { + var handler = validationFailureHandler(); + for(var i=0;i="00" && hour<="23"){ + if(minute>="00" && minute<="59"){ + if(second>="00" && second<="59"){ + return true; + } + } + } + + return false; +} + +// 날짜체크 +function isDate(str) { + + str = str.replaceAll("-",""); + + if(str.length != 8){ + return false; + } + + if (!isNumber(str, "")) { + return false; + } + + // 숫자, length 확인 + var year = str.substring(0,4); + var month = str.substring(4,6); + var day = str.substring(6,8); + + // 유효날짜 확인 + if (year>="0001" && year<="9999" && month>="01" && month<="12") { + febDays = "29"; + if ((parseInt(year,10) % 4) == 0) { + if ((parseInt(year,10) % 100) == 0 && (parseInt(year,10) % 400) != 0){ + febDays = "28"; + } + }else{ + febDays = "28"; + } + if (month=="01" && day>="01" && day<="31") return true; + if (month=="02" && day>="01" && day<=febDays) return true; + if (month=="03" && day>="01" && day<="31") return true; + if (month=="04" && day>="01" && day<="30") return true; + if (month=="05" && day>="01" && day<="31") return true; + if (month=="06" && day>="01" && day<="30") return true; + if (month=="07" && day>="01" && day<="31") return true; + if (month=="08" && day>="01" && day<="31") return true; + if (month=="09" && day>="01" && day<="30") return true; + if (month=="10" && day>="01" && day<="31") return true; + if (month=="11" && day>="01" && day<="30") return true; + if (month=="12" && day>="01" && day<="31") return true; + return false; + } + + + return false; +} + + + +/** + * 문자열이 지정한 최소길이 이상인지의 여부를 반환한다. + * @param minLen - 최소길이 + * @return 최소길이 이상인지의 여부 + */ +function isMin(str, minLen) { + return str.length >= minLen; +}; + +/** + * 문자열이 지정한 최대길이 이하인지의 여부를 반환한다. + * @param maxLen - 최대길이 + * @return 최대길이 이하인지의 여부 + */ +function isMax(str, maxLen) { + return str.length <= maxLen; +}; + +/** + * 문자열이 지정한 최소바이트수 이상인지의 여부를 반환한다. + * @param minByte - 최소바이트수 + * @return 최소바이트수 이상인지의 여부 + */ +function isMinByte(str, minByte) { + return getByte(str) >= minByte; +}; + +/** + * 문자열이 지정한 최대바이트수 이하인지의 여부를 반환한다. + * @param maxByte - 최대바이트수 + * @return 최대바이트수 이하인지의 여부 + */ +function isMaxByte(str, maxByte) { + return getByte(str) <= maxByte; +}; + + +/** + * 문자열이 영어만으로 구성되어 있는지의 여부를 반환한다. + * @param exceptChar - 추가 허용할 문자 + * @return 영어만으로 구성되어 있는지의 여부 + */ +function isEng(str, exceptChar) { + return (/^[a-zA-Z]+$/).test(str.replaceAll(exceptChar,"")) ? true : false; +}; + +/** + * 문자열이 숫자와 영어만으로 구성되어 있는지의 여부를 반환한다. + * @param exceptChar - 추가 허용할 문자 + * @return 숫자와 영어만으로 구성되어 있는지의 여부 + */ +function isEngNum(str, exceptChar) { + return (/^[0-9a-zA-Z]+$/).test(str.replaceAll(exceptChar,"")) ? true : false; +}; + +/** + * 이메일 주소의 유효성 여부를 반환한다. + * @return 유효성 여부 + */ +function isEmail(str) { + return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(str); +}; + +/************************************************************************** +* 엑셀 파일 작성 정보 생성 +**************************************************************************/ +function getCellDefs($ths, $tds, fieldGetterOption){ + var cellDefs = []; + + for(var i=0; i < $ths.length; i++){ + + var label = $ths.eq(i).text(); + label = label.replace("\n", ""); + label = label.replace("\t", ""); + label = label.replace(" ", ""); + + if(label != ""){ + + var width = $ths.eq(i).outerWidth(); + width = Math.ceil(width/10) + 2; + + var field = ""; + if(fieldGetterOption != null){ + field = fieldGetterOption($tds.eq(i)); + } else { + field = $tds.eq(i).text(); + } + + field = field.replace("{", ""); + field = field.replace("}", ""); + field = field.replace("\n", ""); + field = field.replace("\t", ""); + field = field.replace(" ", ""); + + var cellDef = { + label : label, + width : width, + field : field + }; + + cellDefs.push(cellDef); + } + + } + + return JSON.stringify(cellDefs); +} + + + +//마지막으로 열린 다이얼로그 영역을 반환한다. +function getLastOpenDialog(){ + return $("div.modal.show").last()[0]; +} +//마지막으로 생성된 다이얼로그 영역을 반환환다. +function getLastDialog(){ + return $("div.modal").last()[0]; +} + + + + + +/************************************************************************** +* 지연 +**************************************************************************/ +function sleep(ms) { + return new Promise((r) => setTimeout(r, ms)); +} + + + +/************************************************************************** +* String util +**************************************************************************/ +/** + * 문자열의 byte 길이를 반환한다. + * @return 문자열의 byte 길이 + */ +function getByte(str) { + + if ( str == null || str.length == 0 ) { + return 0; + } + var size = 0; + for ( var i=0, len=str.length ; i < len ;i++ ) { + var charCode = str.charCodeAt(i), + charSize = 0; + + if ( charCode <= 0x00007F ) { //127 + charSize = 1; + } else if ( charCode <= 0x0007FF) { //2047 + charSize = 2; + } else if ( charCode <= 0x00FFFF) { //65535 + charSize = 3; + } else { + charSize = 4; + } + size += charSize; + } + return size; +}; + + diff --git a/src/main/webapp/resources/applib/js/componentization.js b/src/main/webapp/resources/applib/js/componentization.js new file mode 100644 index 0000000..5576215 --- /dev/null +++ b/src/main/webapp/resources/applib/js/componentization.js @@ -0,0 +1,137 @@ +/************************************************************************** +* 스크롤 테이블 +**************************************************************************/ +function fnMakeScrollableTable(tableScrollEl, thisScrollendEvent){ + + tableScrollEl.thisScrollendEvent = thisScrollendEvent; + + tableScrollEl.changeContent = function(content, initScrollPosition, noMore){ + var beforeRender = this.scrollTop; + + $(this).find("tbody").html(content); + + this.scrollTop = 0; + var min = this.scrollTop; + this.scrollTop = this.scrollHeight; + var max = this.scrollTop; + var hasScroll = (min != max); + + var more = document.createElement("tr"); + + if(hasScroll && !noMore){ + more.classList.add("h-px-30"); + + $(this).find("tbody").append(more); + + var ioCallbackFunc = function(entries, observer){ + var entry = entries[0]; + var target = entry.target; + if(entry.isIntersecting){ + observer.unobserve(target); + tableScrollEl.thisScrollendEvent(); + } + }; + + var io = new IntersectionObserver(ioCallbackFunc, {threshold : 0}); + io.observe(more); + } + + if(initScrollPosition){ + this.scrollTop = 0; + } else { + + var afterRender = this.scrollTop; + + if(beforeRender < afterRender){ + this.scrollTop = beforeRender; + } + } + + }; +} + +/************************************************************************** +* 컬럼 크기 조절 테이블 +**************************************************************************/ +function fnMakeResizableTable(containerEl){ + + var cur_container, cur_handle, cur_index, cur_col, cur_col_width; + var cursorStart = 0, dragStart = false; + + function fnMouseDown(e){ + + e.preventDefault(); + + cur_handle = this; + cur_container = cur_handle.tableContainer; + + cur_index = parseInt(cur_handle.getAttribute("data-resizecol"))-1; + + var thEls = $(cur_container.getElementsByTagName("table")[0]).find("th").not(".dummy-th"); + cur_col = thEls[cur_index]; + cur_col_width = cur_col.getBoundingClientRect().width; + + dragStart = true; + cursorStart = event.pageX; + + document.onmouseup = fnCloseResize; + document.onmousemove = fnMouseMove; + + } + + function fnMouseMove(e){ + e.preventDefault(); + + if(dragStart){ + var cursorPosition = event.pageX; + var mouseMoved = (cursorPosition - cursorStart); + var newWidth = cur_col_width + mouseMoved; + + if(newWidth > 30){ + cur_col.style.width = newWidth+"px"; + } + } + } + + function fnCloseResize(e){ + document.onmousemove = null; + document.onmouseup = null; + cur_container.removeHandle(); + cur_container.addHandle(); + } + + containerEl.style.position = "relative"; + + containerEl.addHandle = function(){ + var thEls = $(this.getElementsByTagName("table")[0]).find("th").not(".dummy-th"); + var th_length = thEls.length; + var widthAcc = 0; + for(var i=0; i < th_length; i++){ + widthAcc += thEls[i].getBoundingClientRect().width; + var yDiv = document.createElement("div"); + yDiv.className = "resize-handle"; + yDiv.setAttribute("data-resizecol",i+1); + yDiv.style.cssText = "left: "+widthAcc+"px;"; + this.append(yDiv); + } + + handleEls = this.getElementsByClassName("resize-handle"); + var handle_length = handleEls.length; + for(var i = 0; i < handle_length; i++){ + handleEls[i].tableContainer = this; + handleEls[i].onmousedown = fnMouseDown; + } + }; + + containerEl.removeHandle = function(){ + $(this).find(".resize-handle").remove(); + } + + containerEl.changeColumn = function(ths){ + this.removeHandle(); + $(this).find("table thead tr").html(ths); + this.addHandle(); + } + + containerEl.addHandle(); +} \ No newline at end of file diff --git a/src/main/webapp/resources/applib/js/initAfterPageLoad.js b/src/main/webapp/resources/applib/js/initAfterPageLoad.js new file mode 100644 index 0000000..154e934 --- /dev/null +++ b/src/main/webapp/resources/applib/js/initAfterPageLoad.js @@ -0,0 +1,19 @@ +function initDatepicker(elementId){ + + var executionArea = $("#"+elementId); + + executionArea.find(".form-date").datePicker(); + +} + +function initDetailSearchButton(elementId){ + + var executionArea = $("#"+elementId); + + /*--------------------- 상세검색 버튼 제어 ---------------------*/ + executionArea.find(".btn-open-detail").on("click", function() { + $(this).find('i').toggleClass('bx-chevron-down'); + $(this).find('i').toggleClass('bx-chevron-up'); + }); + +} \ No newline at end of file