Procházet zdrojové kódy

[phr] 상태현황 페이징 오류 수정.

sjpark před 4 roky
rodič
revize
0620713f99
1 změnil soubory, kde provedl 15 přidání a 13 odebrání
  1. 15 13
      src/main/webapp/WEB-INF/jsp/clinic/state.jsp

+ 15 - 13
src/main/webapp/WEB-INF/jsp/clinic/state.jsp

@@ -9,7 +9,7 @@
 
 var totalList = ${total}; // 저장된 데이터 항목 수
 var viewEntry = 30;		// 한 화면에 표시되는 갯수 
-var totalPage = totalList / viewEntry;
+var totalPage = Math.ceil(totalList / viewEntry);
 var reloadIntervalTime = 30;	// 
 var reloadTimer = null;
 
@@ -74,10 +74,9 @@ function retrieveStateData(page) {
 				html = "";
 				datas.forEach(d => {
 					var danger = d.temperature > 37 ? "danger" : "";
-					var temperature_step_two = d.temperature > 37 ? "step_two" : "";
-					var temperature_step_one = "";
-					var systolicBloodPressure_step_one = "";
-					var oxygenSaturation_step_one = "";
+					var temperature_step = d.temperature > 37 ? "step_two" : "step_one";
+					var systolicBloodPressure_step = d.systolicBloodPressure > 37 ? "step_two" : "step_one";
+					var oxygenSaturation_step = d.oxygenSaturation > 37 ? "step_two" : "step_one";
 					
 					var temperature = (d.temperature || "--") + '℃';
 					var bloodPressure = (d.systolicBloodPressure || "--") + " / " + (d.diastolicBloodPressure || "--");
@@ -88,15 +87,15 @@ function retrieveStateData(page) {
 					html += '			<a href="">'+d.roomNumber+'('+d.patientName+')</a>';
 					html += '			<div class="check">';
 					html += '				<ul><li>';
-					html += '					<a href="javscript:;" class="symptom"><i class="align-middle mr-2 fas fa-fw fa-user-plus"></i></a>';
+					html += '					<a href="javscript:;" class="symptom"><i class="align-middle ml-2 fas fa-fw fa-user-plus"></i></a>';
 					html += '				</li></ul>';
 					html += '			</div>';
 					html += '		</div>';
 					html += '      <div class="stats '+danger+'">';
 					html += '			<ul>';
-					html += '				<li class="fever '+temperature_step_one+' '+temperature_step_two+'">'+temperature+'</li>';
-					html += '				<li class="bloodPressure '+systolicBloodPressure_step_one+'">'+bloodPressure+'</li>';
-					html += '				<li class="oxygen '+oxygenSaturation_step_one+'">'+oxygenSaturation+'</li>';
+					html += '				<li class="fever '+temperature_step+' timeover">'+temperature+'</li>';
+					html += '				<li class="bloodPressure '+systolicBloodPressure_step+'">'+bloodPressure+'</li>';
+					html += '				<li class="oxygen '+oxygenSaturation_step+'">'+oxygenSaturation+'</li>';
 					html += '			</ul>';
 					html += '		</div>';
 					html += '	</div>';
@@ -118,6 +117,7 @@ function retrieveStateData(page) {
 
 function nextPage() {
 
+	console.log("totalPage=" + totalPage);
 	if (totalPage === 1) {
 		retrieveStateData(1);
 		return;
@@ -159,6 +159,8 @@ function responsiblePagination() {
 
 $(document).ready(function() {
 
+	retrieveStateData(1);
+
 	// 반복 start/stop 클릭
 	$('#playButton').click(function () {
 		if (activeReloadTimer()) {	
@@ -254,14 +256,14 @@ $(document).ready(function() {
 												<button type="button" id="pauseButton" class="btn btn-primary disabled">
 													<i class="fas fa-pause"></i>
 												</button>
-											</label> <input type="text" class="form-control w150" id="searchKeyword" placeholder="호실 or 환자명" onkeypress="searchPatients()">
+											</label> <input type="text" class="form-control w150" id="searchKeyword" placeholder="호실 or 환자명" onkeyup="if(event.keyCode===13){searchPatients()}">
 											<button class="btn btn-primary" onclick="searchPatients()">검색</button>
 										</div>
 									</div>
 								</div>
 								<div class="card-body">
 									<div class="row patients-list">
-										<jsp:useBean id="now" class="java.util.Date" />
+										<%-- <jsp:useBean id="now" class="java.util.Date" />
 										<fmt:formatDate value="${now}" pattern="yyyyMMdd" var="nowDateString" />
 										<c:forEach var="patient" items="${items}" varStatus="status">
 											<c:set var="viewLink" value="./info?patientIdx=${patient.patientIdx}" />
@@ -271,7 +273,7 @@ $(document).ready(function() {
 														<a href="${viewLink}"><c:out value="${patient.roomNumber}(${patient.patientName})" /></a>
 														<div class="check">
 															<ul>
-																<li><a href="javscript:;" class="symptom"> <i class="align-middle mr-2 fas fa-fw fa-user-plus"></i>
+																<li><a href="javscript:;" class="symptom"> <i class="align-middle ml-2 fas fa-fw fa-user-plus"></i>
 																</a></li>
 															</ul>
 														</div>
@@ -289,7 +291,7 @@ $(document).ready(function() {
 													</div>
 												</div>
 											</div>
-										</c:forEach>
+										</c:forEach> --%>
 									</div>
 								</div>
 								<div class="card-footer">