--- src/main/java/itn/com/uss/ion/bnr/pop/service/MainPopupLinkVO.java
+++ src/main/java/itn/com/uss/ion/bnr/pop/service/MainPopupLinkVO.java
... | ... | @@ -35,5 +35,6 @@ |
| 35 | 35 |
private String popId; // 메인존ID |
| 36 | 36 |
private String mlink; // 링크 |
| 37 | 37 |
private String coords; // 링크좌표 |
| 38 |
+ private String popLinkId; // 링크좌표 |
|
| 38 | 39 |
|
| 39 | 40 |
} |
--- src/main/java/itn/com/uss/ion/bnr/pop/service/MainPopupManageService.java
+++ src/main/java/itn/com/uss/ion/bnr/pop/service/MainPopupManageService.java
... | ... | @@ -1,13 +1,8 @@ |
| 1 | 1 |
package itn.com.uss.ion.bnr.pop.service; |
| 2 | 2 |
|
| 3 | 3 |
import java.util.List; |
| 4 |
-import java.util.Map; |
|
| 5 | 4 |
|
| 6 |
-import itn.com.uss.ion.pwm.service.MainzoneVO; |
|
| 7 |
-import itn.com.uss.ion.pwm.service.PopupManageVO; |
|
| 8 |
-import itn.com.uss.ion.pwm.service.PopupzoneVO; |
|
| 9 |
-import itn.com.uss.ion.pwm.service.SocialVO; |
|
| 10 |
-import itn.com.uss.ion.pwm.service.SortVO; |
|
| 5 |
+import itn.com.cmm.RestResponse; |
|
| 11 | 6 |
|
| 12 | 7 |
/** |
| 13 | 8 |
* 개요 |
... | ... | @@ -34,4 +29,6 @@ |
| 34 | 29 |
|
| 35 | 30 |
public void resetMainPopupSort(MainPopupVO mainPopupVO); |
| 36 | 31 |
|
| 32 |
+ public RestResponse deleteMainPopupLink(MainPopupLinkVO mainPopupLinkVO); |
|
| 33 |
+ |
|
| 37 | 34 |
}(No newline at end of file) |
--- src/main/java/itn/com/uss/ion/bnr/pop/service/impl/MainPopupManageDAO.java
+++ src/main/java/itn/com/uss/ion/bnr/pop/service/impl/MainPopupManageDAO.java
... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 |
import org.springframework.stereotype.Repository; |
| 5 | 5 |
|
| 6 | 6 |
import itn.com.cmm.service.impl.EgovComAbstractDAO; |
| 7 |
+import itn.com.uss.ion.bnr.pop.service.MainPopupLinkVO; |
|
| 7 | 8 |
import itn.com.uss.ion.bnr.pop.service.MainPopupVO; |
| 8 | 9 |
|
| 9 | 10 |
/** |
... | ... | @@ -46,8 +47,8 @@ |
| 46 | 47 |
} |
| 47 | 48 |
|
| 48 | 49 |
|
| 49 |
- public void deleteMainPopup(String mazId) {
|
|
| 50 |
- delete("mainPopup.deleteMainPopup", mazId);
|
|
| 50 |
+ public void deleteMainPopup(String popId) {
|
|
| 51 |
+ delete("mainPopup.deleteMainPopup", popId);
|
|
| 51 | 52 |
} |
| 52 | 53 |
|
| 53 | 54 |
|
... | ... | @@ -55,4 +56,7 @@ |
| 55 | 56 |
update("mainPopup.resetMainPopupSort", mainPopupVO);
|
| 56 | 57 |
} |
| 57 | 58 |
|
| 59 |
+ public void deleteMainPopupLinkInfo(MainPopupLinkVO mainPopupLinkVO) {
|
|
| 60 |
+ delete("mainPopup.deleteMainPopupLinkInfo", mainPopupLinkVO);
|
|
| 61 |
+ } |
|
| 58 | 62 |
}(No newline at end of file) |
--- src/main/java/itn/com/uss/ion/bnr/pop/service/impl/MainPopupManageServiceImpl.java
+++ src/main/java/itn/com/uss/ion/bnr/pop/service/impl/MainPopupManageServiceImpl.java
... | ... | @@ -4,12 +4,16 @@ |
| 4 | 4 |
|
| 5 | 5 |
import javax.annotation.Resource; |
| 6 | 6 |
|
| 7 |
+import org.springframework.http.HttpStatus; |
|
| 7 | 8 |
import org.springframework.stereotype.Service; |
| 8 | 9 |
|
| 9 | 10 |
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; |
| 10 | 11 |
import egovframework.rte.fdl.idgnr.EgovIdGnrService; |
| 12 |
+import itn.com.cmm.RestResponse; |
|
| 13 |
+import itn.com.uss.ion.bnr.pop.service.MainPopupLinkVO; |
|
| 11 | 14 |
import itn.com.uss.ion.bnr.pop.service.MainPopupManageService; |
| 12 | 15 |
import itn.com.uss.ion.bnr.pop.service.MainPopupVO; |
| 16 |
+import itn.com.uss.ion.pwm.service.impl.PopupManageDAO; |
|
| 13 | 17 |
|
| 14 | 18 |
/** |
| 15 | 19 |
* 개요 |
... | ... | @@ -29,7 +33,9 @@ |
| 29 | 33 |
@Resource(name = "mainPopupManageDAO") |
| 30 | 34 |
public MainPopupManageDAO dao; |
| 31 | 35 |
|
| 32 |
- |
|
| 36 |
+ @Resource(name = "popupManageDAO") |
|
| 37 |
+ public PopupManageDAO popupDao; |
|
| 38 |
+ |
|
| 33 | 39 |
@Resource(name = "egovPopupManageIdGnrService") |
| 34 | 40 |
private EgovIdGnrService idgenService; |
| 35 | 41 |
|
... | ... | @@ -59,6 +65,7 @@ |
| 59 | 65 |
|
| 60 | 66 |
@Override |
| 61 | 67 |
public void deleteMainPopup(String id) {
|
| 68 |
+ popupDao.deleteMainPopupLinkInfo(id); |
|
| 62 | 69 |
dao.deleteMainPopup(id); |
| 63 | 70 |
} |
| 64 | 71 |
|
... | ... | @@ -68,5 +75,15 @@ |
| 68 | 75 |
|
| 69 | 76 |
} |
| 70 | 77 |
|
| 78 |
+ @Override |
|
| 79 |
+ public RestResponse deleteMainPopupLink(MainPopupLinkVO mainPopupLinkVO) {
|
|
| 80 |
+ dao.deleteMainPopupLinkInfo(mainPopupLinkVO); |
|
| 81 |
+ |
|
| 82 |
+ return RestResponse.builder() |
|
| 83 |
+ .status(HttpStatus.OK) // 200, Series.SUCCESSFUL, "OK" |
|
| 84 |
+ .msg("삭제 되었습니다.")
|
|
| 85 |
+ .build(); |
|
| 86 |
+ |
|
| 87 |
+ } |
|
| 71 | 88 |
|
| 72 | 89 |
}(No newline at end of file) |
--- src/main/java/itn/com/uss/ion/bnr/pop/web/MainPopupController.java
+++ src/main/java/itn/com/uss/ion/bnr/pop/web/MainPopupController.java
... | ... | @@ -12,11 +12,15 @@ |
| 12 | 12 |
import org.slf4j.Logger; |
| 13 | 13 |
import org.slf4j.LoggerFactory; |
| 14 | 14 |
import org.springframework.beans.factory.annotation.Autowired; |
| 15 |
+import org.springframework.http.HttpStatus; |
|
| 16 |
+import org.springframework.http.ResponseEntity; |
|
| 15 | 17 |
import org.springframework.stereotype.Controller; |
| 16 | 18 |
import org.springframework.ui.Model; |
| 17 | 19 |
import org.springframework.ui.ModelMap; |
| 20 |
+import org.springframework.web.bind.annotation.RequestBody; |
|
| 18 | 21 |
import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | 22 |
import org.springframework.web.bind.annotation.RequestParam; |
| 23 |
+import org.springframework.web.bind.annotation.ResponseBody; |
|
| 20 | 24 |
import org.springframework.web.servlet.mvc.support.RedirectAttributes; |
| 21 | 25 |
import org.springmodules.validation.commons.DefaultBeanValidator; |
| 22 | 26 |
|
... | ... | @@ -27,15 +31,16 @@ |
| 27 | 31 |
import itn.com.cmm.ComDefaultCodeVO; |
| 28 | 32 |
import itn.com.cmm.EgovMessageSource; |
| 29 | 33 |
import itn.com.cmm.LoginVO; |
| 34 |
+import itn.com.cmm.RestResponse; |
|
| 30 | 35 |
import itn.com.cmm.service.EgovCmmUseService; |
| 31 | 36 |
import itn.com.cmm.service.EgovFileMngService; |
| 32 | 37 |
import itn.com.cmm.service.EgovFileMngUtil; |
| 33 | 38 |
import itn.com.cmm.service.FileVO; |
| 34 | 39 |
import itn.com.cmm.util.RedirectUrlMaker; |
| 40 |
+import itn.com.uss.ion.bnr.pop.service.MainPopupLinkVO; |
|
| 35 | 41 |
import itn.com.uss.ion.bnr.pop.service.MainPopupManageService; |
| 36 | 42 |
import itn.com.uss.ion.bnr.pop.service.MainPopupVO; |
| 37 | 43 |
import itn.com.uss.ion.bnr.sub.service.SubMainZoneManageService; |
| 38 |
-import itn.com.uss.ion.pwm.service.MainzoneVO; |
|
| 39 | 44 |
import itn.let.sym.site.service.EgovSiteManagerService; |
| 40 | 45 |
|
| 41 | 46 |
/** |
... | ... | @@ -243,11 +248,35 @@ |
| 243 | 248 |
RedirectUrlMaker redirectUrlMaker = new RedirectUrlMaker("/uss/ion/bnr/pop/mainPopupList.do");
|
| 244 | 249 |
return redirectUrlMaker.getRedirectUrl(); |
| 245 | 250 |
} |
| 246 |
- |
|
| 247 |
- |
|
| 248 |
- |
|
| 249 |
- |
|
| 250 |
- |
|
| 251 |
+ |
|
| 252 |
+ /** |
|
| 253 |
+ * @methodName : mainPopupLinkDeleteAjax |
|
| 254 |
+ * @author : 이호영 |
|
| 255 |
+ * @date : 2025.03.04 |
|
| 256 |
+ * @description : 메인팝업링크 데이터 삭제 |
|
| 257 |
+ * @param request |
|
| 258 |
+ * @param mainPopupLinkVO |
|
| 259 |
+ * @return |
|
| 260 |
+ * @throws Exception |
|
| 261 |
+ */ |
|
| 262 |
+ @ResponseBody |
|
| 263 |
+ @RequestMapping(value="/uss/ion/bnr/pop/mainPopupLinkDeleteAjax.do") |
|
| 264 |
+ public ResponseEntity<?> mainPopupLinkDeleteAjax( |
|
| 265 |
+ HttpServletRequest request |
|
| 266 |
+ ,@RequestBody MainPopupLinkVO mainPopupLinkVO) throws Exception {
|
|
| 267 |
+ |
|
| 268 |
+ Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); |
|
| 269 |
+ |
|
| 270 |
+ if(!isAuthenticated) {
|
|
| 271 |
+ return ResponseEntity.ok( |
|
| 272 |
+ RestResponse.builder() |
|
| 273 |
+ .status(HttpStatus.UNAUTHORIZED) // 401 권한 인증 에러 |
|
| 274 |
+ .msg("로그인을 하셔야 이용 가능합니다.")
|
|
| 275 |
+ .build() |
|
| 276 |
+ ); |
|
| 277 |
+ } |
|
| 278 |
+ return ResponseEntity.ok(mainPopupManageService.deleteMainPopupLink(mainPopupLinkVO)); |
|
| 279 |
+ } |
|
| 251 | 280 |
|
| 252 | 281 |
|
| 253 | 282 |
|
--- src/main/resources/egovframework/sqlmap/let/uss/ion/bnr/MainPopupManage_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/uss/ion/bnr/MainPopupManage_SQL_Mysql.xml
... | ... | @@ -12,6 +12,7 @@ |
| 12 | 12 |
<typeAlias alias="PopupManageVO" type="itn.com.uss.ion.pwm.service.PopupManageVO" /> |
| 13 | 13 |
<typeAlias alias="popupzoneVO" type="itn.com.uss.ion.pwm.service.PopupzoneVO"/> |
| 14 | 14 |
<typeAlias alias="mainPopupVO" type="itn.com.uss.ion.bnr.pop.service.MainPopupVO"/> |
| 15 |
+ <typeAlias alias="mainPopupLinkVO" type="itn.com.uss.ion.bnr.pop.service.MainPopupLinkVO"/> |
|
| 15 | 16 |
|
| 16 | 17 |
|
| 17 | 18 |
|
... | ... | @@ -19,7 +20,7 @@ |
| 19 | 20 |
<result property="popId" column="POP_ID"></result> |
| 20 | 21 |
<result property="mlink" column="MLINK"></result> |
| 21 | 22 |
<result property="coords" column="COORDS"></result> |
| 22 |
- <result property="sort" column="SORT"></result> |
|
| 23 |
+ <result property="popLinkId" column="POP_LINK_ID"></result> |
|
| 23 | 24 |
</resultMap> |
| 24 | 25 |
|
| 25 | 26 |
|
... | ... | @@ -146,17 +147,17 @@ |
| 146 | 147 |
WHERE MP.POP_ID = #popId# |
| 147 | 148 |
</select> |
| 148 | 149 |
|
| 150 |
+ |
|
| 149 | 151 |
<select id="mainPopup.selectMainPopupVOLink" parameterClass="String" resultMap="MainPopupLinkResultMap"> |
| 150 | 152 |
|
| 151 |
- /* mainPopup.selectMainPopupVO */ |
|
| 153 |
+ /* mainPopup.selectMainPopupVOLink */ |
|
| 152 | 154 |
SELECT |
| 155 |
+ POP_LINK_ID, |
|
| 153 | 156 |
POP_ID, |
| 154 | 157 |
MLINK, |
| 155 |
- COORDS, |
|
| 156 |
- SORT |
|
| 158 |
+ COORDS |
|
| 157 | 159 |
FROM MAIN_POPUP_LINK |
| 158 | 160 |
WHERE POP_ID = #popId# |
| 159 |
- order by SORT asc |
|
| 160 | 161 |
</select> |
| 161 | 162 |
|
| 162 | 163 |
|
... | ... | @@ -196,6 +197,16 @@ |
| 196 | 197 |
DELETE FROM MAIN_POPUP WHERE POP_ID=#popId# |
| 197 | 198 |
</delete> |
| 198 | 199 |
|
| 200 |
+ <delete id="mainPopup.deleteMainPopupLinkInfo" parameterClass="mainPopupLinkVO"> |
|
| 201 |
+ /* mainPopup.deleteMainPopupLinkInfo */ |
|
| 202 |
+ |
|
| 203 |
+ DELETE FROM MAIN_POPUP_LINK |
|
| 204 |
+ WHERE |
|
| 205 |
+ POP_ID=#popId# |
|
| 206 |
+ AND |
|
| 207 |
+ POP_LINK_ID = #popLinkId# |
|
| 208 |
+ </delete> |
|
| 209 |
+ |
|
| 199 | 210 |
|
| 200 | 211 |
<update id="mainPopup.resetMainPopupSort" parameterClass="mainPopupVO"> |
| 201 | 212 |
/*mainPopup.resetMainPopupSort*/ |
--- src/main/resources/egovframework/sqlmap/let/uss/pwm/PopupManage_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/uss/pwm/PopupManage_SQL_Mysql.xml
... | ... | @@ -1083,7 +1083,6 @@ |
| 1083 | 1083 |
POP_ID |
| 1084 | 1084 |
, MLINK |
| 1085 | 1085 |
, COORDS |
| 1086 |
- , SORT |
|
| 1087 | 1086 |
) |
| 1088 | 1087 |
VALUES |
| 1089 | 1088 |
<iterate conjunction=","> |
... | ... | @@ -1091,7 +1090,6 @@ |
| 1091 | 1090 |
#[].popId# |
| 1092 | 1091 |
, #[].mlink# |
| 1093 | 1092 |
, #[].coords# |
| 1094 |
- , #[].sort# |
|
| 1095 | 1093 |
) |
| 1096 | 1094 |
</iterate> |
| 1097 | 1095 |
|
... | ... | @@ -1123,7 +1121,6 @@ |
| 1123 | 1121 |
SET |
| 1124 | 1122 |
MLINK = #mlink# |
| 1125 | 1123 |
, COORDS = #coords# |
| 1126 |
- , SORT = #sort# |
|
| 1127 | 1124 |
WHERE POP_ID = #popId# |
| 1128 | 1125 |
</update> |
| 1129 | 1126 |
|
--- src/main/webapp/WEB-INF/jsp/uss/ion/bnr/pop/mainPopupModify.jsp
+++ src/main/webapp/WEB-INF/jsp/uss/ion/bnr/pop/mainPopupModify.jsp
... | ... | @@ -31,8 +31,18 @@ |
| 31 | 31 |
|
| 32 | 32 |
makeDate('ntceBgndeYYYMMDD');
|
| 33 | 33 |
makeTomorrow('ntceEnddeYYYMMDD');
|
| 34 |
- |
|
| 35 |
- |
|
| 34 |
+ // class="mlink"인 모든 input 요소에 대해 이벤트 리스너 추가 |
|
| 35 |
+ document.getElementById('linkTable').addEventListener('paste', function(event) {
|
|
| 36 |
+ if (event.target.classList.contains('mlink')) {
|
|
| 37 |
+ let pastedText = event.clipboardData.getData("text");
|
|
| 38 |
+ console.log("붙여넣기 한 URL:", pastedText);
|
|
| 39 |
+ let cleanedUrl = cleanUrlParameters(pastedText); |
|
| 40 |
+ setTimeout(() => {
|
|
| 41 |
+ event.target.value = cleanedUrl; |
|
| 42 |
+ console.log("정리된 URL:", cleanedUrl);
|
|
| 43 |
+ }, 0); |
|
| 44 |
+ } |
|
| 45 |
+ }); |
|
| 36 | 46 |
}); |
| 37 | 47 |
|
| 38 | 48 |
/** |
... | ... | @@ -40,39 +50,37 @@ |
| 40 | 50 |
* @param {string} url 원본 URL 문자열
|
| 41 | 51 |
* @returns {string} 불필요한 파라미터가 제거된 URL
|
| 42 | 52 |
*/ |
| 43 |
- function cleanUrlParameters(url) {
|
|
| 44 |
- try {
|
|
| 45 |
- // URL이 절대경로 (/web/... 형태)인지 확인 |
|
| 46 |
- let hasFullDomain = url.startsWith("http://") || url.startsWith("https://");
|
|
| 47 |
- let urlObj; |
|
| 48 |
- |
|
| 49 |
- if (hasFullDomain) {
|
|
| 50 |
- // 도메인이 포함된 URL 처리 |
|
| 51 |
- urlObj = new URL(url); |
|
| 52 |
- } else {
|
|
| 53 |
- // 절대경로 URL 처리 (가상의 도메인 추가 후 파싱) |
|
| 54 |
- urlObj = new URL("https://www.munjaon.co.kr" + url);
|
|
| 55 |
- } |
|
| 56 |
- |
|
| 57 |
- let params = new URLSearchParams(urlObj.search); |
|
| 58 |
- |
|
| 59 |
- // ❗ 값이 비어있는 모든 파라미터 제거 |
|
| 60 |
- for (let [key, value] of [...params.entries()]) { // `params.entries()`를 배열로 변환하여 반복
|
|
| 61 |
- if (!value.trim()) { // 값이 비어있는 경우 제거
|
|
| 62 |
- params.delete(key); |
|
| 63 |
- } |
|
| 64 |
- } |
|
| 65 |
- |
|
| 66 |
- // 정리된 URL 반환 |
|
| 67 |
- let cleanedPath = urlObj.pathname + (params.toString() ? "?" + params.toString() : ""); |
|
| 68 |
- // 정리된 URL 반환 (도메인을 제거하고 절대경로만 반환) |
|
| 69 |
- return cleanedPath.replace(/^https:\/\/www\.munjaon\.co\.kr/, ""); |
|
| 70 |
- |
|
| 71 |
- } catch (e) {
|
|
| 72 |
- console.warn("잘못된 URL 형식:", url);
|
|
| 73 |
- return url; // URL 파싱 실패 시 원본 유지 |
|
| 53 |
+function cleanUrlParameters(url) {
|
|
| 54 |
+ try {
|
|
| 55 |
+ // URL이 절대경로 (/web/... 형태)인지 확인 |
|
| 56 |
+ let hasFullDomain = url.startsWith("http://") || url.startsWith("https://");
|
|
| 57 |
+ let urlObj; |
|
| 58 |
+ |
|
| 59 |
+ if (hasFullDomain) {
|
|
| 60 |
+ // 도메인이 포함된 URL 처리 |
|
| 61 |
+ urlObj = new URL(url); |
|
| 62 |
+ } else {
|
|
| 63 |
+ // 절대경로 URL 처리 (가상의 도메인 추가 후 파싱) |
|
| 64 |
+ urlObj = new URL("https://www.munjaon.co.kr" + url);
|
|
| 74 | 65 |
} |
| 66 |
+ |
|
| 67 |
+ let params = new URLSearchParams(urlObj.search); |
|
| 68 |
+ |
|
| 69 |
+ // 값이 비어있는 모든 파라미터 제거 |
|
| 70 |
+ for (let [key, value] of [...params.entries()]) {
|
|
| 71 |
+ if (!value.trim()) { // 값이 비어있는 경우 제거
|
|
| 72 |
+ params.delete(key); |
|
| 73 |
+ } |
|
| 74 |
+ } |
|
| 75 |
+ |
|
| 76 |
+ // 정리된 URL 반환 |
|
| 77 |
+ let cleanedPath = urlObj.pathname + (params.toString() ? "?" + params.toString() : ""); |
|
| 78 |
+ return cleanedPath.replace(/^https:\/\/www\.munjaon\.co\.kr/, ""); |
|
| 79 |
+ } catch (e) {
|
|
| 80 |
+ console.warn("잘못된 URL 형식:", url);
|
|
| 81 |
+ return url; // URL 파싱 실패 시 원본 유지 |
|
| 75 | 82 |
} |
| 83 |
+} |
|
| 76 | 84 |
|
| 77 | 85 |
//게시기간이 없으면 초기 값 입력 |
| 78 | 86 |
function makeDate(id){
|
... | ... | @@ -141,17 +149,6 @@ |
| 141 | 149 |
for (let i = 0; i < linkRows.length; i++) {
|
| 142 | 150 |
let linkInput = document.querySelector('input[name="mainPopupLinkList['+i+'].mlink"]');
|
| 143 | 151 |
let coordInput = document.querySelector('input[name="mainPopupLinkList['+i+'].coords"]');
|
| 144 |
- let sortInput = document.querySelector('input[name="mainPopupLinkList['+i+'].sort"]');
|
|
| 145 |
- |
|
| 146 |
- if (!linkInput.value && !coordInput.value) {
|
|
| 147 |
- if(sortInput.value){
|
|
| 148 |
- let trElement = sortInput.closest("tr");
|
|
| 149 |
- if (trElement) {
|
|
| 150 |
- trElement.remove(); |
|
| 151 |
- } |
|
| 152 |
- } |
|
| 153 |
- continue; // 요소가 없으면 건너뛴다. |
|
| 154 |
- } |
|
| 155 | 152 |
|
| 156 | 153 |
if (linkInput.value.trim() === "") {
|
| 157 | 154 |
alert('['+(i + 1)+']번째 링크주소를 입력해 주십시오');
|
... | ... | @@ -165,11 +162,6 @@ |
| 165 | 162 |
return false; |
| 166 | 163 |
} |
| 167 | 164 |
|
| 168 |
- if (sortInput.value.trim() === "") {
|
|
| 169 |
- alert('['+(i + 1)+']번째 순서를 입력해 주십시오');
|
|
| 170 |
- sortInput.focus(); |
|
| 171 |
- return false; |
|
| 172 |
- } |
|
| 173 | 165 |
} |
| 174 | 166 |
|
| 175 | 167 |
console.log('isTbodyEmpty("tbody_fiielist") : ', isTbodyEmpty("tbody_fiielist"));
|
... | ... | @@ -286,30 +278,77 @@ |
| 286 | 278 |
coordTd.innerHTML = '<input type="text" name="mainPopupLinkList['+rowCount+'].coords" maxlength="200" />'; |
| 287 | 279 |
|
| 288 | 280 |
// 세 번째 컬럼 (링크 좌표) |
| 289 |
- let sortTh = document.createElement("th");
|
|
| 290 |
- sortTh.innerHTML = '<span>순서</span>'; |
|
| 291 | 281 |
let sortTd = document.createElement("td");
|
| 292 |
- sortTd.innerHTML = '<input type="text" name="mainPopupLinkList['+rowCount+'].sort" maxlength="200" value="'+rowCountP+'" />'; |
|
| 293 |
- |
|
| 282 |
+ sortTd.setAttribute("colspan", "2");
|
|
| 283 |
+ sortTd.innerHTML = '<input type="button" class="btnType2" value="삭제" onclick="fn_linkDel(\'\')" />'; |
|
| 294 | 284 |
// tr에 추가 |
| 295 | 285 |
newRow.appendChild(linkTh); |
| 296 | 286 |
newRow.appendChild(linkTd); |
| 297 | 287 |
newRow.appendChild(coordTh); |
| 298 | 288 |
newRow.appendChild(coordTd); |
| 299 |
- newRow.appendChild(sortTh); |
|
| 300 | 289 |
newRow.appendChild(sortTd); |
| 301 | 290 |
|
| 302 | 291 |
// tbody에 추가 |
| 303 | 292 |
tbody.appendChild(newRow); |
| 304 | 293 |
} |
| 305 | 294 |
|
| 306 |
- |
|
| 295 |
+function fn_linkDel(p_linkId) {
|
|
| 296 |
+ // event.target을 저장 |
|
| 297 |
+ const $target = $(event.target); |
|
| 298 |
+ |
|
| 299 |
+ if (!p_linkId) {
|
|
| 300 |
+ |
|
| 301 |
+ $target.closest('tr').remove();
|
|
| 302 |
+ }else{
|
|
| 303 |
+ |
|
| 304 |
+ var p_popId = $('#popId').val();
|
|
| 305 |
+ var p_popLinkId = p_linkId; |
|
| 306 |
+ |
|
| 307 |
+ var sendData = {
|
|
| 308 |
+ "popId" : p_popId |
|
| 309 |
+ , "popLinkId" : p_popLinkId |
|
| 310 |
+ } |
|
| 311 |
+ |
|
| 312 |
+ $.ajax({
|
|
| 313 |
+ type: 'POST', |
|
| 314 |
+ url: '<c:url value="/uss/ion/bnr/pop/mainPopupLinkDeleteAjax.do" />', |
|
| 315 |
+ contentType: 'application/json', |
|
| 316 |
+ data: JSON.stringify(sendData), |
|
| 317 |
+ dataType: 'json', |
|
| 318 |
+ success : function(data) {
|
|
| 319 |
+ alert(data.msg); |
|
| 320 |
+ console.log('data : ', data);
|
|
| 321 |
+ if(data.status == 'OK') |
|
| 322 |
+ {
|
|
| 323 |
+ console.log('data OK : ', data);
|
|
| 324 |
+ $target.closest('tr').remove();
|
|
| 325 |
+ } |
|
| 326 |
+ else |
|
| 327 |
+ {
|
|
| 328 |
+ // 실패 처리 로직 |
|
| 329 |
+ } |
|
| 330 |
+ }, |
|
| 331 |
+ error : function(jqXHR, textStatus, errorThrown) {
|
|
| 332 |
+ console.error("AJAX Error:", textStatus, errorThrown);
|
|
| 333 |
+ console.error("Response:", jqXHR.responseText);
|
|
| 334 |
+ } |
|
| 335 |
+ }); |
|
| 336 |
+ |
|
| 337 |
+ } |
|
| 338 |
+ |
|
| 339 |
+ |
|
| 340 |
+ |
|
| 341 |
+} |
|
| 307 | 342 |
</script> |
| 308 | 343 |
<style> |
| 309 | 344 |
.date_format{width:91px !important;}
|
| 310 | 345 |
.del_file_btn{border: none;background-color: transparent;background-image: url(/direct/img/upload_delect_img.png);background-repeat: no-repeat;background-position: center center;vertical-align: middle;margin-top: -4px;margin-right: 15px;}
|
| 311 | 346 |
.file_size{color: #0388d2;font-weight: bold;}
|
| 312 | 347 |
.uploaded_obj{width: 100%;}
|
| 348 |
+.btnType2 {
|
|
| 349 |
+ border: 1px solid #456ded; |
|
| 350 |
+ color: #456ded; |
|
| 351 |
+} |
|
| 313 | 352 |
</style> |
| 314 | 353 |
</head> |
| 315 | 354 |
<body> |
... | ... | @@ -441,30 +480,12 @@ |
| 441 | 480 |
<td> |
| 442 | 481 |
<form:input path="mainPopupLinkList[${status.index}].coords" class="mlink" maxlength="200" />
|
| 443 | 482 |
</td> |
| 444 |
- <th><span>순서</span></th> |
|
| 445 |
- <td> |
|
| 446 |
- <form:input path="mainPopupLinkList[${status.index}].sort" class="mlink" maxlength="200" oninput="this.value = this.value.replace(/[^0-9]/g, '');" />
|
|
| 483 |
+ <td colspan="2"> |
|
| 484 |
+ <input type="button" class="btnType2" value="삭제" onclick="fn_linkDel('${link.popLinkId }'); return false;">
|
|
| 447 | 485 |
</td> |
| 448 | 486 |
</tr> |
| 449 | 487 |
</c:forEach> |
| 450 | 488 |
</c:when> |
| 451 |
- <c:otherwise> |
|
| 452 |
- <!-- 값이 없을 때 빈 input 생성 --> |
|
| 453 |
- <tr> |
|
| 454 |
- <th><span>[1]링크주소</span></th> |
|
| 455 |
- <td> |
|
| 456 |
- <form:input path="mainPopupLinkList[0].mlink" class="mlink" maxlength="200" /> |
|
| 457 |
- </td> |
|
| 458 |
- <th><span>링크좌표</span></th> |
|
| 459 |
- <td> |
|
| 460 |
- <form:input path="mainPopupLinkList[0].coords" maxlength="200" /> |
|
| 461 |
- </td> |
|
| 462 |
- <th><span>순서</span></th> |
|
| 463 |
- <td> |
|
| 464 |
- <form:input path="mainPopupLinkList[0].sort" maxlength="200" value="1" oninput="this.value = this.value.replace(/[^0-9]/g, '');" /> |
|
| 465 |
- </td> |
|
| 466 |
- </tr> |
|
| 467 |
- </c:otherwise> |
|
| 468 | 489 |
</c:choose> |
| 469 | 490 |
</tbody> |
| 470 | 491 |
<tr> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?