From 416a7380eb0b147d715ac87cbca13a53045429f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Thu, 3 Mar 2022 15:58:37 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=8F=84=EC=82=AC=EC=9A=A9=EC=9A=94?= =?UTF-8?q?=EC=B2=AD=20=EC=9E=91=EC=84=B1=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=ED=99=94=20=EC=9E=91=EC=97=85=EC=A4=91.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mca/cmmn/web/MapController.java | 2 +- src/main/webapp/WEB-INF/jsp/admin/request.jsp | 2 +- src/main/webapp/WEB-INF/jsp/map/request.jsp | 160 ++---- .../webapp/WEB-INF/jsp/map/requestWrite.jsp | 538 ++++++------------ src/main/webapp/css/style.css | 27 +- src/main/webapp/js/map/request.js | 240 ++++++++ 6 files changed, 483 insertions(+), 486 deletions(-) create mode 100644 src/main/webapp/js/map/request.js diff --git a/src/main/java/com/mca/cmmn/web/MapController.java b/src/main/java/com/mca/cmmn/web/MapController.java index 5da997f..777d2d3 100644 --- a/src/main/java/com/mca/cmmn/web/MapController.java +++ b/src/main/java/com/mca/cmmn/web/MapController.java @@ -214,7 +214,7 @@ public class MapController { model.addAttribute("layersVO", layersVO); model.addAttribute("cityList", cityList); - return "map/requestWrite"; + return "map/html/requestWrite"; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/src/main/webapp/WEB-INF/jsp/admin/request.jsp b/src/main/webapp/WEB-INF/jsp/admin/request.jsp index 8d8b648..40de297 100644 --- a/src/main/webapp/WEB-INF/jsp/admin/request.jsp +++ b/src/main/webapp/WEB-INF/jsp/admin/request.jsp @@ -3,7 +3,7 @@ <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> <%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> - +
diff --git a/src/main/webapp/WEB-INF/jsp/map/request.jsp b/src/main/webapp/WEB-INF/jsp/map/request.jsp index 1d6b7e3..aec22b3 100644 --- a/src/main/webapp/WEB-INF/jsp/map/request.jsp +++ b/src/main/webapp/WEB-INF/jsp/map/request.jsp @@ -4,6 +4,12 @@ <%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> + +
@@ -14,111 +20,69 @@
- - - - - - - - - +
번호작업명날짜상태
+ + + + + + + + - - - - - - - - - - - - - - - -
번호작업명날짜상태
${idx.count}${item.title}${item.r_date} - - - - - -
요청한 목록이 없습니다.
-
-
-

- -

-
- -
- - + + + + ${idx.count} + ${item.title} + ${item.r_date} + + + + + + + + + + + + 요청한 목록이 없습니다. + + +
+
+
+
+ + +
+
+ +
+
- + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/map/requestWrite.jsp b/src/main/webapp/WEB-INF/jsp/map/requestWrite.jsp index fb7bec1..dd81faf 100644 --- a/src/main/webapp/WEB-INF/jsp/map/requestWrite.jsp +++ b/src/main/webapp/WEB-INF/jsp/map/requestWrite.jsp @@ -4,369 +4,177 @@ <%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
지도 사용 요청
작업명
기간 - ~ - -
장소 -
- - - - 추가 -
-
-
-
레이어 - - - - - -
- - - - - -
- - - - - -
요청 내용
-
-

- -

-

- -

-
-
-
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
작업명
기간 + ~ + +
장소 +
+ + + + 추가 +
+
+
+
레이어 + + + + + +
+ + + + + +
+ + + + + +
요청 내용
+
+

+ +

+
+ + + + diff --git a/src/main/webapp/css/style.css b/src/main/webapp/css/style.css index 61dbd8b..6919273 100644 --- a/src/main/webapp/css/style.css +++ b/src/main/webapp/css/style.css @@ -641,29 +641,14 @@ a { width:100%; margin-top: 20px; } -.detail_table > thead>tr:first-child>th { - border: 1px solid #ccc; - background-color: #337ab7; - padding: 10px 5px; - text-align: left; - color: #fff; -} -.detail_table > thead>tr:first-child>th { - border: 1px solid #ccc; - background-color: #337ab7; - padding: 10px 5px; - text-align: left; - color: #fff; -} + .detail_table > tbody> tr >th { - text-align:center; height:auto; - width:120px; - border: 1px solid #ccc; - background-color: #f8f8f8; - padding: 10px 5px; - text-align: left; - text-align: center; + width:100px; + border: 1px solid #ccc; + background-color: #f8f8f8; + padding: 10px 5px; + text-align: center; } .detail_table > tbody> tr >td { border:1px solid #ccc; diff --git a/src/main/webapp/js/map/request.js b/src/main/webapp/js/map/request.js new file mode 100644 index 0000000..ad4c60a --- /dev/null +++ b/src/main/webapp/js/map/request.js @@ -0,0 +1,240 @@ +let mapRequestModal; +$(function(){ + viewPaging(); + $(".r_date").each(function(){ + var r_date = $(this).text(); + var nowDate = new Date(); + var r_date = new Date(r_date); + var getDay = getFormatDate(r_date); + var nowDay = getFormatDate(nowDate); + + if(getDay === nowDay){ + $(this).html(getFormatTime(r_date)); + }else{ + $(this).html(getDay); + } + }); + mapRequestModal = new bootstrap.Modal(document.getElementById('mapRequestModal')); +}); + +$(document).on('click', '#mapRequestModalBtn', function (){ + $.ajax({ + url: '/map/reqWrite', + type: 'GET', + dataType:"html", + success: function(html){ + $("#mapRequestModalBody").empty().append(html); + mapRequestModal.show(); + }, + error:function(){ + + } + }); +}) + +/* 날짜포맷 yyyy-MM-dd 변환 */ +function getFormatDate(date){ + var year = date.getFullYear(); + var month = (1 + date.getMonth()); + month = month >= 10 ? month : '0' + month; + var day = date.getDate(); + day = day >= 10 ? day : '0' + day; + return year + '-' + month + '-' + day; +} + +function getFormatTime(date){ + var hours = date.getHours(); + var minutes = date.getMinutes(); + return hours + ':' + minutes; +} + +function viewPaging(){ + for (step = start; step < end; step++) { + if(step == now){ + $("#paging").append(""+step+""); + }else{ + $("#paging").append(""+step+""); + } + } +} + +function fn_link_page(pageNo) { + document.searchForm.pageIndex.value = pageNo; + document.searchForm.action = '/map/request'; + document.searchForm.submit(); +} + +/* + * 지역 추가 + */ +function addAreaBtn(){ + var addedAreaWrapCnt = $(".addedAreaWrap").length; + + if(addedAreaWrapCnt < 3){ + if($("#city").val() != "0"){ + areaAddCount++; + var selectAreaCode = null; + var selectAreaName = null; + if($("#town").val() == "0"){ + selectArea = $("#county").val(); + selectAreaName = $("#city option:selected").text() +" "+ $("#county option:selected").text(); + if($("#county").val() == "0"){ + selectArea = $("#city").val(); + selectAreaName = $("#city option:selected").text(); + } + }else{ + selectArea = $("#town").val(); + selectAreaName = $("#city option:selected").text()+" "+$("#county option:selected").text()+" "+$("#town option:selected").text(); + } + var overLapArea = false; + $("input[name=selectArea]").each(function(){ + if($(this).val() == selectArea){ + overLapArea = true; + } + }); + if(overLapArea){ + alert('이미 등록된 장소 입니다.'); + return false; + }else{ + var tag = ''; + tag += ''; + tag += selectAreaName; + tag += ''; + tag += ''; + tag += ''; + $("#addedArea").append(tag); + } + }else{ + alert('지역을 선택해주세요.'); + } + }else{ + alert('더 이상 추가 하실 수 없습니다.'); + } +} + +/* +* 지역 변경 +*/ +function changeAreaList(code, area){ + var target = null + if(area == "city"){ + target = $("#county"); + }else{ + target = $("#town"); + } + resetSelectBox(area); + if(code != 0){ + $.ajax({ + url : '/selectAreaList', + type : "GET", + dataType : "json", + data:{ + "code" : code, + "area" : area + }, + success : function(data){ + if(data){ + if(area == "city"){ + for(var idx in data){ + target.append(""); + } + }else{ + for(var idx in data){ + target.append(""); + } + } + } + } + }); + } +} + +/* +* 지역 삭제 +* removeNum : 삭제할 태그 번호 +*/ +function removeAreaBtn(removeNum){ + $("#addedAreaWrap"+removeNum).remove(); +} + +function resetSelectBox(area){ + var baseOption = ""; + if(area === "county"){ + $("#town").empty().append(baseOption); + }else if(area === "city"){ + $("#county").empty().append(baseOption); + $("#town").empty().append(baseOption); + } +} + +/* +* 날짜 변경 +* state : 시작 또는 종료 +*/ +function dateChange(state){ + var startDate = $("#startDate"); + var endDate = $("#endDate"); + if(endDate.val() !== "" && startDate.val() > endDate.val()){ + if(state === "start"){ + endDate.val(startDate.val()); + }else{ + startDate.val(endDate.val()); + } + } +} + +/* +* 지역 유효성 검사 +*/ +function areaCheck(){ + var selectArr = []; + $("input[name=selectArea]").each(function(){ + selectArr.push($(this).val()); + }); + const places = $("#places"); + places.val(selectArr); + + return places.val() !== ""; +} + +/* +* 레이어 유효성 검사 +*/ +function layersCheck(){ + var checkArr = []; // 배열 초기화 + $('input:checkbox[name="facility"]:checked').each(function(index, item) { + checkArr.push($(item).val()); + }); + $('input:checkbox[name="structure"]:checked').each(function(index, item) { + checkArr.push($(item).val()); + }); + $('input:checkbox[name="ground"]:checked').each(function(index, item) { + checkArr.push($(item).val()); + }); + const layers = $('#layers'); + layers.val(checkArr); + + return layers.val() !== ""; +} + +function insertReqBtn(){ + const endDate = $("#endDate"); + const startDate = $("#startDate"); + const title = $("#title"); + if(title.val() === ""){ + alert('작업명을 입력해주세요.'); + title.focus(); + }else if(startDate.val() === ""){ + alert('시작 기간을 입력해주세요.'); + startDate.focus(); + }else if(endDate.val() === ""){ + alert('종료 기간을 입력해주세요.'); + endDate.focus(); + }else if(!areaCheck()){ + alert('지역을 추가해주세요.'); + }else if(!layersCheck()){ + alert('레이어를 선택해주세요.'); + }else{ + $("#insertFrm").submit(); + } +} \ No newline at end of file