전체 공통 팝업 함수 변경

처분사전 그리드 쿼리 수정
dev
박성영 3 months ago
parent de7a7439b6
commit 8c33bd0469

@ -214,8 +214,8 @@
INNER JOIN tb_ownr o ON o.OWNR_ID = oi.OWNR_ID AND o.DEL_YN = 'N'
LEFT JOIN tb_cd_detail impltTrprSe ON impltTrprSe.CD_GROUP_ID = 'IMPLT_TRPR_SE_CD' AND impltTrprSe.CD_ID = '1'
LEFT JOIN tb_cd_detail act ON act.CD_GROUP_ID = 'ACT_TYPE_CD' AND act.CD_ID = aio.ACT_TYPE_CD
WHERE aio.CRDN_YR = '2025'
AND aio.CRDN_NO = '000067'
WHERE aio.CRDN_YR = #{crdnYr}
AND aio.CRDN_NO = #{crdnNo}
AND aio.DEL_YN = 'N'
</select>

@ -229,7 +229,7 @@
var url = '<c:url value="/baseData/bldgNewPrcCrtrAmt/bldgNewPrcCrtrAmtPopup.do"/>?yr=' +
encodeURIComponent(rowData.yr) + '&no=' +
encodeURIComponent(rowData.no) + '&mode=V';
window.open(url, 'bldgNewPrcCrtrAmtView', 'width=700,height=350,scrollbars=yes');
openPopup(url, 700, 350, 'bldgNewPrcCrtrAmtView');
}
}
});
@ -268,7 +268,7 @@
* 등록 팝업 열기
*/
openRegisterPopup: function() {
window.open('<c:url value="/baseData/bldgNewPrcCrtrAmt/bldgNewPrcCrtrAmtPopup.do"/>?mode=C', 'bldgNewPrcCrtrAmtReg', 'width=700,height=500,scrollbars=yes');
openPopup('<c:url value="/baseData/bldgNewPrcCrtrAmt/bldgNewPrcCrtrAmtPopup.do"/>?mode=C', 700, 500, 'bldgNewPrcCrtrAmtReg');
},
/**

@ -344,7 +344,7 @@
// 새 탭으로 열기 - 컨트롤러가 요구하는 파라미터명으로 전달 (ownrId)
var detailUrl = buildUrlWithParamCondAndMultipleKeys(null, {"mode":"V","pstnIdxNo": rowData.pstnIdxNo}, "<c:url value="/baseData/pstnIdx/pstnIdxPopup.do"/>");
window.open(detailUrl, 'pstnIdxView', 'width=600,height=400,scrollbars=yes');
openPopup(detailUrl, 600, 400, 'pstnIdxView');
}
});
@ -356,13 +356,13 @@
* 팝업 관련 기능
*/
openRegisterPopup: function() {
window.open('<c:url value="/baseData/pstnIdx/pstnIdxPopup.do"/>?mode=C', 'pstnIdxView', 'width=600,height=400,scrollbars=yes');
openPopup('<c:url value="/baseData/pstnIdx/pstnIdxPopup.do"/>?mode=C', 600, 400, 'pstnIdxView');
},
openViewPopup: function(pstnIdxNo) {
var url = '<c:url value="/baseData/pstnIdx/pstnIdxPopup.do"/>?mode=V&pstnIdxNo=' +
encodeURIComponent(pstnIdxNo);
window.open(url, 'pstnIdxView', 'width=600,height=400,scrollbars=yes');
openPopup(url, 600, 400, 'pstnIdxView');
},
/**

@ -287,13 +287,13 @@
* 팝업 관련 기능
*/
openRegisterPopup : function() {
window.open('<c:url value="/baseData/strctIdx/popup.do"/>?mode=C', 'strctIdxReg', 'width=480,height=480');
openPopup('<c:url value="/baseData/strctIdx/popup.do"/>?mode=C', 480, 480, 'strctIdxReg');
},
openViewPopup : function(strctIdxCd) {
var url = '<c:url value="/baseData/strctIdx/popup.do"/>?mode=V&strctIdxCd=' + encodeURIComponent(strctIdxCd);
//console.log(strctIdxCd);
window.open(url, 'strctIdxMdf', 'width=480,height=480');
openPopup(url, 480, 480, 'strctIdxMdf');
},
/**

@ -284,12 +284,12 @@
* 팝업 관련 기능
*/
openRegisterPopup : function() {
window.open('<c:url value="/baseData/usgIdx/popup.do"/>?mode=C', 'usgIdxReg', 'width=480,height=480');
openPopup('<c:url value="/baseData/usgIdx/popup.do"/>?mode=C', 480, 480, 'usgIdxReg');
},
openViewPopup : function(usgIdxCd) {
var url = '<c:url value="/baseData/usgIdx/popup.do"/>?mode=V&usgIdxCd=' + encodeURIComponent(usgIdxCd);
window.open(url, 'usgIdxMdf', 'width=480,height=480');
openPopup(url, 480, 480, 'usgIdxMdf');
},
/**

@ -336,7 +336,7 @@
// 새 탭으로 열기 - 컨트롤러가 요구하는 파라미터명으로 전달 (vltnLwrgCd)
var detailUrl = buildUrlWithParamCondAndMultipleKeys(null, {"mode":"V","vltnLwrgCd": rowData.vltnLwrgCd}, "<c:url value="/baseData/vltnLwrg/vltnLwrgPopup.do"/>");
window.open(detailUrl, 'vltnLwrgView', 'width=600,height=400,scrollbars=yes');
openPopup(detailUrl, 600, 400, 'vltnLwrgView');
}
});
@ -348,13 +348,13 @@
* 팝업 관련 기능
*/
openRegisterPopup: function() {
window.open('<c:url value="/baseData/vltnLwrg/vltnLwrgPopup.do"/>?mode=C', 'vltnLwrgView', 'width=600,height=400,scrollbars=yes');
openPopup('<c:url value="/baseData/vltnLwrg/vltnLwrgPopup.do"/>?mode=C', 600, 400, 'vltnLwrgView');
},
openViewPopup: function(vltnLwrgCd) {
var url = '<c:url value="/baseData/vltnLwrg/vltnLwrgPopup.do"/>?mode=V&vltnLwrgCd=' +
encodeURIComponent(vltnLwrgCd);
window.open(url, 'vltnLwrgView', 'width=600,height=400,scrollbars=yes');
openPopup(url, 600, 400, 'vltnLwrgView');
},
/**

@ -652,7 +652,7 @@
*/
function viewOriginalPhoto(actInfoId, crdnPhotoSn) {
var url = '<c:url value="/crdn/crndRegistAndView/crdnActInfo/photoView.do"/>?actInfoId=' + actInfoId + '&crdnPhotoSn=' + crdnPhotoSn;
window.open(url, '_blank', 'width=1000,height=700,scrollbars=yes,resizable=yes');
openPopup(url, 1000, 700, '_blank');
}

