Browse Source

[진료관리 - 대시보드] 메모 및 증상 아이콘 클릭시 상세 진입시 해당 섹션으로 이동하도록 처리 추가.

sjpark 4 năm trước cách đây
mục cha
commit
229737ee66

+ 8 - 1
src/main/webapp/WEB-INF/jsp/clinic/info.jsp

@@ -775,7 +775,14 @@ $(document).ready(function() {
 	<c:forEach var="phr" items="${bloodSugarResult}" varStatus="status">
 	bloodSugarDatas.push({recordedDate: "${phr.recordedDate}", phrValue: "${phr.phrValue}"});
 	</c:forEach>
-	drawPhrChart("bloodSugarChart", bloodSugarDatas, "혈당");
+  drawPhrChart("bloodSugarChart", bloodSugarDatas, "혈당");
+  
+  // 초기 섹션 설정
+  var page_url = window.location.href; 
+  var page_id = page_url.substring(page_url.lastIndexOf("#") + 1);
+  if (page_id === "symptomSection" || page_id === "medicalMemoSection") {
+    $('html, body').animate({ scrollTop: $('#scroll-' + page_id).offset().top }, 500); 
+  }
 
   // 상단 환자 정보 영역 토글 이벤트
   $("#userInfo").find(".user-info").show();

+ 14 - 6
src/main/webapp/WEB-INF/jsp/clinic/state.jsp

@@ -155,10 +155,10 @@ function retrieveStateData(page, needInitPagination) {
 								html += '			<div class="check">';
 								html += '				<ul>';
 								if (d.memoCount > 0) {
-								html += '					<li><a href="javscript:;" class="memo"><i class="align-middle ml-2 fas fa-fw fa-edit"></i></a></li>';
+								html += '					<li><a href="#" id="memoLink" class="memo"><i id="memoLinkIcon" class="align-middle ml-2 fas fa-fw fa-edit"></i></a></li>';
 								}
 								if (d.hasTodaySymptom) {
-								html += '					<li><a href="javscript:;" class="symptom"><i class="align-middle ml-2 fas fa-fw fa-user-plus"></i></a></li>';
+								html += '					<li><a href="#" id="symptomLink" class="symptom"><i id="symptomLinkIcon" class="align-middle ml-2 fas fa-fw fa-user-plus"></i></a></li>';
 								}
 								html += '				</ul>';
 								html += '			</div>';
@@ -307,14 +307,22 @@ $(document).ready(function() {
 	// 	$('#reloadIntervalSelect').prop('disabled',false);
 	// }
 
-	$(document).on("click", ".patients-stats", function() {
+	$(document).on("click", ".patients-stats", function(event) {
+    // alert(event.target.id);
+    
 		var searchText = '<c:out value="${searchText}" />';
 		var currentPage = $("#pagination .active").children("a").text();
 		var url = $(this).attr("data-url");
 		if (searchText !== "") {
 			url += "&refererSearch="+encodeURIComponent(searchText);
 		}
-		url += "&refererPage="+currentPage;
+    url += "&refererPage="+currentPage;
+    if (event.target.id === "memoLink" || event.target.id === "memoLinkIcon") {
+      url += "#medicalMemoSection"
+    }
+    if (event.target.id === "symptomLink" || event.target.id === "symptomLinkIcon") {
+      url += "#symptomSection"
+    }
 		location.href = url;
 	});
 
@@ -485,10 +493,10 @@ $(document).ready(function() {
 														<div class="check">
 															<ul>
 																<c:if test="${patient.memoCount > 0}">
-																<li><a href="javscript:;" class="memo"><i class="align-middle ml-2 fas fa-fw fa-edit"></i></a></li>
+																<li><a href="#" id="memoLink" class="memo"><i id="memoLinkIcon" class="align-middle ml-2 fas fa-fw fa-edit"></i></a></li>
 																</c:if>
 																<c:if test="${patient.hasTodaySymptom}">
-																<li><a href="javscript:;" class="symptom"> <i class="align-middle ml-2 fas fa-fw fa-user-plus"></i></a></li>
+																<li><a href="#" id="symptomLink" class="symptom"> <i id="symptomLinkIcon" class="align-middle ml-2 fas fa-fw fa-user-plus"></i></a></li>
 																</c:if>
 															</ul>
 														</div>