@@ -845,6 +860,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
getBuiList();
getSysMonBtnList();
checkDevState();
+ loadNoticeConSta();
if (lastPage) {
let lastPageAct = {};
@@ -970,7 +986,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
onEvent("yt:tab:change", "#lightSch-tab", function () {
if (pageAct.sysMainTag == "LT" && $("#lightSchModal").length != 0) {
- loadLightSchTable();
+ setLightSchBlcok ? setLightSchBlcok(this) : "";
$("#lightSchModal").modal("show");
}
})
@@ -996,6 +1012,22 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
onEvent("click", "button[id^=noticeChkBtn]", function () {
$(this).parents(".toast").YTNotice("hide");
})
+
+ onEvent("click", "button[id^=bajaAckBtn]", function () {
+ let uuid = $(this).data("uuid");
+ let url = window.location.origin + "/obix/alarm/" + uuid + "/ack";
+ let myBaja = new MyBaja();
+ myBaja.setMyUserAccount((data) => {
+ let sendData = '';
+ $.post(url, sendData, (rel) => {
+ $(this).parents(".toast").YTNotice("hide");
+ }, "text")
+ })
+ })
+
+ onEvent("click", "#toggleNoticeBtn", function () {
+ chaNoticeConSta();
+ })
$(window).on("timeout:3s", function () {
@@ -1115,7 +1147,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
let devName = $(ele).data("name"); //full_name
let lightHtml = type == "light" ? `` : "";
let option = {
- html: `
+ html: `
@@ -1644,7 +1676,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
異常訊息:${data.errMsg}
-
+
`
@@ -1662,11 +1694,55 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
})
if (notices.length != 0) {
$("#noticeBlock").YTNotice("add_many", notices.oSort("id").reverse());
+
}
- console.log("res", res)
+
}
}, null, "POST",true).send();
}
+
+ function loadNoticeConSta() {
+ let noticeStatus = localStorage.getItem("noticeStatus");
+ chaNoticeConSta(noticeStatus ?? "show");
+ }
+
+ function chaNoticeConSta(type = null) {
+ let showText = $("#toggleNoticeBtn #noticeConText").data("show");
+ let hideText = $("#toggleNoticeBtn #noticeConText").data("hide");
+ let iconArr = ["fal fa-comment-slash", "fal fa-comment-dots"];
+ $("#noticeConIcon").removeClass(iconArr[0]).removeClass(iconArr[1]);
+ if (type != null) {
+ if (type == "hide") {
+ setHide();
+ } else if (type == "show") {
+ setShow();
+ }
+ } else {
+ if ($("#noticeBlock").is(":visible")) {
+ setHide();
+ } else if (!$("#noticeBlock").is(":visible")) {
+ setShow();
+ }
+ }
+
+ function setShow() {
+ $("#toggleNoticeBtn").find("#noticeConText").text(hideText);
+ $("#noticeConIcon").addClass(iconArr[0]);
+ $("#noticeBlock").show();
+ $("#noticeBlock").animate({ opacity: 1 }, 200)
+ localStorage.setItem("noticeStatus", "show");
+ }
+
+ function setHide() {
+ $("#toggleNoticeBtn").find("#noticeConText").text(showText);
+ $("#noticeConIcon").addClass(iconArr[1]);
+ $("#noticeBlock").animate({ opacity: 0 }, 200, function () {
+ $("#noticeBlock").hide();
+ })
+ localStorage.setItem("noticeStatus", "hide");
+ }
+
+ }