@ -278,10 +278,8 @@
//신규 조사원 등록
$('#newExmnrPopupBtn').on('click', function() {
var w = 450, h = 280;
var left = Math.max(0, (window.screen.availLeft + (window.screen.availWidth - w) / 2));
var top = Math.max(0, (window.screen.availTop + (window.screen.availHeight - h) / 2));
window.open('<c:url value="/crdn/exmnr/popup.do"/>?mode=C', 'exmnrReg', 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + ',resizable=yes,scrollbars=yes');
var url = '<c:url value="/crdn/exmnr/popup.do"/>?mode=C'
openPopup(url, 450, 280, 'exmnrReg');
});
// 엔터키 검색

@ -267,7 +267,7 @@
});
$('#newOwnrPopupBtn').on('click', function() {
window.open('<c:url value="/crdn/ownact/ownActRegistPopup.do"/>?mode=C', 'ownActRegistAndViewReg', 'width=600,height=600,scrollbars=yes');
openPopup('<c:url value="/crdn/ownact/ownActRegistPopup.do"/>?mode=C', 600, 600, 'ownActRegistAndViewReg');
});

@ -219,9 +219,7 @@
}
popUrl += params;
var popTitle = "주소 찾기";
var popOption = "width=570px, height=530px, resizable=yes, scrollbars=yes, location=no, top=100px, left=100px";
window.open(popUrl, popTitle, popOption);
openPopup(popUrl, 570, 530, '주소 찾기');
}
/**

@ -215,12 +215,7 @@
openExmnrPopup: function () {
var popupUrl = '<c:url value="/crdn/crndRegistAndView/crdnExmnr/crdnExmnrSelectPopup.do" />';
var popupName = 'exmnrPopup';
var popupOptions = 'width=900,height=700,scrollbars=yes,resizable=yes,left=' +
Math.round((screen.width - 900) / 2 + 200) + ',top=' +
Math.round((screen.height - 700) / 2);
// 팝업창을 열고 참조를 저장
var popup = window.open(popupUrl, popupName, popupOptions);
var popup = openPopup(popupUrl, 800, 700, popupName);
if (popup) {
this.childPopups.push(popup);
}

@ -325,10 +325,7 @@
+ '&pstnInfoId=' + encodeURIComponent(pstnInfoId)
+ '&crdnNo=' + encodeURIComponent(crdnNo)
+ '&mode=C';
var w = 1200, h = 700;
var left = Math.max(0, (screen.width - w) / 2);
var top = Math.max(0, (screen.height - h) / 2);
window.open(url, 'actInfoPopup', 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + ',resizable=yes,scrollbars=yes');
openPopup(url, 1200, 700, 'actInfoPopup');
},
/**
@ -359,14 +356,7 @@
+ '&crdnNo=' + encodeURIComponent(crdnNo)
+ '&actInfoId=' + encodeURIComponent(actInfoId)
+ '&mode=U';
var w = 1200, h = 700;
var left = Math.max(0, (screen.width - w) / 2);
var top = Math.max(0, (screen.height - h) / 2);
// 중요로직: 팝업창 열기 (기존 팝업이 있으면 포커스, 없으면 새로 생성)
var popupName = 'actInfoUpdatePopup_' + actInfoId;
window.open(url, popupName, 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + ',resizable=yes,scrollbars=yes');
openPopup(url, 1200, 700, 'actInfoPopup');
},
/**

@ -180,10 +180,7 @@
'&crdnYr=' + encodeURIComponent(crdnYr) +
'&crdnNo=' + encodeURIComponent(crdnNo) +
'&actInfoId=' + encodeURIComponent(actInfoId || '');
var w = 1000, h = 800;
var left = Math.max(0, (screen.width - w) / 2);
var top = Math.max(0, (screen.height - h) / 2);
window.open(url, 'ActrSelectPopup', 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + ',resizable=yes,scrollbars=yes');
openPopup(url, 1000, 800, 'ActrSelectPopup');
},
/**

@ -408,10 +408,7 @@
*/
openExmnrPopup: function() {
var popupUrl = '<c:url value="/crdn/crndRegistAndView/crdnExmnr/crdnExmnrSelectPopup.do" />';
var w = 900, h = 700;
var left = Math.max(0, (screen.width - w) / 2);
var top = Math.max(0, (screen.height - h) / 2);
window.open(popupUrl, 'exmnrPopup', 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + ',resizable=yes,scrollbars=yes');
openPopup(popupUrl, 900, 700, 'exmnrPopup');
},
/**

@ -179,10 +179,7 @@
'&crdnYr=' + encodeURIComponent(crdnYr) +
'&crdnNo=' + encodeURIComponent(crdnNo) +
'&pstnInfoId=' + encodeURIComponent(pstnInfoId || '');
var w = 1000, h = 800;
var left = Math.max(0, (screen.width - w) / 2);
var top = Math.max(0, (screen.height - h) / 2);
window.open(url, 'ownrSelectPopup', 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + ',resizable=yes,scrollbars=yes');
openPopup(url, 1000, 800, 'ownrSelectPopup');
},
/**

@ -234,12 +234,7 @@
popUrl += params;
var popTitle = "위치정보 수정";
// 중요로직: 위치정보 추가 버튼 팝업 크기와 동일하게 설정 (width=1200, height=500)
var w = 1200, h = 500;
var left = Math.max(0, (screen.width - w) / 2);
var top = Math.max(0, (screen.height - h) / 2);
var popOption = "width=" + w + ",height=" + h + ",left=" + left + ",top=" + top + ",resizable=yes,scrollbars=yes";
window.open(popUrl, popTitle, popOption);
openPopup(popUrl, 1200, 500, popTitle);
}
},
@ -266,10 +261,7 @@
return;
}
var url = '<c:url value="/crdn/crndRegistAndView/crdnPstnInfo/crdnPstnInfoRegistPopup.do"/>' + '?crdnYr=' + encodeURIComponent(crdnYr) + '&crdnNo=' + encodeURIComponent(crdnNo) + '&mode=C';
var w = 1200, h = 500;
var left = Math.max(0, (screen.width - w) / 2);
var top = Math.max(0, (screen.height - h) / 2);
window.open(url, 'pstnInfoPopup', 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + ',resizable=yes,scrollbars=yes');
openPopup(url, 1200, 500, 'pstnInfoPopup');
},
/**

@ -435,14 +435,15 @@
* 팝업 관련 기능
*/
openRegisterPopup: function() {
window.open('<c:url value="/crdn/crndRegistAndView/crdnRegistPopup.do"/>?mode=C', 'crdnRegistAndViewReg', 'width=800,height=700,scrollbars=yes');
var url = '<c:url value="/crdn/crndRegistAndView/crdnRegistPopup.do"/>?mode=C';
openPopup(url, 800, 700, 'crdnRegistAndViewView');
},
openViewPopup: function(crdnYr, crdnNo) {
var url = '<c:url value="/crdn/crndRegistAndView/crdnRegistPopup.do"/>?mode=V&crdnYr=' +
var url = '<c:url value="/crdn/crndRegistAndView/crdnRegistPopup.do"/>?mode=V&crdnYr=' +
encodeURIComponent(crdnYr) + '&crdnNo=' +
encodeURIComponent(crdnNo);
window.open(url, 'crdnRegistAndViewView', 'width=800,height=700,scrollbars=yes');
openPopup(url, 800, 700, 'crdnRegistAndViewView');
},
/**
@ -465,17 +466,11 @@
},
success: function(response) {
var mode = (response && response.success && response.data) ? 'U' : 'C';
var w = 1200, h = 610;
var left = Math.max(0, (window.screen.availLeft + (window.screen.availWidth - w) / 2));
var top = Math.max(0, (window.screen.availTop + (window.screen.availHeight - h) / 2));
var url = '<c:url value="/crdn/crndRegistAndView/crdnImpltTask/impltTaskPopup.do"/>?mode=' + mode +
'&crdnYr=' + encodeURIComponent(crdnYr) +
'&crdnNo=' + encodeURIComponent(crdnNo) +
'&impltTaskSeCd=' + encodeURIComponent(impltTaskSeCd);
window.open(url, 'impltTaskPopup', 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + ',scrollbars=yes,resizable=yes');
openPopup(url, 1200, 610, 'impltTaskPopup');
}
});
},

@ -443,14 +443,15 @@
* 팝업 관련 기능
*/
openRegisterPopup: function() {
window.open('<c:url value="/crdn/crndRegistAndView/crdnRegistPopup.do"/>?mode=C', 'crdnRegistAndViewReg', 'width=800,height=700,scrollbars=yes');
var url = '<c:url value="/crdn/crndRegistAndView/crdnRegistPopup.do"/>?mode=C';
openPopup(url, 800, 700, 'crdnRegistAndViewView');
},
openViewPopup: function(crdnYr, crdnNo) {
var url = '<c:url value="/crdn/crndRegistAndView/crdnRegistPopup.do"/>?mode=V&crdnYr=' +
encodeURIComponent(crdnYr) + '&crdnNo=' +
encodeURIComponent(crdnNo);
window.open(url, 'crdnRegistAndViewView', 'width=800,height=700,scrollbars=yes');
openPopup(url, 800, 700, 'crdnRegistAndViewView');
},
/**

@ -282,12 +282,12 @@
* 팝업 관련 기능
*/
openRegisterPopup: function() {
window.open('<c:url value="/crdn/exmnr/popup.do"/>?mode=C', 'exmnrReg', 'width=450,height=280');
openPopup('<c:url value="/crdn/exmnr/popup.do"/>?mode=C', 450, 280, 'exmnrReg');
},
openViewPopup: function(exmnrId) {
var url = '<c:url value="/crdn/exmnr/popup.do"/>?mode=V&exmnrId=' + encodeURIComponent(exmnrId);
window.open(url, 'exmnrMdf', 'width=450,height=280');
openPopup(url, 450, 280, 'exmnrMdf');
},
/**

@ -314,7 +314,7 @@
// 새 탭으로 열기 - 컨트롤러가 요구하는 파라미터명으로 전달 (ownrId)
var detailUrl = buildUrlWithParamCondAndMultipleKeys(null, {"mode":"V","ownrId": rowData.ownrId}, "<c:url value="/crdn/ownact/ownActRegistPopup.do"/>");
window.open(detailUrl, 'ownActRegistAndView', 'width=800,height=700,scrollbars=yes');
openPopup(detailUrl, 600, 600, 'ownActRegistAndView');
}
});
@ -326,13 +326,13 @@
* 팝업 관련 기능
*/
openRegisterPopup: function() {
window.open('<c:url value="/crdn/ownact/ownActRegistPopup.do"/>?mode=C', 'ownActRegistAndViewReg', 'width=600,height=600,scrollbars=yes');
openPopup('<c:url value="/crdn/ownact/ownActRegistPopup.do"/>?mode=C', 600, 600, 'ownActRegistAndViewReg');
},
openViewPopup: function(ownrId) {
var url = '<c:url value="/crdn/ownact/ownActRegistPopup.do"/>?mode=V&ownrId=' +
encodeURIComponent(ownrId);
window.open(url, 'ownActRegistAndViewView', 'width=800,height=700,scrollbars=yes');
openPopup(url, 600, 600, 'ownActRegistAndViewView');
},
/**

@ -330,9 +330,7 @@
}
popUrl += params;
var popTitle = "주소 찾기";
var popOption = "width=570px, height=530px, resizable=yes, scrollbars=yes, location=no, top=100px, left=100px";
window.open(popUrl, popTitle, popOption);
openPopup(popUrl, 570, 530, '주소 찾기');
}
/**

@ -1358,3 +1358,37 @@ XitDropdown.prototype = {
}
};
/**
* 팝업 열기 공통함수
* 중요로직: 팝업창을 화면 중앙에 위치시켜 열기, 위치 조정 가능
* @param {string} url - 팝업에서 URL
* @param {number} width - 팝업 너비 (기본값: 600)
* @param {number} height - 팝업 높이 (기본값: 600)
* @param {string} windowName - 윈도우 이름 (기본값: 'popup')
* @param {number} leftOffset - 중앙 위치에서 좌우 조정값 (기본값: 0, 음수면 왼쪽, 양수면 오른쪽)
* @param {number} topOffset - 중앙 위치에서 상하 조정값 (기본값: 0, 음수면 위쪽, 양수면 아래쪽)
* @returns {Window} 열린 팝업 객체
*/
function openPopup(url, width, height, windowName, leftOffset, topOffset) {
// 기본값 설정
width = width || 600;
height = height || 600;
windowName = windowName || 'popup';
leftOffset = leftOffset || 0;
topOffset = topOffset || 0;
// 화면 중앙 위치 계산
var left = Math.max(0, (window.screen.availLeft + (window.screen.availWidth - width) / 2));
var top = Math.max(0, (window.screen.availTop + (window.screen.availHeight - height) / 2));
// 중요로직: 최종 계산된 중앙 위치에 조정값 적용
left = Math.max(0, left + leftOffset);
top = Math.max(0, top + topOffset);
// 팝업 옵션 설정
var popupOptions = 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',resizable=yes,scrollbars=yes';
// 팝업 창 열기
return window.open(url, windowName, popupOptions);
}

Loading…
Cancel
Save