Index: arms/detail.html =================================================================== diff -u -r4d8d94d2bd9c8e946c394a00094bbcf65401dbc7 -rc16445099412b1817c9f92dd1e856c0512875f53 --- arms/detail.html (.../detail.html) (revision 4d8d94d2bd9c8e946c394a00094bbcf65401dbc7) +++ arms/detail.html (.../detail.html) (revision c16445099412b1817c9f92dd1e856c0512875f53) @@ -174,7 +174,7 @@ - + @@ -703,12 +703,17 @@
+
+
    +
+
- +
+
- +
@@ -871,55 +876,3 @@ --> - - Index: arms/html/armsDetailExceptTemplate/assets/css/detail.css =================================================================== diff -u --- arms/html/armsDetailExceptTemplate/assets/css/detail.css (revision 0) +++ arms/html/armsDetailExceptTemplate/assets/css/detail.css (revision c16445099412b1817c9f92dd1e856c0512875f53) @@ -0,0 +1,440 @@ +.form-control { + color: black; + min-height: 38px; +} + +.container .content { + padding-bottom: 0px; +} + +/* 파일 관련 CSS */ +.portfolio .portfolio-wrap .portfolio-info { + overflow-wrap: anywhere; +} + +.portfolio .portfolio-wrap .portfolio-info h4 { + font-size: 18px!important; + color: #45505b; + font-weight: 600; +} + +@media (min-width: 1px) { + .portfolio .portfolio-wrap .portfolio-info h4 { + font-size: 16px!important; + } +} + +@media (min-width: 576px) { + .portfolio .portfolio-wrap .portfolio-info h4 { + font-size: 14px!important; + } +} + +@media (min-width: 768px) { + .portfolio .portfolio-wrap .portfolio-info h4 { + font-size: 16px!important; + } +} + +@media (min-width: 992px) { + .portfolio .portfolio-wrap .portfolio-info h4 { + font-size: 16px!important; + } +} +.slimScrollDiv{ + height:712px !important; +} +#req_tree{ + height:712px !important; +} + + +/* QnA 게시판 관련 CSS */ +.chat-btn { + margin-right: 10px; + display: inline-block; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + text-shadow: none; + font-weight: normal; + font-size: 11.05px; + background-color: #56bc76; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border: none; + border-color: rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25); + padding: 2px 6px; + line-height: 1.5; + border-radius: 0; +} + +.edit-chat-btn { + background-color: #56bc76; + transition: background-color 0.2s; +} + +.delete-chat-btn { + background-color: #e5603b; +} + +.send-btn { + width: 100%; + display: inline-block; + font-weight: 400; + line-height: 1.5; + color: #212529; + text-align: center; + text-decoration: none; + vertical-align: middle; + cursor: pointer; + /* -webkit-user-select: none; */ + -moz-user-select: none; + /* user-select: none; */ + /* background-color: transparent; */ + border: 1px solid transparent; + padding: 0.375rem 0.75rem; + font-size: 1rem; + border-radius: 0.25rem; + transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out; +} + +.send-chat-btn { + display: block; + width: 100%; + padding: 0.375rem 0.75rem; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #fff; + background: rgba(51,51,51,0.4); + background-clip: padding-box; + border: 1px solid #ced4da; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border-radius: 0.25rem; + transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out; + + cursor: pointer; + +} + +.user-id { + color: #3264bf; + font-weight: bolder; + text-decoration: none; +} + +.pull-right { + float: right !important; +} + +.pull-left { + float: left !important; +} + +.pull-right { + float: right; +} + +.pull-left { + float: left; +} + +.fa.pull-left { + margin-right: .3em; +} +.fa.pull-right { + margin-left: .3em; +} +.box .icon, .box .big-text { + margin-top: 15px; + font-size: 36px; + line-height: 36px; + height: 36px; + font-weight: bold; +} + +/***********************************/ +/** WIDGET **/ +/**********************************/ +.widget { + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + -ms-border-radius: 1px; + -o-border-radius: 1px; + border-radius: 1px; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + padding: 10px 12px; + color: #666; + /*background: rgba(51, 51, 51, 0.4);*/ + border: 1px solid #ced4da; + border-radius: 0.25rem; + margin-bottom: 30px; + position: relative; +} + +.widget.large { + /*height: 600px;*/ + width: 90%; + margin: 2%; +} + +.widget .body { + margin-top: 10px; +} +.widget > footer { + position: absolute; + bottom: 0; + left: 0; + right: 0; + margin: 15px 0 0; +} + +/***********************************/ +/** CHAT **/ +/**********************************/ +.chat-messages { + /*padding-right: 15px;*/ +} + +.chat-footer { + width: 100%; + /* bottom: 25px; */ + /* position: absolute; */ + /*height: 40px;*/ + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding-top: 10px; + margin-bottom: 10px; +} +.chat-footer input { + margin-bottom: 0; +} + +.chat-message:before, .chat-message:after { + content: " "; + display: table; +} +.chat-message:after { + clear: both; +} +.chat-message .icon { + position: relative; + z-index: 1; + text-align: center; + width: 53px; + height: 53px; + line-height: 53px; + vertical-align: middle; + -webkit-border-radius: 53px; + -moz-border-radius: 53px; + -ms-border-radius: 53px; + -o-border-radius: 53px; + border-radius: 53px; +} +.chat-message .icon img { + position: relative; + top: -2px; + width: 50px; + height: 50px; +} +.chat-message .time { + font-size: 11.05px; + line-height: 1.5em; + text-align: center; + color: #d2d2d2; +} + +.sender .write-time { + font-size: 11.05px; + line-height: 1.5em; + text-align: center; + color: #595151; +} + +.chat-message + .chat-message { + margin-top: 10px; +} + +.chat-message-body { + margin-left: 63px; + padding: 8px 10px; + background: #dedede; + position: relative; + border-left: 3px solid #666; + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + -ms-border-radius: 1px; + -o-border-radius: 1px; + border-radius: 1px; +} +.chat-message-body.on-left { + margin-left: 0; + margin-right: 63px; + border-left: none; + border-right: 3px solid #666; + background: #e9ecef; +} +.chat-message-body.on-left .arrow { + left: auto; + right: -7px; + border-right: none; + border-left: 5px solid #666; +} +.chat-message-body.on-left .sender, .chat-message-body.on-left .text { + text-align: right; +} +.chat-message-body .arrow { + display: block; + position: absolute; + top: 21px; + left: -7px; + width: 0; + height: 0; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #666; +} + +.col-xs-9 { + width: 75%; +} + +.col-xs-3 { + width: 25%; +} + +@font-face { + font-family: 'FontAwesome'; + src: url("../../../../../reference/light-blue/css/fonts/font-awesome/fontawesome-webfont.eot?v=4.0.3"); + src: url("../../../../../reference/light-blue/css/fonts/font-awesome/fontawesome-webfont.eot?#iefix&v=4.0.3") format("embedded-opentype"), url("../../../../../reference/light-blue/css/fonts/font-awesome/fontawesome-webfont.woff?v=4.0.3") format("woff"), url("../../../../../reference/light-blue/css/fonts/font-awesome/fontawesome-webfont.ttf?v=4.0.3") format("truetype"), url("../../../../../reference/light-blue/css/fonts/font-awesome/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular") format("svg"); + font-weight: normal; + font-style: normal; +} + +.fa { + display: inline-block; + font-family: FontAwesome; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.fa-angle-double-left:before { + content: "\f100"; +} + +.fa-angle-double-right:before { + content: "\f101"; +} + +.fa-angle-double-up:before { + content: "\f102"; +} + +.fa-angle-double-down:before { + content: "\f103"; +} + +.fa-angle-left:before { + content: "\f104"; +} + +.fa-angle-right:before { + content: "\f105"; +} + +.fa-angle-up:before { + content: "\f106"; +} + +.fa-angle-down:before { + content: "\f107"; +} +.pagination-container { + text-align: center; +} + +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; +} + +.page-item { + display: inline; /* instead of inline-block */ +} + +.page-item > a { + position: relative; + float: left; + + /* 동그란 모양을 만들기 위한 스타일 */ + border-radius: 50%; + width: 30px; /* 원하는 크기로 조정하세요 */ + height: 30px; /* 원하는 크기로 조정하세요 */ + line-height :30px; /* height와 같게 설정하세요 */ + + text-align:center; + + color:#808080; /* 폰트 색상 변경 */ + + background-color:#fff; + + border:none; + text-decoration:none; + cursor: pointer; + /*transition : background-color .3s, color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;*/ + + margin-right :10px ;/* 페이지 아이템 간의 간격 설정*/ + /*box-shadow :0px 0px 5px #808080;!* 그림자 효과 추가 *!*/ +} + +.page-item:nth-child(1) > a, +.page-item:nth-child(2) > a, +.page-item:nth-last-child(2) > a, +.page-item:last-child > a { + border-radius :50%; + width :30px ; height :30px ; + line-height :30px ; +} + +.page-item.active > a, +.page-link:focus, +.page-link:hover { + /*font-weight: bold;*/ + color:#fff !important;/* 활성화 또는 호버 상태에서의 텍스트 색상 변경 */ + background-color: #0563bb!important;/* 배경색 변경 */ +} + +.page-item > a:hover { + /*font-weight: bold;*/ + color:#fff !important;/* 활성화 또는 호버 상태에서의 텍스트 색상 변경 */ + background-color: #0563bb!important;/* 배경색 변경 */ +} + +@media (max-width: 600px) { + .page-item > a { + width: 20px; + height: 20px; + line-height: 20px; + font-size: 12px; + } + + .page-item:nth-child(1) > a, + .page-item:nth-child(2) > a, + .page-item:nth-last-child(2) > a, + .page-item:last-child > a { + border-radius :50%; + width :20px ; height :20px ; + line-height :20px ; + } +} \ No newline at end of file FishEye: Tag c16445099412b1817c9f92dd1e856c0512875f53 refers to a dead (removed) revision in file `arms/html/armsDetailExceptTemplate/assets/css/qna.css'. FishEye: No comparison available. Pass `N' to diff? Index: arms/js/detail.js =================================================================== diff -u -r142737cc260f74b32193429fafc0341b7ca2e92d -rc16445099412b1817c9f92dd1e856c0512875f53 --- arms/js/detail.js (.../detail.js) (revision 142737cc260f74b32193429fafc0341b7ca2e92d) +++ arms/js/detail.js (.../detail.js) (revision c16445099412b1817c9f92dd1e856c0512875f53) @@ -115,10 +115,10 @@ // QnA 채팅 게시판 탭 클릭 이벤트 reqCommentListViewTabClick(); - // save_post_btn_click(); + req_comment_save_btn_click(); + req_comment_message_size_change(); - }) .catch(function (errorMessage) { console.error(errorMessage); @@ -212,7 +212,7 @@ fileLoadByPdService(); } else if (element === "#question") { - getReqCommentList(); + getReqCommentList(1); } visibilityStatus[element] = true; @@ -788,15 +788,34 @@ // ------------------ QnA 게시판보기 ------------------ // function reqCommentListViewTabClick() { $("#get_req_comment_list").click(function () { - getReqCommentList(); + getReqCommentList(1); }); } -function getReqCommentList() { +function getReqCommentList(pageNum) { console.log("ReqList Tab ::::"); - if (callAPI("reqCommentListAPI")) { - return; + + var pageSize = 10; + var totalPages = 0; + var curPage = pageNum; + + /* 전체 게시판 게시물 갯수 가져오는 API 호출 필요 */ + var totalCount = 21; + + if (totalCount !== 0) { + totalPages = Math.ceil(totalCount / pageSize); + console.log("totalPages : " + totalPages); + + $(".pagination").empty(); + var htmlStr = bindPagination(curPage, totalPages, "getReqCommentList"); + console.log("htmlStr : " + htmlStr); + + $(".pagination").append(htmlStr); } + else{ + //alert("검색되는 주소없음") + } + var urlParams = new URL(location.href).searchParams; var selectedPdService = urlParams.get('pdService'); var selectedPdServiceVersion = urlParams.get('pdServiceVersion'); @@ -816,12 +835,25 @@ 200: function (data) { //모달 팝업 끝내고 var $chatMessages = $('#chat_messages'); + $chatMessages.empty(); - console.log(data.response); + console.log(data.response) + + if (data.response.length === 0) { + var reqCommentList = $('#chat_messages').html(); + + if($.trim(reqCommentList) === '') { + /* 게시글이 없을 경우 처리 필요 */ + console.log('No content'); + } else { + console.log('Content exists'); + } + } + for (var k in data.response) { var comment = data.response[k]; - console.log(comment); + var c_id = comment.c_id; var sender = comment.c_req_comment_sender; var date = comment.c_req_comment_date; var title = comment.c_title; @@ -836,8 +868,8 @@ if (sender === userName) { buttonsHtml = `
- - + +
`; } @@ -864,7 +896,16 @@ $chatMessages.append($newHtml); } - calledAPIs["reqCommentListAPI"] = true; + $('.edit-chat-btn').on('click', function(e){ + var c_id = $(this).val(); + req_comment_edit_btn_click(c_id); + }); + + $('.delete-chat-btn').on('click', function(e){ + var c_id = $(this).val(); + req_comment_delete_btn_click(c_id); + }); + } }, beforeSend: function () { @@ -877,18 +918,75 @@ }); } -function save_post_btn_click() { - $("#save_req_comment_btn").click(function () { +function bindPagination(curPage, totalPages, funName) { + var pageUrl = ""; + var pageLimit = 5; + var startPage = parseInt((curPage - 1) / pageLimit) * pageLimit + 1; + + var endPage = startPage + pageLimit - 1; + + if (totalPages < endPage) { + endPage = totalPages; + } + + + var nextPage = endPage + 1; + console.log(curPage,"curPage,",startPage,"startPage,",endPage,"endPage,",nextPage,"nextPage") + + //맨 첫 페이지 + if (curPage > 1 && pageLimit < curPage) { + pageUrl += "
  • "; + } + //이전 페이지 + if (curPage > pageLimit) { + pageUrl += "
  • "; + } + //~pageLimit 맞게 페이지 수 보여줌 + for (var i = startPage; i <= endPage; i++) { + //현재페이지면 진하게 표시 + if (i === curPage) { + pageUrl += "
  • " + i + ""; + } else { + pageUrl += "
  • " + i + "
  • "; + } + } + //다음 페이지 + if (nextPage <= totalPages) { + pageUrl += "
  • "; + } + //맨 마지막 페이지 + if (curPage < totalPages && nextPage < totalPages) { + pageUrl += "
  • "; + } + + console.log(pageUrl); + + return pageUrl; +} + +function req_comment_save_btn_click() { + addReqComment(); +} + +function addReqComment() { + $('.send-chat-btn').on('click', function(e){ + var content = $('#comment-contents').val(); + if (content === null || content === '') { + alert("질문을 작성 후 등록해주세요."); + return; + } + + console.log(content); var urlParams = new URL(location.href).searchParams; var selectedPdService = urlParams.get('pdService'); var selectedPdServiceVersion = urlParams.get('pdServiceVersion'); selectedJsTreeId = urlParams.get('reqAdd'); const cTitle = ""; - $.ajax({ - url: "/auth-user/api/arms/reqComment/addReqCommentNode.do", + /*$.ajax({ + url: "/auth-user/api/arms/reqComment/addNode.do", type: "POST", data: { ref: 2, @@ -913,6 +1011,88 @@ error: function (e) { jError("신규 게시물 등록 중 에러가 발생했습니다."); } - }); + });*/ }); -} \ No newline at end of file +} + +function req_comment_edit_btn_click(c_id) { + var urlParams = new URL(location.href).searchParams; + var selectedPdService = urlParams.get('pdService'); + var selectedPdServiceVersion = urlParams.get('pdServiceVersion'); + selectedJsTreeId = urlParams.get('reqAdd'); + console.log("edit : " + c_id); + const cTitle = ""; + /*$.ajax({ + url: "/auth-user/api/arms/reqComment/addNode.do", + type: "POST", + data: { + ref: 2, + c_pdservice_link: selectedPdService, + c_version_link: selectedPdServiceVersion, + c_req_link: selectedJsTreeId, + c_type: "default", + c_title: cTitle + }, + statusCode: { + 200: function () { + //모달 팝업 끝내고 + alert("success"); + $("#close_pdservice").trigger("click"); + //데이터 테이블 데이터 재 로드 + } + }, + beforeSend: function () { + }, + complete: function () { + }, + error: function (e) { + jError("신규 게시물 등록 중 에러가 발생했습니다."); + } + });*/ +} + +function req_comment_delete_btn_click(c_id) { + if (confirm("해당글을 삭제하시겠습니까?")) { + + var urlParams = new URL(location.href).searchParams; + var selectedPdService = urlParams.get('pdService'); + var selectedPdServiceVersion = urlParams.get('pdServiceVersion'); + selectedJsTreeId = urlParams.get('reqAdd'); + + const cTitle = ""; + console.log("delete : " + c_id); + /*$.ajax({ + url: "/auth-user/api/arms/reqComment/addNode.do", + type: "POST", + data: { + ref: 2, + c_pdservice_link: selectedPdService, + c_version_link: selectedPdServiceVersion, + c_req_link: selectedJsTreeId, + c_type: "default", + c_title: cTitle + }, + statusCode: { + 200: function () { + //모달 팝업 끝내고 + alert("success"); + $("#close_pdservice").trigger("click"); + //데이터 테이블 데이터 재 로드 + } + }, + beforeSend: function () { + }, + complete: function () { + }, + error: function (e) { + jError("신규 게시물 등록 중 에러가 발생했습니다."); + } + });*/ + } +} + +function req_comment_message_size_change() { + $('#comment-contents').on('input propertychange', function() { + $('.chat-footer').height($(this).height()); + }); +}