|
@@ -9,9 +9,29 @@
|
|
|
var totalList = ${total}; // 저장된 데이터 항목 수
|
|
|
var viewEntry = 30; // 한 화면에 표시되는 갯수
|
|
|
var totalPage = Math.ceil(totalList / viewEntry);
|
|
|
-var reloadIntervalTime = 30; //
|
|
|
var reloadTimer = null;
|
|
|
|
|
|
+function getReloadIntervalTime() {
|
|
|
+ // console.log("getReloadIntervalTime");
|
|
|
+ return localStorage.getItem('reloadIntervalTime') || "30";
|
|
|
+}
|
|
|
+
|
|
|
+function setReloadIntervalTime(value) {
|
|
|
+ // console.log("setReloadIntervalTime" + value);
|
|
|
+ localStorage.setItem('reloadIntervalTime', value);
|
|
|
+}
|
|
|
+
|
|
|
+// function getPlayOnOff() {
|
|
|
+// console.log("getPlayOnOff");
|
|
|
+// console.log(localStorage.getItem('isPlaying'));
|
|
|
+// return localStorage.getItem('isPlaying') || "off";
|
|
|
+// }
|
|
|
+
|
|
|
+// function setPlayOnOff(value) {
|
|
|
+// console.log("setPlayOnOff" + value);
|
|
|
+// localStorage.setItem('isPlaying', value);
|
|
|
+// }
|
|
|
+
|
|
|
function ajaxErrorHandler(request, status, error){
|
|
|
if (request.status === 0) {
|
|
|
alert('Not connect.\n Verify Network.');
|
|
@@ -49,25 +69,21 @@ function ajaxErrorHandler(request, status, error){
|
|
|
}
|
|
|
|
|
|
function changeReloadInterval() {
|
|
|
- reloadIntervalTime = $("#reloadIntervalSelect option:selected").val();
|
|
|
+ var value = $("#reloadIntervalSelect option:selected").val();
|
|
|
+
|
|
|
+ setReloadIntervalTime(value);
|
|
|
}
|
|
|
|
|
|
function activeReloadTimer() {
|
|
|
- if (reloadIntervalTime) {
|
|
|
- if (reloadTimer) {
|
|
|
- deactiveReloadTimer();
|
|
|
- }
|
|
|
-
|
|
|
- reloadTimer = setInterval(function() {
|
|
|
+ if (reloadTimer) {
|
|
|
+ deactiveReloadTimer();
|
|
|
+ }
|
|
|
+
|
|
|
+ reloadTimer = setInterval(function() {
|
|
|
nextPage();
|
|
|
- }, reloadIntervalTime * 1000);
|
|
|
+ }, getReloadIntervalTime() * 1000);
|
|
|
|
|
|
- return true;
|
|
|
- }
|
|
|
- else {
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
function deactiveReloadTimer() {
|
|
@@ -192,8 +208,31 @@ function responsiblePagination() {
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
+ $("#reloadIntervalSelect").val(getReloadIntervalTime());
|
|
|
+
|
|
|
+ // if (getPlayOnOff() === "on") {
|
|
|
+ // if (activeReloadTimer()) {
|
|
|
+ // $(".playPause").attr('id','pauseButton');
|
|
|
+ // $(".playPause").find('i').removeClass('fa-play').addClass('fa-pause');
|
|
|
+ // $('#reloadIntervalSelect').prop('disabled',true);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // deactiveReloadTimer();
|
|
|
+ // $(".playPause").attr('id','playButton');
|
|
|
+ // $(".playPause").find('i').removeClass('fa-pause').addClass('fa-play');
|
|
|
+ // $('#reloadIntervalSelect').prop('disabled',false);
|
|
|
+ // }
|
|
|
+
|
|
|
$(document).on("click", ".patients-stats", function() {
|
|
|
- location.href = $(this).attr("data-url");
|
|
|
+ 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;
|
|
|
+ location.href = url;
|
|
|
});
|
|
|
|
|
|
// 반복 start/stop 클릭
|
|
@@ -204,6 +243,8 @@ $(document).ready(function() {
|
|
|
$(this).attr('id','pauseButton');
|
|
|
$(this).find('i').removeClass('fa-play').addClass('fa-pause');
|
|
|
$('#reloadIntervalSelect').prop('disabled',true);
|
|
|
+
|
|
|
+ // setPlayOnOff("on");
|
|
|
}
|
|
|
}
|
|
|
else if(thisID == 'pauseButton'){
|
|
@@ -211,6 +252,8 @@ $(document).ready(function() {
|
|
|
$(this).attr('id','playButton');
|
|
|
$(this).find('i').removeClass('fa-pause').addClass('fa-play');
|
|
|
$('#reloadIntervalSelect').prop('disabled',false);
|
|
|
+
|
|
|
+ // setPlayOnOff("off");
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -226,7 +269,7 @@ $(document).ready(function() {
|
|
|
// href: 'URL',// template for pagination links (default javascript:void(0);)
|
|
|
// hrefVariable: false,// variable name in href template for page number (default {{number}})
|
|
|
total: totalPage, // 페이지 수
|
|
|
- page: 1, // 초기 페이지
|
|
|
+ page: ${page}, // 초기 페이지
|
|
|
leaps: true,
|
|
|
first: '<i class="mdi mdi-chevron-double-left"></i>',
|
|
|
prev: '<i class="mdi mdi-chevron-left"></i>',
|
|
@@ -340,7 +383,7 @@ $(document).ready(function() {
|
|
|
<i class="fas fa-play"></i>
|
|
|
</button>
|
|
|
</label> <input type="text" class="form-control w150" id="searchKeyword" placeholder="호실 or 환자명" value="${searchText}" onkeyup="if(event.keyCode===13){searchPatients()}">
|
|
|
- <button class="btn btn-primary" onclick="searchPatients()">검색</button>
|
|
|
+ <button id="searchKeywordBtn" class="btn btn-primary" onclick="searchPatients()">검색</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|