From 520c90d498dfc9b5b6cd3ffa1586d3fea3770ae0 Mon Sep 17 00:00:00 2001 From: SeoJin Kim Date: Sun, 25 Apr 2021 23:43:31 +0900 Subject: [PATCH] =?UTF-8?q?[Spring][=EC=87=BC=ED=95=91=EB=AA=B0=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8][21]=20=EC=83=81=ED=92=88?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=88=98=EC=A0=95=20=EA=B5=AC=ED=98=84=20?= =?UTF-8?q?-=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://kimvampa.tistory.com/206 --- .../com/vam/controller/AdminController.java | 4 +- .../WEB-INF/views/admin/goodsDetail.jsp | 33 ++- .../WEB-INF/views/admin/goodsModify.jsp | 155 ++++++++++ .../resources/css/admin/goodsModify.css | 280 ++++++++++++++++++ .../maven/com.vam/controller/pom.properties | 2 +- .../com/vam/controller/AdminController.java | 4 +- .../WEB-INF/views/admin/goodsDetail.jsp | 25 +- .../WEB-INF/views/admin/goodsModify.jsp | 155 ++++++++++ .../resources/css/admin/goodsModify.css | 280 ++++++++++++++++++ .../maven/com.vam/controller/pom.properties | 2 +- 10 files changed, 916 insertions(+), 24 deletions(-) create mode 100644 VamPa/src/main/webapp/WEB-INF/views/admin/goodsModify.jsp create mode 100644 VamPa/src/main/webapp/resources/css/admin/goodsModify.css create mode 100644 VamPa_MySQL/src/main/webapp/WEB-INF/views/admin/goodsModify.jsp create mode 100644 VamPa_MySQL/src/main/webapp/resources/css/admin/goodsModify.css diff --git a/VamPa/src/main/java/com/vam/controller/AdminController.java b/VamPa/src/main/java/com/vam/controller/AdminController.java index 44bdeb2..de60332 100644 --- a/VamPa/src/main/java/com/vam/controller/AdminController.java +++ b/VamPa/src/main/java/com/vam/controller/AdminController.java @@ -82,8 +82,8 @@ public class AdminController { } - /* 상품 조회 페이지 */ - @GetMapping("/goodsDetail") + /* 상품 조회 페이지, 상품 수정 페이지 */ + @GetMapping({"/goodsDetail", "/goodsModify"}) public void goodsGetInfoGET(int bookId, Criteria cri, Model model) throws JsonProcessingException { logger.info("goodsGetInfo()........." + bookId); diff --git a/VamPa/src/main/webapp/WEB-INF/views/admin/goodsDetail.jsp b/VamPa/src/main/webapp/WEB-INF/views/admin/goodsDetail.jsp index 66989d2..217190e 100644 --- a/VamPa/src/main/webapp/WEB-INF/views/admin/goodsDetail.jsp +++ b/VamPa/src/main/webapp/WEB-INF/views/admin/goodsDetail.jsp @@ -138,15 +138,15 @@
- -
+ +
- - - + + +
@@ -161,14 +161,6 @@ $("#discount_interface").attr("value", bookDiscount); - /* 출판일 값 가공 */ - let publeYear = '${goodsInfo.publeYear}'; - let length = publeYear.indexOf(" "); - - publeYear = publeYear.substring(0, length); - - $("input[name='publeYear']").attr("value", publeYear); - /* 책 소개 */ ClassicEditor .create(document.querySelector('#bookIntro_textarea')) @@ -283,6 +275,21 @@ }); // $(document).ready + /* 목록 이동 버튼 */ + $("#cancelBtn").on("click", function(e){ + e.preventDefault(); + $("#moveForm").submit(); + }); + + /* 수정 페이지 이동 */ + $("#modifyBtn").on("click", function(e){ + e.preventDefault(); + let addInput = ''; + $("#moveForm").append(addInput); + $("#moveForm").attr("action", "/admin/goodsModify"); + $("#moveForm").submit(); + }); + diff --git a/VamPa/src/main/webapp/WEB-INF/views/admin/goodsModify.jsp b/VamPa/src/main/webapp/WEB-INF/views/admin/goodsModify.jsp new file mode 100644 index 0000000..c462af0 --- /dev/null +++ b/VamPa/src/main/webapp/WEB-INF/views/admin/goodsModify.jsp @@ -0,0 +1,155 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + + + + + + + + + <%@include file="../includes/admin/header.jsp" %> + +
+
상품 등록
+
+
+
+
+ +
+
+ + 책 이름을 입력해주세요. +
+
+
+
+ +
+
+ + + + 작가를 선택해주세요 +
+
+
+
+ +
+
+ + 출판일을 선택해주세요. +
+
+
+
+ +
+
+ + 출판사를 입력해주세요. +
+
+
+
+ +
+
+
+ 대분류 + +
+
+ 중분류 + +
+
+ 소분류 + +
+ 카테고리를 선택해주세요. +
+
+
+
+ +
+
+ + 상품 가격을 입력해주세요. +
+
+
+
+ +
+
+ + 상품 재고를 입력해주세요. +
+
+
+
+ +
+
+ + + 할인 가격 : + 1~99 숫자를 입력해주세요. +
+
+
+
+ +
+
+ + 책 소개를 입력해주세요. +
+
+
+
+ +
+
+ + 책 목차를 입력해주세요. +
+
+ +
+
+ + +
+
+
+ + + + +
+
+ + <%@include file="../includes/admin/footer.jsp" %> + + \ No newline at end of file diff --git a/VamPa/src/main/webapp/resources/css/admin/goodsModify.css b/VamPa/src/main/webapp/resources/css/admin/goodsModify.css new file mode 100644 index 0000000..6913f36 --- /dev/null +++ b/VamPa/src/main/webapp/resources/css/admin/goodsModify.css @@ -0,0 +1,280 @@ +@charset "UTF-8"; +*{ + margin: 0; + padding:0; +} +a{ + text-decoration: none; +} +ul{ + list-style: none; +} +/* 화면 전체 렙 */ +.wrapper{ + width: 100%; +} +/* content 랩 */ +.wrap{ + width : 1080px; + margin: auto; +} +/* 홈페이지 기능 네비 */ +.top_gnb_area{ + width: 100%; + height: 50px; + background-color: #f0f0f1; + position:relative; +} +.top_gnb_area .list{ + position: absolute; + top: 0px; + right: 0; + +} +.top_gnb_area .list li{ + list-style: none; + float : left; + padding: 13px 15px 0 10px; + font-weight: 900; + cursor: pointer; +} + +/* 관리제 페이지 상단 현페이지 정보 */ +.admin_top_wrap{ + height:110px; + line-height: 110px; + background-color: #5080bd; + margin-bottom: 15px; +} +.admin_top_wrap>span{ + margin-left: 30px; + display:inline-block; + color: white; + font-size: 50px; + font-weight: bolder; +} +/* 관리자 wrap(네비+컨텐츠) */ +.admin_wrap{ + + +} + +/* 관리자페이지 네비 영역 */ +.admin_navi_wrap{ + width: 20%; + height: 300px; + float:left; + height: 100%; +} +.admin_navi_wrap li{ + display: block; + height: 80px; + line-height: 80px; + text-align: center; +} +.admin_navi_wrap li a{ + display: block; + height: 100%; + width: 95%; + margin: 0 auto; + cursor: pointer; + font-size: 30px; + font-weight: bolder; +} +.admin_navi_wrap li a:link {color: black;} +.admin_navi_wrap li a:visited {color: black;} +.admin_navi_wrap li a:active {color: black;} +.admin_navi_wrap li a:hover {color: black;} + +.admin_list_01{ + background-color: #c8c8c8; +} + + +/* 관리자페이지 컨텐츠 영역 */ +.admin_content_wrap{ + width: 80%; + float:left; + min-height: 700px; +} +.admin_content_subject{ /* 관리자 컨텐츠 제목 영역 */ + font-size: 40px; + font-weight: bolder; + padding-left: 15px; + background-color: #6AAFE6; + height: 80px; + line-height: 80px; + color: white; +} +/* 관리자 컨텐츠 메인 영역 */ +.form_section{ + width: 95%; + margin-left: 2%; + margin-top: 20px; + border: 1px solid #dbdde2; + background-color: #efefef; +} +.form_section_title{ + padding: 20px 35px; +} +.form_section_title label{ + display: block; + font-size: 20px; + font-weight: 800; +} +.form_section_content{ + padding: 20px 35px; + border-top: 1px solid #dbdde2; +} +.form_section_content input{ + width: 98%; + height: 25px; + font-size: 20px; + padding: 5px 1%; +} + + +.ui-datepicker-trigger { /* 캘린더 css 설정 */ + margin-left: 25px; + width: 14%; + height: 38px; + font-weight: 600; + background-color: #dfe8f5; + font-size: 15px; + cursor:pointer; +} +input[name='publeYear'] { + width: 80%; + text-align: center; +} + + +.authorId_btn { /* 작가 선택 css 설정 */ + margin-left: 20px; + width: 14%; + height: 38px; + font-weight: 600; + background-color: #dfe8f5; + font-size: 15px; + cursor:pointer; +} +#authorName_input { + width: 80%; + text-align: center; +} + +.ck-content { /* ckeditor 높이 */ + height: 170px; +} + +/* 버튼 영역 */ +.btn_section{ + text-align: center; + margin: 80px 0; +} +.btn{ + min-width: 180px; + padding: 4px 30px; + font-size: 25px; + font-weight: 600; + line-height: 40px; +} +.enroll_btn{ + background-color: #dbdde2; + margin-left:15px; +} +#enrollBtn:hover { + background-color: #c9cbd0; +} + +.form_section_content select { /* 카테고리 css 설정 */ + width: 92%; + height: 35px; + font-size: 20px; + text-align-last: center; + margin-left: 5px; +} +.cate_wrap span { + font-weight: 600; +} +.cate_wrap:not(:first-child) { + margin-top: 20px; +} + + +.ck_warn{ /* 입력란 공란 경고 태그 */ + display: none; + padding-top: 10px; + text-align: center; + color: #e05757; + font-weight: 300; +} + + +/* footer navai 영역 */ +.footer_nav{ + width:100%; + height:50px; +} +.footer_nav_container{ + width: 100%; + height: 100%; + background-color:#8EC0E4; +} +.footer_nav_container>ul{ + font-weight : bold; + float:left; + list-style:none; + position:relative; + padding-top:10px; + line-height: 27px; + font-family: dotum; + margin-left: 10px; +} +.footer_nav_container>ul>li{ + display:inline; + width: 45px; + height: 19px; + padding: 10px 9px 0 10px; +} +.footer_nav_container>ul>span{ + margin: 0 4px; +} +/* footer 영역 */ +.footer{ + width:100%; + height:130px; + background-color:#D4DFE6; + padding-bottom : 50px; +} +.footer_container{ + width: 100%; + height: 100%; + margin: auto; +} +.footer_left>img { + width: 150%; + height: 130px; + margin-left: -20px; + margin-top: -12px; +} +.footer_left{ + float :left; + width: 170px; + margin-left: 20px; + margin-top : 30px; + +} +.footer_right{ + float :left; + width: 680px; + margin-left: 70px; + margin-top : 30px; +} + + + +/* float 속성 해제 */ +.clearfix{ + clear: both; +} \ No newline at end of file diff --git a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties index 9b4833d..bd0da44 100644 --- a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties +++ b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Fri Apr 23 01:44:53 KST 2021 +#Sun Apr 25 22:01:07 KST 2021 m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project\\VamPa m2e.projectName=VamPa groupId=com.vam diff --git a/VamPa_MySQL/src/main/java/com/vam/controller/AdminController.java b/VamPa_MySQL/src/main/java/com/vam/controller/AdminController.java index c6857dc..517cc5d 100644 --- a/VamPa_MySQL/src/main/java/com/vam/controller/AdminController.java +++ b/VamPa_MySQL/src/main/java/com/vam/controller/AdminController.java @@ -82,8 +82,8 @@ public class AdminController { } - /* 상품 조회 페이지 */ - @GetMapping("/goodsDetail") + /* 상품 조회 페이지, 상품 수정 페이지 */ + @GetMapping({"/goodsDetail", "/goodsModify"}) public void goodsGetInfoGET(int bookId, Criteria cri, Model model) throws JsonProcessingException { logger.info("goodsGetInfo()........." + bookId); diff --git a/VamPa_MySQL/src/main/webapp/WEB-INF/views/admin/goodsDetail.jsp b/VamPa_MySQL/src/main/webapp/WEB-INF/views/admin/goodsDetail.jsp index a8daa80..217190e 100644 --- a/VamPa_MySQL/src/main/webapp/WEB-INF/views/admin/goodsDetail.jsp +++ b/VamPa_MySQL/src/main/webapp/WEB-INF/views/admin/goodsDetail.jsp @@ -138,15 +138,15 @@
- -
+ +
- - - + + +
@@ -275,6 +275,21 @@ }); // $(document).ready + /* 목록 이동 버튼 */ + $("#cancelBtn").on("click", function(e){ + e.preventDefault(); + $("#moveForm").submit(); + }); + + /* 수정 페이지 이동 */ + $("#modifyBtn").on("click", function(e){ + e.preventDefault(); + let addInput = ''; + $("#moveForm").append(addInput); + $("#moveForm").attr("action", "/admin/goodsModify"); + $("#moveForm").submit(); + }); + diff --git a/VamPa_MySQL/src/main/webapp/WEB-INF/views/admin/goodsModify.jsp b/VamPa_MySQL/src/main/webapp/WEB-INF/views/admin/goodsModify.jsp new file mode 100644 index 0000000..c462af0 --- /dev/null +++ b/VamPa_MySQL/src/main/webapp/WEB-INF/views/admin/goodsModify.jsp @@ -0,0 +1,155 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + + + + + + + + + <%@include file="../includes/admin/header.jsp" %> + +
+
상품 등록
+
+
+
+
+ +
+
+ + 책 이름을 입력해주세요. +
+
+
+
+ +
+
+ + + + 작가를 선택해주세요 +
+
+
+
+ +
+
+ + 출판일을 선택해주세요. +
+
+
+
+ +
+
+ + 출판사를 입력해주세요. +
+
+
+
+ +
+
+
+ 대분류 + +
+
+ 중분류 + +
+
+ 소분류 + +
+ 카테고리를 선택해주세요. +
+
+
+
+ +
+
+ + 상품 가격을 입력해주세요. +
+
+
+
+ +
+
+ + 상품 재고를 입력해주세요. +
+
+
+
+ +
+
+ + + 할인 가격 : + 1~99 숫자를 입력해주세요. +
+
+
+
+ +
+
+ + 책 소개를 입력해주세요. +
+
+
+
+ +
+
+ + 책 목차를 입력해주세요. +
+
+ +
+
+ + +
+
+
+ + + + +
+
+ + <%@include file="../includes/admin/footer.jsp" %> + + \ No newline at end of file diff --git a/VamPa_MySQL/src/main/webapp/resources/css/admin/goodsModify.css b/VamPa_MySQL/src/main/webapp/resources/css/admin/goodsModify.css new file mode 100644 index 0000000..6913f36 --- /dev/null +++ b/VamPa_MySQL/src/main/webapp/resources/css/admin/goodsModify.css @@ -0,0 +1,280 @@ +@charset "UTF-8"; +*{ + margin: 0; + padding:0; +} +a{ + text-decoration: none; +} +ul{ + list-style: none; +} +/* 화면 전체 렙 */ +.wrapper{ + width: 100%; +} +/* content 랩 */ +.wrap{ + width : 1080px; + margin: auto; +} +/* 홈페이지 기능 네비 */ +.top_gnb_area{ + width: 100%; + height: 50px; + background-color: #f0f0f1; + position:relative; +} +.top_gnb_area .list{ + position: absolute; + top: 0px; + right: 0; + +} +.top_gnb_area .list li{ + list-style: none; + float : left; + padding: 13px 15px 0 10px; + font-weight: 900; + cursor: pointer; +} + +/* 관리제 페이지 상단 현페이지 정보 */ +.admin_top_wrap{ + height:110px; + line-height: 110px; + background-color: #5080bd; + margin-bottom: 15px; +} +.admin_top_wrap>span{ + margin-left: 30px; + display:inline-block; + color: white; + font-size: 50px; + font-weight: bolder; +} +/* 관리자 wrap(네비+컨텐츠) */ +.admin_wrap{ + + +} + +/* 관리자페이지 네비 영역 */ +.admin_navi_wrap{ + width: 20%; + height: 300px; + float:left; + height: 100%; +} +.admin_navi_wrap li{ + display: block; + height: 80px; + line-height: 80px; + text-align: center; +} +.admin_navi_wrap li a{ + display: block; + height: 100%; + width: 95%; + margin: 0 auto; + cursor: pointer; + font-size: 30px; + font-weight: bolder; +} +.admin_navi_wrap li a:link {color: black;} +.admin_navi_wrap li a:visited {color: black;} +.admin_navi_wrap li a:active {color: black;} +.admin_navi_wrap li a:hover {color: black;} + +.admin_list_01{ + background-color: #c8c8c8; +} + + +/* 관리자페이지 컨텐츠 영역 */ +.admin_content_wrap{ + width: 80%; + float:left; + min-height: 700px; +} +.admin_content_subject{ /* 관리자 컨텐츠 제목 영역 */ + font-size: 40px; + font-weight: bolder; + padding-left: 15px; + background-color: #6AAFE6; + height: 80px; + line-height: 80px; + color: white; +} +/* 관리자 컨텐츠 메인 영역 */ +.form_section{ + width: 95%; + margin-left: 2%; + margin-top: 20px; + border: 1px solid #dbdde2; + background-color: #efefef; +} +.form_section_title{ + padding: 20px 35px; +} +.form_section_title label{ + display: block; + font-size: 20px; + font-weight: 800; +} +.form_section_content{ + padding: 20px 35px; + border-top: 1px solid #dbdde2; +} +.form_section_content input{ + width: 98%; + height: 25px; + font-size: 20px; + padding: 5px 1%; +} + + +.ui-datepicker-trigger { /* 캘린더 css 설정 */ + margin-left: 25px; + width: 14%; + height: 38px; + font-weight: 600; + background-color: #dfe8f5; + font-size: 15px; + cursor:pointer; +} +input[name='publeYear'] { + width: 80%; + text-align: center; +} + + +.authorId_btn { /* 작가 선택 css 설정 */ + margin-left: 20px; + width: 14%; + height: 38px; + font-weight: 600; + background-color: #dfe8f5; + font-size: 15px; + cursor:pointer; +} +#authorName_input { + width: 80%; + text-align: center; +} + +.ck-content { /* ckeditor 높이 */ + height: 170px; +} + +/* 버튼 영역 */ +.btn_section{ + text-align: center; + margin: 80px 0; +} +.btn{ + min-width: 180px; + padding: 4px 30px; + font-size: 25px; + font-weight: 600; + line-height: 40px; +} +.enroll_btn{ + background-color: #dbdde2; + margin-left:15px; +} +#enrollBtn:hover { + background-color: #c9cbd0; +} + +.form_section_content select { /* 카테고리 css 설정 */ + width: 92%; + height: 35px; + font-size: 20px; + text-align-last: center; + margin-left: 5px; +} +.cate_wrap span { + font-weight: 600; +} +.cate_wrap:not(:first-child) { + margin-top: 20px; +} + + +.ck_warn{ /* 입력란 공란 경고 태그 */ + display: none; + padding-top: 10px; + text-align: center; + color: #e05757; + font-weight: 300; +} + + +/* footer navai 영역 */ +.footer_nav{ + width:100%; + height:50px; +} +.footer_nav_container{ + width: 100%; + height: 100%; + background-color:#8EC0E4; +} +.footer_nav_container>ul{ + font-weight : bold; + float:left; + list-style:none; + position:relative; + padding-top:10px; + line-height: 27px; + font-family: dotum; + margin-left: 10px; +} +.footer_nav_container>ul>li{ + display:inline; + width: 45px; + height: 19px; + padding: 10px 9px 0 10px; +} +.footer_nav_container>ul>span{ + margin: 0 4px; +} +/* footer 영역 */ +.footer{ + width:100%; + height:130px; + background-color:#D4DFE6; + padding-bottom : 50px; +} +.footer_container{ + width: 100%; + height: 100%; + margin: auto; +} +.footer_left>img { + width: 150%; + height: 130px; + margin-left: -20px; + margin-top: -12px; +} +.footer_left{ + float :left; + width: 170px; + margin-left: 20px; + margin-top : 30px; + +} +.footer_right{ + float :left; + width: 680px; + margin-left: 70px; + margin-top : 30px; +} + + + +/* float 속성 해제 */ +.clearfix{ + clear: both; +} \ No newline at end of file diff --git a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties index eff3868..573ea48 100644 --- a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties +++ b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Thu Apr 22 18:29:14 KST 2021 +#Sun Apr 25 22:01:08 KST 2021 m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project\\VamPa_MySQL m2e.projectName=VamPa_MySQL groupId=com.vam