更新系統監控頁面,根據子系統狀態動態調整按鈕頁面名稱,並修正通知顯示邏輯
This commit is contained in:
parent
27a22bca16
commit
2a1b35b2ed
@ -361,10 +361,11 @@
|
||||
x.mainSys == mainSysObj.main_system_tag &&
|
||||
x.subSys == subSysObj.sub_system_tag
|
||||
)[0]?.iconClass;
|
||||
const dataPageName = subSysObj.blank ? "dashboard" : "systemMonitor";
|
||||
strHtml += `<div class="btn-group col-lg-6 mb-4 dev-group" data-id="/${pageAct.AreaTag
|
||||
}/${pageAct.buiTag}/${mainSysObj.main_system_tag}/${subSysObj.sub_system_tag
|
||||
}">
|
||||
<button name="topFunBtn" data-page="systemMonitor" type="button" class="btn btn-secondary col-4 px-2 h-100" data-subSysobj=${JSON.stringify(
|
||||
<button name="topFunBtn" data-page="${dataPageName}" type="button" class="btn btn-secondary col-4 px-2 h-100" data-subSysobj=${JSON.stringify(
|
||||
{
|
||||
...subSysObj,
|
||||
main_system_tag: mainSysObj.main_system_tag,
|
||||
@ -372,7 +373,7 @@
|
||||
)}>
|
||||
<img src="${iconClass}" class="w-100 "></img>
|
||||
</button>
|
||||
<button name="topFunBtn" data-page="systemMonitor" id="sysSubCardBtn${subSysObj.sub_system_tag
|
||||
<button name="topFunBtn" data-page="${dataPageName}" id="sysSubCardBtn${subSysObj.sub_system_tag
|
||||
}" type="button" class="btn btn-secondary px-2 h4 h-100" data-id="${subSysObj.sub_system_tag
|
||||
}" data-subSysObj=${JSON.stringify({
|
||||
...subSysObj,
|
||||
@ -1316,6 +1317,10 @@
|
||||
|
||||
onEvent("click", "button[id^=sysSubCardBtn]", function () {
|
||||
let subSysTag = $(this).data("id");
|
||||
const subSysObj = $(this).data("subsysobj");
|
||||
if (subSysObj && subSysObj.blank) {
|
||||
window.open(subSysObj.blank, "_blank");
|
||||
}
|
||||
$(
|
||||
`#subSysBtn${subSysTag}[data-building-tag='${buildingTagOnJquery(
|
||||
pageAct.buiTag
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
<div class="container-fluid px-0">
|
||||
<div class="row no-gutters" style="height: calc(100vh - 72px)">
|
||||
<div class="col-1">
|
||||
<!-- <div class="col-1">
|
||||
<aside id="sysMonNavbar" class="w-100 yt-navbar yt-left-navbar h-100 mt-0">
|
||||
<div class="yt-navbar-content">
|
||||
<ul id="sysMonBtnList"></ul>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
<div class="col-11">
|
||||
</div> -->
|
||||
<div class="col-12">
|
||||
<div class="container-fluid">
|
||||
<div class="row bg-dark align-items-center">
|
||||
<label id="sysSubText" class="mx-5 mb-0 fs-1-05"></label>
|
||||
|
||||
15
index.html
15
index.html
@ -899,6 +899,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
||||
{ mainSys: "S", subSys: "R", iconClass: "./gif/R_white.png" }, // 門禁
|
||||
{ mainSys: "P", subSys: "PSC", iconClass: "./gif/PSC_white.png" }, // 停管
|
||||
{ mainSys: "W3", subSys: "W1", iconClass: "./gif/W3_white.png" }, // 0131目前沒有
|
||||
{ mainSys: "ME", subSys: "M2", iconClass: "./gif/W2_white.png" },
|
||||
];
|
||||
|
||||
var tempSysSubText = [
|
||||
@ -1267,6 +1268,11 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
||||
(rel) => {
|
||||
console.log(rel);
|
||||
$(this).parents(".toast").YTNotice("hide");
|
||||
// 從 noticeOptArr 中移除已確認的通知
|
||||
const index = noticeOptArr.findIndex((x) => x.id == uuid);
|
||||
if (index !== -1) {
|
||||
noticeOptArr.splice(index, 1);
|
||||
}
|
||||
},
|
||||
"text"
|
||||
);
|
||||
@ -2387,10 +2393,11 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
||||
noticeObj.forEach((notice) => {
|
||||
let div2 = creDiv(["row", "m-0"]);
|
||||
let span1 = creSpan(notice.title + ":", ["m-0"]);
|
||||
let displayValue = data[notice.data];
|
||||
if (notice.data === "uuid") {
|
||||
data[notice.data] = data[notice.data].split("-")[0];
|
||||
displayValue = data[notice.data].split("-")[0];
|
||||
}
|
||||
span1.append(creSpan(data[notice.data]));
|
||||
span1.append(creSpan(displayValue));
|
||||
div2.append(span1);
|
||||
div1.append(div2);
|
||||
});
|
||||
@ -2409,8 +2416,10 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
||||
notices.push(main);
|
||||
}
|
||||
});
|
||||
|
||||
// 只添加新的通知,不清空已存在的通知
|
||||
if (notices.length > 0) {
|
||||
$("#noticeBlock").YTNotice("add_many", notices.oSort("id").reverse());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user