@@ -667,6 +667,10 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
+
+
+
+
@@ -725,6 +729,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
var jwt = null;
var loadingTip = '';
var pageAct = {}; //記錄全頁面已選擇項目
+ var timeOuters = [];
pageAct.AreaTag = "";
if (location.href.indexOf("ord") != -1) {
location.href = "/file/index.html"
@@ -781,6 +786,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
"lib/chart.js/Chart.min",
"lib/dropzone/dropzone-min",
"lib/jstree-master/jstree.min",
+ "lib/notifications/sweetalert2/sweetalert2.bundle",
], loadedMasterPack);
}
@@ -830,14 +836,14 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
* 登入驗證完成 Callback
* */
function isValidLogin() {
-
+
getUserInfo();
iniFroList();
showMainSys();
getBuiList();
getSysMonBtnList();
checkDevState();
-
+
if (lastPage) {
let lastPageAct = {};
if (isJSON(sessionStorage.getItem("pageAct"))) {
@@ -849,12 +855,13 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
} else {
$(`[data-tabname=topFunBtn][data-page=${lastPage}]`).YTTab("setAndClick");
}
-
+
/*$(`[name=topFunBtn][data-page=${lastPage}]`).click();*/
} else {
$("#app").load("_dashboard.html", loadCallback);
}
+ timeOutGetData();
function getBuiList() {
let url = baseApiUrl + "/api/Device/GetBuild";
@@ -918,7 +925,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
if (!page) {
return;
}
- if (page != "systemMonitor") {
+ if (page != "systemMonitor" && page != "sysElevator") {
$("#sysMonBtnList .dropdown-item").removeClass("active");
pageAct.sysMainTag = null;
pageAct.sysSubTag = null;
@@ -935,15 +942,10 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
endPageLoading();
$(".yt-alert").YTAlert().hide();
- if (typeof timeOuters != "undefined") {
- $.each(timeOuters, (idx, timeOut) => {
- clearInterval(timeOut);
- })
- timeOuters = [];
- }
+
getUserInfo();
-
+
sessionStorage.setItem("lastPage", page);
sessionStorage.setItem("pageAct", JSON.stringify(pageAct));
$("#app").load(`_${page}.html`, loadCallback);
@@ -955,14 +957,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
location.href = "/logout";
})
- onEvent("click", "#sysMonBtnList a", function (e) {
- //pageAct.sysMainTag = $(this).data("subSysObj").main_system_tag;
- //pageAct.sysSubTag = $(this).data("subSysObj").sub_system_tag;
- //pageAct.sysSubName = $(this).data("subSysObj").full_name;
- //pageAct.sysSubObj = $(this).data("subSysObj");
- //getDevItem();
- })
-
+
onEvent("active:change", "#buiList", function (e, actEle) {
if (actEle) {
pageAct.buiTag = $(actEle).prop("id").split("buiBtn")[1];
@@ -984,11 +979,20 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
}
})
+ onEvent("scroll", window, function () {
+ if ($(window).scrollTop() != 0) {
+ $("#noticeBlock").css("top", 0);
+ } else {
+ $("#noticeBlock").css("top", 70);
+ }
+ })
+
onEvent("click", "#testsysbtn", function () {
})
-
+ let fronIdx = 1;
$(window).on("timeout:3s", function () {
+
getSystemAlarmByBaja((data) => {
if (typeof getAlarmSub != "undefined" && getAlarmSub) {
getAlarmSub(data);
@@ -996,6 +1000,28 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
alarmIconBlink();
})
+ let content = `
+
+ 異常編號:001
+
+
+ 異常等級:2
+
+
+ 異常類別:S01
+
+
+ 設備名稱:電表01
+
+
+ 異常訊息:壞掉
+
+
+
`
+ let titleHtml = `異常通知`
+
+ $("#noticeBlock").YTNotice("add", titleHtml + fronIdx, content,"warning");
+ fronIdx++;
})
}
@@ -1022,7 +1048,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
dataType: 'json',
success: function (rel) {
if (rel.code != "0000") {
- toast_error(rel.msg || "系統內部發生錯誤,請聯絡系統管理員");
+ toast_error(rel.msg || common.SysErr);
return;
}
else {
@@ -1032,7 +1058,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
}
},
error: function (xhr, textStatus, thrownError) {
- alert(textStatus);
+ alert(common.SysErr);
}
});
@@ -1078,7 +1104,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
function drawErrRecTabBlo() {
let strHtml = `
-
`
+ `
return strHtml;
}
@@ -1086,7 +1112,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
function drawOpeRecTabBlo() {
let strHtml = `
-
`
+ `
return strHtml;
}
@@ -1103,54 +1129,62 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
let lightHtml = type == "light" ? `` : "";
let option = {
html: `
+
-
+
+
+
+
+
+ ${lightHtml}
+
+
+
+
+
+
+
+
+ ${drawStateTabBlo(devNum)}
+
+
-
-
-
-
-
- ${lightHtml}
-
-
-
-
-
-
-
-
- ${drawStateTabBlo(devNum)}
-
-
-
-
-
- ${drawErrRecTabBlo()}
-
-
- ${drawOpeRecTabBlo()}
-
-
-
`,
+
+
+ ${drawErrRecTabBlo()}
+
+
+ ${drawOpeRecTabBlo()}
+
+
+ `,
group: "device",
onShow: function (tooltipEle, oriEle) {
- var tab = new YT.Tab({ tabName: "cardTab" })
+ // 執行 pop 視窗上方 Tab 類別
+ new YT.Tab({ tabName: "cardTab" })
+ let devObj = $(oriEle).data("devobj");
+ // 讀取運維列表
loadOpeRecTable(devGuid);
-
+ // 讀取異常列表
loadErr($(oriEle).data("number"));
+ // 讀取設備基本資料列表
$(tooltipEle).find("#info").html(typeof drawInfoTabBlo != "undefined" ? drawInfoTabBlo(devGuid) : "");
+ // 聚焦熱點
if ($(oriEle).data("dbId")) {
controlFocusHotspot($(oriEle).data("dbId"));
}
+ // 3D 視角 ZOOM IN 聚焦
+ moveViewToDevice(devObj?.forge_dbid);
+ // pop 視窗卡片可拖移功能初始化
$(tooltipEle).draggable({
cursor: "move",
handle: ".card-header", // 只能通过卡片的标题栏拖拽
containment: "document",
scroll: true
});
+ // pop 視窗卡片可縮放功能初始化
$(tooltipEle).resizable({
- resize: function (event,ui) {
+ resize: function (event, ui) {
let iframe = $(ui.element).find("iframe");
if (iframe.length != 0) {
if (ui.size.width != ui.originalSize.width) {
@@ -1161,15 +1195,17 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
}
let cardBodyHeight = $(ui.element).find(".card-body").css("height");
$(ui.element).find(".scrolledTable").css("height", cardBodyHeight)
-
+
errRecTable.draw(false)
},
minWidth: 200,
- minHeight:150,
+ minHeight: 150,
});
+ // 電梯管理 - Card table 更新
typeof subDeviceSetTable != "undefined" ? subDeviceSetTable($(oriEle).data("number")) : ""
},
onHide: function (tooltipEle, oriEle) {
+ // 3D 熱點解除
controlFocusHotspot($(oriEle).data("dbId"), false);
// sysMonFloor Echart 解除 focus
typeof chartUnFocus != "undefined" ? chartUnFocus(oriEle) : "";
@@ -1182,6 +1218,15 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
})
}
+ // 卡片設備名稱點擊事件
+ function devItemNameEvent() {
+ onEvent("click", "[name=devItemName]", function () {
+ let devNum = $(this).data("number");
+ let devObj = $(`[name=devItem][data-number=${devNum}]`).data("devobj");
+ moveViewToDevice(devObj.forge_dbid);
+ })
+ }
+
// Card - 運維紀錄 Table
function loadOpeRecTable(devGuid) {
if (opeRecTable) {
@@ -1390,6 +1435,12 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
return parentEle;
}
+ // 設置 Forge 3D 溫度條
+ function setTopHeatBar() {
+ let strHtml = ``;
+ return strHtml;
+ }
+
//==============================================================================
// ↑ 系統監控 - 共用 Function ↑
//==============================================================================
@@ -1408,7 +1459,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
function getDevItem() {
let url = baseApiUrl + "/api/Device/GetDeviceItem";
-
+
objSendData.Data = {
main_system_tag: pageAct.sysMainTag,
sub_system_tag: pageAct.sysSubTag,
@@ -1433,6 +1484,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
function timeOutGetData() {
let timeOut3s = null, timeOut5m = null;
let events = $._data($(window)[0], "events");
+
if (Object.keys(events).findIndex(x => x == "timeout:3s") != -1) {
timeOut3s = setInterval(() => {
$(window).trigger("timeout:3s");
@@ -1483,35 +1535,35 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
} else {
let strHtml = `