단속 > 단속 등록&열람: UI 버튼 스타일 정리, 팝업/컨트롤러 mode 값 등록(C)/수정(U)/보기(V)로 통일, 관련 URL 및 로직 수정

dev
박성영 4 months ago
parent 70898974d9
commit ec5d42627a

@ -12,6 +12,11 @@ This project is the "Ilsan Dong-gu Illegal Building Integrated Management System
### 각 컨트롤러 클래스에 스웨거 적용
### 기존소스의 공백제거 등 로직에 필요없는 부분은 수정 불가!!
### mvc 패턴, springboot + mybatis + jsp 구조, tiles 사용
### view 단과, controller, 등 mode 값을 통일 시켜줘
- mode : C = 등록
- mode : U = 수정
- mode : V = 보기
- mode : D = 삭제
### session 보안
### 기본적인 코딩 스타일은 noticeSample 참조 (xml, java, jsp)
### url 은 기본적으로 <c:url/> 사용

@ -69,19 +69,27 @@ public class BldgNewPrcCrtrAmtController {
}
/**
* / .
* PK(, ) , .
* // .
* mode (C), (U), (V) .
* @param vo PK VO
* @param mode (C: , U: , V: )
* @param model
* @return
*/
@GetMapping("/bldgNewPrcCrtrAmtPopup.do")
@Operation(summary = "등록/수정 팝업", description = "window.open으로 호출되는 팝업")
public String popup(@ModelAttribute BldgNewPrcCrtrAmtVO vo, Model model){
log.debug("건물신축가격기준액 팝업 조회 - 연도: {}, 번호: {}", vo.getYr(), vo.getNo());
if (vo.getYr() != null && vo.getNo() != null){
model.addAttribute("data", service.selectOne(vo));
@Operation(summary = "등록/수정/조회 팝업", description = "window.open으로 호출되는 팝업, mode 파라미터로 C/U/V 구분")
public String popup(
@ModelAttribute BldgNewPrcCrtrAmtVO vo,
@RequestParam(required = false) String mode,
Model model){
log.debug("건물신축가격기준액 팝업 조회 - 모드: {}, 연도: {}, 번호: {}", mode, vo.getYr(), vo.getNo());
// 수정/조회 모드인 경우 기존 데이터 조회
if (("U".equals(mode) || "V".equals(mode)) && vo.getYr() != null && vo.getNo() != null){
BldgNewPrcCrtrAmtVO data = service.selectOne(vo);
model.addAttribute("data", data);
}
return "baseData/bldgNewPrcCrtrAmt/bldgNewPrcCrtrAmtPopup"+ TilesConstants.POPUP;
}

@ -102,7 +102,7 @@ public class CrdnActInfoController {
CrdnActInfoVO data = null;
// 수정 모드인 경우 기존 데이터 조회
if ("update".equals(mode) && actInfoId != null) {
if ("U".equals(mode) && actInfoId != null) {
data = service.selectActInfoByPk(actInfoId);
}

@ -99,15 +99,15 @@
<div class="popup_foot">
<c:choose>
<c:when test="${param.mode eq 'V'}">
<!-- 삭제/보기 모드: 삭제 버튼만 노출 -->
<!-- 보기 모드: 삭제 버튼만 노출 -->
<a href="#" id="btnDelete" class="newbtns bg2">삭제</a>
</c:when>
<c:when test="${not empty data.yr and not empty data.no}">
<c:when test="${param.mode eq 'U'}">
<!-- 수정 모드 -->
<a href="#" id="btnSave" class="newbtns bg4">수정</a>
</c:when>
<c:otherwise>
<!-- 등록 모드 -->
<!-- 등록 모드 (mode=C 또는 mode 없음) -->
<a href="#" id="btnSave" class="newbtns bg4">저장</a>
</c:otherwise>
</c:choose>

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

@ -10,7 +10,7 @@
<div class="popup_tit">
<h2 class="tit" id="popupTitle">
<c:choose>
<c:when test="${mode eq 'update'}">불법행위정보 수정</c:when>
<c:when test="${mode eq 'U'}">불법행위정보 수정</c:when>
<c:otherwise>불법행위정보 등록</c:otherwise>
</c:choose>
</h2>
@ -346,11 +346,11 @@
var mode = $('#mode').val();
var formData = $('#actInfoForm').serialize();
var url = (mode === 'update') ?
var url = (mode === 'U') ?
'<c:url value="/crdn/crndRegistAndView/crdnActInfo/update.ajax"/>' :
'<c:url value="/crdn/crndRegistAndView/crdnActInfo/insert.ajax"/>';
var actionText = (mode === 'update') ? '수정' : '등록';
var actionText = (mode === 'U') ? '수정' : '등록';
$.ajax({
url: url,

@ -111,14 +111,14 @@
<div class="popup_foot">
<c:choose>
<c:when test="${param.mode eq 'V'}">
<a href="#" id="btnDelete" class="newbtns bg2">삭제</a>
<a href="#" id="btnDelete" class="newbtns bg6">삭제</a>
<a href="#" id="btnSave" class="newbtns bg4">수정</a>
</c:when>
<c:otherwise>
<a href="#" id="btnSave" class="newbtns bg4">저장</a>
<a href="#" id="btnSave" class="newbtns bg1">저장</a>
</c:otherwise>
</c:choose>
<a href="#" class="newbtns bg1 modalclose">닫기</a>
<a href="#" class="newbtns bg2 modalclose">닫기</a>
</div>
</div>
</div>

@ -286,13 +286,13 @@
return;
}
// 중요로직: 수정모드 팝업 URL 구성 (mode=update, actInfoId 추가)
// 중요로직: 수정모드 팝업 URL 구성 (mode=U, actInfoId 추가)
var url = '<c:url value="/crdn/crndRegistAndView/crdnActInfo/crdnActInfoRegistPopup.do"/>'
+ '?crdnYr=' + encodeURIComponent(crdnYr)
+ '&pstnInfoId=' + encodeURIComponent(pstnInfoId)
+ '&crdnNo=' + encodeURIComponent(crdnNo)
+ '&actInfoId=' + encodeURIComponent(actInfoId)
+ '&mode=update';
+ '&mode=U';
var w = 1200, h = 480;
var left = Math.max(0, (screen.width - w) / 2);

@ -106,7 +106,7 @@
<li class="tit">1. 위치 정보</li>
<li class="rig">
<button type="button" id="pstnInfoRegistBtn" class="newbtn bg2-1">위치정보 추가</button>
<button type="button" id="pstnInfoDeleteBtn" class="newbtn bg2">삭제</button>
<button type="button" id="pstnInfoDeleteBtn" class="newbtn bg6">삭제</button>
</li>
</ul>
<div class="containers">
@ -120,7 +120,7 @@
<li class="tit">2. 소유자 정보</li>
<li class="rig">
<button type="button" id="ownrSelectBtn" class="newbtn bg2-1">소유자 선택</button>
<button type="button" id="ownrRemoveBtn" class="newbtn bg2" style="margin-left: 5px;">제거</button>
<button type="button" id="ownrRemoveBtn" class="newbtn bg6" style="margin-left: 5px;">삭제</button>
</li>
</ul>
<div class="containers">

@ -266,9 +266,9 @@ ol {
.newbtn.bg4,
.newbtns.bg4,
.newbtnss.bg4 {
background-color: #007bff;
background-color: #034186;
color: #fff;
border-color: #007bff;
border-color: #034186;
}
.newbtn.bg4:disabled,
@ -293,6 +293,21 @@ ol {
cursor: not-allowed;
}
.newbtn.bg6,
.newbtns.bg6,
.newbtnss.bg6 {
background-color: #fff !important;
color: #8f1e29 !important;
border: 1px solid #8f1e29 !important;
}
.newbtn.bg6:disabled,
.newbtns.bg6:disabled,
.newbtnss.bg6:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.smallb {
padding: 5px 10px;
font-size: 13px;

Loading…
Cancel
Save