[前台] 首頁 系統大類異常樣式修正 | 系統監控 樓層小卡片大小修正

This commit is contained in:
Celeste 2023-02-17 11:01:29 +08:00
parent 887fcef66a
commit aecb795124
5 changed files with 1828 additions and 965 deletions

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@
$(function () {
getBuildMenu((arr, data) => {
console.log(arr)
// console.log(arr)
buildMenuData = data;
if (arr.indexOf(4) != -1) {
getFloDevList(arr[0] == 4 ? "left" : "right");
@ -267,7 +267,7 @@
} else {
let strHtml = ``;
$.each(res.data, (index, floObj) => {
strHtml += `<div class='d-flex justify-content-start mb-5 ' style="">`
strHtml += `<div class='d-flex justify-content-start mb-5'>`
strHtml += `<button id="floItemBtn${floObj.full_name}" type="button" class="btn btn-primary waves-effect waves-themed mr-5 mt-1 align-self-start" >${floObj.full_name}</button>`
strHtml += `<div class="col p-0 d-grid grid-gap-5 grid-temp-col-c" style="--c-grid-temp-col:repeat(auto-fill,minmax(250px,1fr))">`
$.each(floObj.device_list, (index2, devObj) => {
@ -362,11 +362,12 @@
// Card 即時狀態
function drawStateTabBlo(devNum) {
let devPath = devNum.replaceAll("_", "/");
let position = $(`.card.device-wrap[data-number=${devNum}]`).data("position");
let position = $(`.card.device-wrap[data-number=${devNum}]`).data("position") || "left";
let width = buildMenuData[position + "_icon_click_url_width"] ? buildMenuData[position + "_icon_click_url_width"] + "px" : "100%";
let height = buildMenuData[position + "_icon_click_url_height"] ? buildMenuData[position + "_icon_click_url_height"] + "px" : "100%";
let strHtml = `<div style="height:100%;width:100%">
<iframe src="/ord?station:%7Cslot:/${devPath}|view:?fullScreen=true" style="width:${width};height:${height};min-height:100px;"></iframe>
let strHtml = `<div style="width:${width};height:${height};">
<iframe src="/ord?station:%7Cslot:/${devPath}|view:?fullScreen=true" style="width:${width};height:${height};"></iframe>
</div>`
return strHtml;
}
@ -538,12 +539,12 @@
}
function setHotspotPoint(myDataList = []) {
console.log(myDataList)
// console.log(myDataList)
getHopspotPoint(myDataList);
}
function setLightPoint(myDataList = []) {
console.log(myDataList)
// console.log(myDataList)
getLightData(myDataList);
}
@ -580,7 +581,6 @@
let name = allDevList.filter(x => x.device_guid == devObj.device_guid)[0]?.full_name;
devObj.full_name = name;
parentEle = crePosPopover(position, devObj);
$(parentEle).click();
})

View File

@ -1,6 +1,6 @@
<style>
[id^=yt_tooltip] {
width: 450px;
min-width: 520px;
}
</style>
@ -15,7 +15,7 @@
</div> -->
<div class="d-flex">
<div class="col-6 my-3">
<div id="floChart" style="height : 80vh!important;width:100%"></div>
<div id="floChart" style="height:80vh!important;width:100%"></div>
</div>
<div class="col-6 my-3">
<div id="forgeHeatBarDiv" class="d-flex mb-4" style="gap:15px">
@ -35,12 +35,14 @@
var global_emergency_alarm_device_number = [];
var zoomToggle = 3;
$(function () {
console.log("floor")
drawHeatBar();
getHotspotPoint(() => {
show3DModel(pageAct.urn);
});
initChart();
getFloData();
subDevice();
})
@ -164,7 +166,7 @@
function initChart() {
let chartDom = $("#floChart")[0];
floChart = echarts.init(chartDom, null, { width: 'auto'});
floChart = echarts.init(chartDom, null, { width: 'auto' });
}
function chartHandler(url) {
@ -182,12 +184,14 @@
tooltip: {
formatter: function (params) {
if (params.data.device_node_guid != undefined && params.data.device_node_guid != null && params.data.device_node_guid != "") {
return `名稱:${params.data.device_node_full_name}<br>
Guid${params.data.device_node_guid}`
return `<div >
名稱:${params.data.device_node_full_name}<br>
Guid${params.data.device_node_guid}
</div>`
}
else {
return `名稱:${params.data.full_name}<br>
Guid${params.data.device_guid}`
return `<div >名稱:${params.data.full_name}<br>
Guid${params.data.device_guid}</div>`
}
}
},
@ -327,7 +331,6 @@
let position = [params.event.event.clientX, params.event.event.clientY];
data._dbId = data._dbId ?? null;
parentEle = crePosPopover(position, data);
$(parentEle).click();
} else {
$(parentEle).YTTooltip("hide");
@ -338,7 +341,7 @@
/*console.log("click", params);*/
var pixelPoint = [params.offsetX, params.offsetY];
var dataPoint = floChart.convertFromPixel({ geoIndex: 0 }, pixelPoint);
if (!(params?.target?.shape?.symbolType == "circle")) {
$(parentEle).YTTooltip("hide");
}
@ -370,7 +373,7 @@
(series.data ?? []).forEach(function (point) {
let dbid = obj.myDataList.filter(x => x.device_number == point.device_number)[0]?._dbId;
point._dbId = dbid;
currentData.forEach(function (cData) {
currentData.forEach(function (cData) {
if (cData.device_guid == point.device_guid) {
cData._dbId = dbid;
}
@ -432,55 +435,55 @@
}
//baja 訂閱設備
function subDevice() {
let floMyBaja = new subscriptionDevices();
var ordPath = {
"area_tag": pageAct.AreaTag,
"building_tag": pageAct.buiTag,
"system_tag": pageAct.sysMainTag,
"name_tag": pageAct.sysSubTag,
let floMyBaja = new subscriptionDevices();
var ordPath = {
"area_tag": pageAct.AreaTag,
"building_tag": pageAct.buiTag,
"system_tag": pageAct.sysMainTag,
"name_tag": pageAct.sysSubTag,
}
floMyBaja.setSubscribeDevicesByBql(ordPath);
floMyBaja.setSubscribeDevicesCallBack(function (data) {
let matchDevice = currentData.filter(x => x.device_number == data.device_number_full)[0];
if (!matchDevice) {
return false;
}
floMyBaja.setSubscribeDevicesByBql(ordPath);
floMyBaja.setSubscribeDevicesCallBack(function (data) {
let matchDevice = currentData.filter(x => x.device_number == data.device_number_full)[0];
if (!matchDevice) {
return false;
}
let norDevPoiName = matchDevice.device_normal_point_name;
let cloDevPoiName = matchDevice.device_close_point_name;
let errDevPoiName = matchDevice.device_error_point_name;
let norDevPoiName = matchDevice.device_normal_point_name;
let cloDevPoiName = matchDevice.device_close_point_name;
let errDevPoiName = matchDevice.device_error_point_name;
if (data.point_name == "Temp") {
heatMap?.changeTemp(data.device_number_full, !isNaN(parseInt(data.value)) ? parseInt(data.value) : 0);
let devIdx = currentData.findIndex(x => x.device_number == data.device_number_full);
currentData[devIdx]._temp = !isNaN(parseInt(data.value)) ? parseInt(data.value) : 0;
}
if (data.point_name == "Temp") {
heatMap?.changeTemp(data.device_number_full, !isNaN(parseInt(data.value)) ? parseInt(data.value) : 0);
let devIdx = currentData.findIndex(x => x.device_number == data.device_number_full);
currentData[devIdx]._temp = !isNaN(parseInt(data.value)) ? parseInt(data.value) : 0;
}
if (data.point_name == norDevPoiName && data.value == matchDevice.device_normal_point_value) {
//顯示正常燈號
$(`#${matchDevice.device_number}_status`).attr("data-light-type", "normal").data("light-type", "normal");
} else if (data.point_name == cloDevPoiName && data.value == matchDevice.device_close_point_value) {
$(`#${matchDevice.device_number}_status`).attr("data-light-type", "close").data("light-type", "close");
} else if (data.point_name == errDevPoiName && data.value == matchDevice.device_error_point_value) {
$(`#${matchDevice.device_number}_status`).attr("data-light-type", "error").data("light-type", "error");
}
});
if (data.point_name == norDevPoiName && data.value == matchDevice.device_normal_point_value) {
//顯示正常燈號
$(`#${matchDevice.device_number}_status`).attr("data-light-type", "normal").data("light-type", "normal");
} else if (data.point_name == cloDevPoiName && data.value == matchDevice.device_close_point_value) {
$(`#${matchDevice.device_number}_status`).attr("data-light-type", "close").data("light-type", "close");
} else if (data.point_name == errDevPoiName && data.value == matchDevice.device_error_point_value) {
$(`#${matchDevice.device_number}_status`).attr("data-light-type", "error").data("light-type", "error");
}
});
floMyBaja.setSubscribeDeviceEndCallBack(function (data) {
endPageLoading();
if (data.findIndex(x => x.point_name == "Temp") != -1) {
// 顯示溫度條
showHeat("[name=forgeHeatBar]");
}
});
floMyBaja.setSubscribeDeviceEndCallBack(function (data) {
endPageLoading();
if (data.findIndex(x => x.point_name == "Temp") != -1) {
// 顯示溫度條
showHeat("[name=forgeHeatBar]");
}
});
}
function drawHeatBar() {
$("#forgeHeatBarDiv").html(setTopHeatBar());
}
// 電梯 3D 位置呈現
function set3DElevPos(viewer) {
@ -623,7 +626,7 @@
// 重設平面圖設備資料
function resetData() {
const scatter_symbol_convertData = function (data,zoom) { //正常、關閉排除CCVT(圓點)
const scatter_symbol_convertData = function (data, zoom) { //正常、關閉排除CCVT(圓點)
let res = [], temp = [];
data.forEach(function (item, index) {
if (global_emergency_alarm_device_number != undefined
@ -766,7 +769,7 @@
tempData = Object.assign(tempData, oldTarObj)
}
})
temp.map(function (item) {
var obj = {
@ -787,8 +790,8 @@
res.push(obj);
});
return res;
}
@ -912,7 +915,7 @@
//如果有子節點,則只針對子節點操作
if (item.device_nodes != undefined && item.device_nodes != null && item.device_nodes.length > 0) {
item.device_nodes.forEach(function (item_node, item_node_index) {
//添加父節點相關資訊
item_node.device_system_category_layer3 = item.device_system_category_layer3;
item_node.device_error_color = item.device_error_color;
@ -1006,13 +1009,13 @@
}]
});
} else {
floChart.setOption({
series: [{
symbolOffset: [10, 10],
data: scatter_symbol_convertData(currentData, zoom), //正常、關閉(圓點)
}, {
data: scatter_icon_convertData(currentData) //正常、關閉(icon)
}, {
@ -1028,7 +1031,7 @@
}
function getNextFloor(floGuid = null) {
let url = baseApiUrl + "/api/Device/GetNextFloor";
objSendData.Data = { floor_guid: floGuid }
let result = "";
@ -1049,7 +1052,7 @@
launchViewerForHotspot(urn, (viewer, nodeIds) => {
let nextFloor = getNextFloor(pageAct.floGuid);
let curFloTag = pageAct.floTag;
if (!nextFloor) {
toast_warning("超出樓層範圍");
return;
@ -1085,28 +1088,28 @@
}
function setHeatMap() {
console.log("currentData", currentData)
let devices = currentData.map(x => {
return {
roomDbId: !isNaN(parseInt(x.room_dbid)) ? parseInt(x.room_dbid) : -1,
id: x.device_number,
position: isJSON(x.device_coordinate_3d) ? JSON.parse(x.device_coordinate_3d) : {}, // x: 0, y: 25, z: -2.5 (3.35, -4.81, 12.88
sensorTypes: ["temperature", "humidity"]
if (pageAct.sysMainTag !== "LT") {
let devices = currentData.map(x => {
return {
roomDbId: !isNaN(parseInt(x.room_dbid)) ? parseInt(x.room_dbid) : -1,
id: x.device_number,
position: isJSON(x.device_coordinate_3d) ? JSON.parse(x.device_coordinate_3d) : {}, // x: 0, y: 25, z: -2.5 (3.35, -4.81, 12.88
sensorTypes: ["temperature", "humidity"]
}
})
let option = {
devices: devices,
}
})
let option = {
devices: devices,
}
heatMap = new ADHeatMaps(option);
heatMap.onComplete = () => {
if (pageAct.sysMainTag !== "LT") {
heatMap = new ADHeatMaps(option);
heatMap.onComplete = () => {
$.each(currentData, (idx, dev) => {
heatMap.changeTemp(dev.device_number, dev._temp || 0);
})
$.each(currentData, (idx, dev) => {
heatMap.changeTemp(dev.device_number, dev._temp || 0);
})
}
}
}
}
function getHotspotPoint(callback = null) {
@ -1133,7 +1136,7 @@
$.extend(item, data);
myDataList.push(item);
})
setHotspotPoint(myDataList);
callback ? callback() : "";
}
@ -1154,7 +1157,7 @@
devObj.full_name = name;
parentEle = crePosPopover(position, devObj);
$(parentEle).click();
let option = floChart.getOption();
option.series.forEach(function (series) {
series.data.forEach(function (point) {
@ -1164,7 +1167,7 @@
});
});
floChart.setOption(option);
})
onEvent("autodesk:clickOut:sprite", "#forgeViewer", function (e) {
@ -1176,7 +1179,7 @@
controlFocusHotspot(cData._dbId, false);
})
}
function chartUnFocusAll() {
let option = floChart.getOption();
option.series.forEach(function (series) {
@ -1187,7 +1190,7 @@
floChart.setOption(option);
}
// 解除 series 聚焦
// 解除 series 聚焦
function chartUnFocus(ele) {
let devGuid = $(ele).data("id");
let option = floChart.getOption();

View File

@ -47,6 +47,8 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
<link rel="stylesheet" href="css/yourteam/plugins/yt-notice/yt-notice.css" />
<link rel="stylesheet" href="css/yourteam/plugins/yt-alert/ytpop-alert.css" />
<link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/style.min.css" type="text/css">
</head>
<!-- BEGIN Body -->
<!-- Possible Classes
@ -871,8 +873,8 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
lastPageAct = JSON.parse(sessionStorage.getItem("pageAct"));
}
if ((lastPageAct.sysSubTag && lastPage == "systemMonitor") || lastPage == "sysElevator"
// || lastPage == "sysSensor"
) {
// || lastPage == "sysSensor"
) {
$(`#subSysBtn${lastPageAct.sysSubTag}`).click();
$("#sysMonTopBtn").YTTab("set");
} else {
@ -949,8 +951,8 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
return;
}
if (page != "systemMonitor" && page != "sysElevator"
// && page != "sysSensor"
) {
// && page != "sysSensor"
) {
$("#sysMonBtnList [name=topFunBtn]").removeClass("active");
pageAct.sysMainTag = null;
pageAct.sysSubTag = null;
@ -1026,7 +1028,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
onEvent("click", "button[id^=noticeChkBtn]", function () { /**button[id^=bajaAckBtn] */
let uuid = $(this).data("uuid");
let url = window.location.origin + "/obix/alarm/" + uuid + "/ack";
let url = window.location.origin + "/obix/alarm/"+uuid+"/ack";
let myBaja = new MyBaja();
myBaja.setMyUserAccount((data) => {
let sendData = '<obj is="obix:AckAlarmIn"><str name="ackUser" val="obix" /></obj>';
@ -1134,7 +1136,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
function drawErrRecTabBlo() {
let strHtml = `<table id="errRecTable" class="table table-bordered table-striped text-center m-0 w-100">
</table>`
</table>`
return strHtml;
}
@ -1142,7 +1144,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
function drawOpeRecTabBlo() {
let strHtml = `<table id="opeRecTable" class="table table-bordered table-striped text-center m-0 w-100">
</table>`
</table>`
return strHtml;
}
@ -1156,48 +1158,49 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
let devNum = $(ele).data("number"); //設備編號
let devGuid = $(ele).data("id"); //guid
let devName = $(ele).data("name"); //full_name
let lightHtml = type == "light" ? `<button type="button" id="lightSch-tab" class="btn btn-icon nav-link" role="tab" data-tabname="cardTab" data-target="#lightSch"><i class="fas fa-calendar-alt"></i></button>` : "";
let lightHtml = type == "light" ? `<button type="button" data-toggle="tooltip" data-placement="bottom" title="燈控排程" id="lightSch-tab" class="px-2 btn btn-icon border-0 nav-link mx-1" role="tab" data-tabname="cardTab" data-target="#lightSch"><i class="fas fa-calendar-alt icon fa-2x"></i></button>` : "";
let option = {
html: `<div class="card m-1 border device-wrap" data-number="${devNum}">
<div class="card-header p-3">
html: `<div class="card m-1 border device-wrap" data-number="${devNum}" data-position="left">
<div class="card-header p-3">
<div class="position-absolute w-50" style="word-break: break-all;">
<label class="m-0 mt-2">${devName}</label>
</div>
<div id="card-tab" class="row justify-content-end nav nav-tabs" role="tablist">
<button type="button" id="state-tab"
data-toggle="tooltip" data-placement="bottom" title="即時監控"
class="px-2 btn btn-icon border-0 nav-link active mx-1" role="tab" data-tabname="cardTab" data-target="#state"><i class="fa fa-desktop icon fa-2x"></i></button>
${lightHtml}
<button type="button" id="info-tab"
data-toggle="tooltip" data-placement="bottom" title="基本資料"
class="px-2 btn btn-icon border-0 nav-link mx-1" role="tab" data-tabname="cardTab" data-target="#info"><i class="fa fa-cog icon fa-2x"></i></button>
<button type="button"
d data-toggle="tooltip" data-placement="bottom" title="告警資料"
id="errRec-tab" class=" px-2 btn btn-icon border-0 nav-link mx-1 position-relative " role="tab" data-tabname="cardTab" data-target="#errRec"><i class="fas fa-exclamation-triangle fa-2x"></i></button>
<button type="button"
data-toggle="tooltip" data-placement="bottom" title="運維紀錄"
id="opeRec-tab" class=" px-2 btn btn-icon border-0 nav-link mx-1" role="tab" data-tabname="cardTab" data-target="#opeRec"><i class="fa fa-bars icon fa-2x"></i></button>
<button type="button" class="px-2 btn btn-icon border-0 nav-link mx-1"><i class="fas fa-times text-white-50 fa-2x" data-close="yttooltip"></i></button>
</div>
<div class="position-absolute mr-5" style="word-break: break-all;">
<label class="m-0 mt-2">${devName}</label>
</div>
<div class="card-body p-2 tab-content">
<div id="state" class="show active" data-tabname="cardTab" data-tabrole="child" style="height:100%;width:100%">
${drawStateTabBlo(devNum)}
</div>
<div id="info" data-tabname="cardTab" data-tabrole="child">
<div id="card-tab" class="row justify-content-end nav nav-tabs" role="tablist">
<button type="button" id="state-tab"
data-toggle="tooltip" data-placement="bottom" title="即時監控"
class="px-2 btn btn-icon border-0 nav-link active mx-1" role="tab" data-tabname="cardTab" data-target="#state"><i class="fa fa-desktop icon fa-2x"></i></button>
${lightHtml}
<button type="button" id="info-tab"
data-toggle="tooltip" data-placement="bottom" title="基本資料"
class="px-2 btn btn-icon border-0 nav-link mx-1" role="tab" data-tabname="cardTab" data-target="#info"><i class="fa fa-cog icon fa-2x"></i></button>
<button type="button"
d data-toggle="tooltip" data-placement="bottom" title="告警資料"
id="errRec-tab" class=" px-2 btn btn-icon border-0 nav-link mx-1 position-relative " role="tab" data-tabname="cardTab" data-target="#errRec"><i class="fas fa-exclamation-triangle fa-2x"></i></button>
<button type="button"
data-toggle="tooltip" data-placement="bottom" title="運維紀錄"
id="opeRec-tab" class=" px-2 btn btn-icon border-0 nav-link mx-1" role="tab" data-tabname="cardTab" data-target="#opeRec"><i class="fa fa-bars icon fa-2x"></i></button>
<button type="button" class="px-2 btn btn-icon border-0 nav-link mx-1"><i class="fas fa-times text-white-50 fa-2x" data-close="yttooltip"></i></button>
</div>
<div id="errRec" data-tabname="cardTab" data-tabrole="child">
${drawErrRecTabBlo()}
</div>
<div id="opeRec" data-tabname="cardTab" data-tabrole="child">
${drawOpeRecTabBlo()}
</div>
</div>
</div>`,
</div>
<div class="card-body p-2 tab-content w-100">
<div id="state" class="show active w-100" data-tabname="cardTab" data-tabrole="child" >
${drawStateTabBlo(devNum)}
</div>
<div id="info" data-tabname="cardTab" data-tabrole="child">
</div>
<div id="errRec" data-tabname="cardTab" data-tabrole="child">
${drawErrRecTabBlo()}
</div>
<div id="opeRec" data-tabname="cardTab" data-tabrole="child">
${drawOpeRecTabBlo()}
</div>
</div>
</div>`,
group: "device",
// 在 _sysElevator.html 及 _sysMonAll.html 會用到
onShow: function (tooltipEle, oriEle) {
@ -1229,24 +1232,24 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
scroll: true
});
// pop 視窗卡片可縮放功能初始化
$(tooltipEle).resizable({
resize: function (event, ui) {
let iframe = $(ui.element).find("iframe");
if (iframe.length != 0) {
if (ui.size.width != ui.originalSize.width) {
iframe.css("width", "100%");
} else if (ui.size.height != ui.originalSize.height) {
iframe.css("height", "100%");
}
}
let cardBodyHeight = $(ui.element).find(".card-body").css("height");
$(ui.element).find(".scrolledTable").css("height", cardBodyHeight)
// $(tooltipEle).resizable({
// // resize: function (event, ui) {
// // let iframe = $(ui.element).find("iframe");
// // if (iframe.length != 0) {
// // if (ui.size.width != ui.originalSize.width) {
// // iframe.css("width", "100%");
// // } else if (ui.size.height != ui.originalSize.height) {
// // iframe.css("height", "100%");
// // }
// // }
// // let cardBodyHeight = $(ui.element).find(".card-body").css("height");
// // $(ui.element).find(".scrolledTable").css("height", cardBodyHeight)
errRecTable.draw(false)
},
minWidth: 200,
minHeight: 150,
});
// // errRecTable.draw(false)
// // },
// // minWidth: 200,
// // minHeight: 150,
// });
// 電梯管理 - Card table 更新
typeof subDeviceSetTable != "undefined" ? subDeviceSetTable($(oriEle).data("number")) : ""
},
@ -1393,7 +1396,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
// Card - 異常紀錄 Table
function callbackForErr(result) {
console.log("@@@", result)
console.log("@@@",result)
if (errRecTable) {
errRecTable.destroy();
}
@ -1582,35 +1585,35 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
} else {
let strHtml = `<div class="btn-group mx-4">
<a href="javascript:;" name="topFunBtn" data-page="dashboard" data-tabname="topFunBtn" class="text-center">
<i class="fal fa-home fa-2x"></i><br>首頁
</a>
<!--<div class="dropdown-menu">
<button class="dropdown-item" type="button">Action</button>
<button class="dropdown-item" type="button">Another action</button>
<button class="dropdown-item" type="button">Something else here</button>
</div>-->
</div>`;
<a href="javascript:;" name="topFunBtn" data-page="dashboard" data-tabname="topFunBtn" class="text-center">
<i class="fal fa-home fa-2x"></i><br>首頁
</a>
<!--<div class="dropdown-menu">
<button class="dropdown-item" type="button">Action</button>
<button class="dropdown-item" type="button">Another action</button>
<button class="dropdown-item" type="button">Something else here</button>
</div>-->
</div>`;
$.each(res.data, function (i, v) {
if (v.authCode == 'PF1') {
strHtml += `<div class="btn-group mx-4" >
<a href="javascript:;" id="sysMonTopBtn" class="text-center" data-toggle="navbar" data-target="#sysMonNavbar" data-tabname="topFunBtn" aria-haspopup="true" aria-expanded="false">
<i class="fal fa-tv fa-2x"></i><br>${v.subName}
</a>
<a href="javascript:;" id="sysMonTopBtn" class="text-center" data-toggle="navbar" data-target="#sysMonNavbar" data-tabname="topFunBtn" aria-haspopup="true" aria-expanded="false">
<i class="fal fa-tv fa-2x"></i><br>${v.subName}
</a>
</div>`;
</div>`;
hasMonitor = true;
}
else {
let icon = v.authCode == 'PF2' ? 'fa-chart-pie' : v.authCode == 'PF3' ? 'fa-chart-area' : v.authCode == 'PF4' ? 'fa-chart-line' : v.authCode == 'PF5' ? 'fa-bell' : v.authCode == 'PF6' ? 'fa-server' : v.authCode == 'PF7' ? 'fa-image' : v.authCode == 'PF8' ? 'fa-user' : '';
strHtml += `<div class="btn-group mx-4">
<a href="javascript:;" name="topFunBtn" data-tabname="topFunBtn" class="dropdown-toggle no-arrow text-center"
data-page="${v.showView}">
<i class="fal ${icon} fa-2x"></i><br>${v.subName}
</a>
</div>`;
<a href="javascript:;" name="topFunBtn" data-tabname="topFunBtn" class="dropdown-toggle no-arrow text-center"
data-page="${v.showView}">
<i class="fal ${icon} fa-2x"></i><br>${v.subName}
</a>
</div>`;
}
});
@ -1690,7 +1693,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
}
}, null, "POST", true).send();
}, null, "POST",true).send();
}
function getAlarm() {
@ -1704,7 +1707,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
{ title: "異常訊息", data: "msgText" },
];
// 向 niagara 取得告警資料
getAllDeviceAlarmByBaja(null, now, false, false, function (bajaDatas) {
getDeviceAlarmCardByBaja(null, now, false, false, function (bajaDatas) {
let datas = bajaDatas.data;
let titleHtml = `異常通知`;
let notices = [];
@ -1715,7 +1718,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
datas[idx].full_name = allDevices.filter(x => x.device_number == data.devicePath)[0]?.full_name;
let div1 = creDiv(["col-12"]);
let button = creBtn("確認", "noticeChkBtn", null, ["btn btn-sm btn-secondary ml-auto col-4"], { uuid: data.uuid });
let button = creBtn("確認", "noticeChkBtn", null, ["btn btn-sm btn-secondary ml-auto col-4"], {uuid:data.uuid});
let btnDiv = creDiv(["d-flex m-0 gap-5 mt-2"]);
btnDiv.append(button);
// 繪製 每行告警資訊

View File

@ -93,7 +93,7 @@ function getAlarmByBaja(startDate_millisecond, endDate_millisecond, isRecover, i
var _index = 0;
var _recoverState = isRecover ? "!= null" : "= null";
var _ackState = isAck ? "= 'acked'" : "= 'unacked'";
console.log("local:|foxs:|alarm:|bql:select timestamp, ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime where alarmClass = '" + alarmClass + "' and timestamp.millis > " + startDate_millisecond + " and timestamp.millis < " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp asc")
//console.log("local:|foxs:|alarm:|bql:select timestamp, ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime where alarmClass = '" + alarmClass + "' and timestamp.millis > " + startDate_millisecond + " and timestamp.millis < " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp asc")
require(['baja!'], function (baja) {
baja.Ord.make("local:|foxs:|alarm:|bql:select timestamp, ackTime, ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime where alarmClass = '" + alarmClass + "' and timestamp.millis > " + startDate_millisecond + " and timestamp.millis < " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp asc").get()
.then(function (table) {
@ -569,7 +569,7 @@ function getAllDeviceAlarmByBaja(startDate_millisecond, endDate_millisecond, isR
if (startDate_millisecond) {
startUrl = "timestamp.millis >= " + startDate_millisecond + " and ";
}
console.log("local:|foxs:|alarm:|bql:select timestamp, ackTime, priority ,ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime where " + startUrl + "timestamp.millis <= " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp desc");
//console.log("告警", "local:|foxs:|alarm:|bql:select timestamp, ackTime, priority ,ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime where " + startUrl + "timestamp.millis <= " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp desc");
require(['baja!'], function (baja) {
baja.Ord.make("local:|foxs:|alarm:|bql:select timestamp, ackTime, priority ,ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime where " + startUrl + "timestamp.millis <= " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp desc").get()