diff --git a/Frontend/_dashboard.html b/Frontend/_dashboard.html
index 5d5460b..3dfeeb0 100644
--- a/Frontend/_dashboard.html
+++ b/Frontend/_dashboard.html
@@ -216,7 +216,7 @@
var tarElePath = '';
var sysSubList = [];
var viewer3DNodeIds = [];
- var timeOuters = [];
+
var eveDayElecChart = null;
var eveWeekElecChart = null;
var worOrdErrChart = null;
@@ -269,7 +269,7 @@
show3DModel();
getSubList();
getFirstEletric();
- timeOutGetData();
+
});
function demoSubList() {
diff --git a/Frontend/_sysMonAll.html b/Frontend/_sysMonAll.html
index 2c16524..f9e15b1 100644
--- a/Frontend/_sysMonAll.html
+++ b/Frontend/_sysMonAll.html
@@ -48,7 +48,6 @@
setLightColor();
}
if (arr.indexOf(3) != -1) {
- getLightPoint();
getHotspotPoint(() => {
show3DModel(data.urn_3D);
});
@@ -96,12 +95,12 @@
}
myBaja.setSubscribeDevicesByBql(ordPath);
myBaja.setSubscribeDevicesCallBack(function (data) {
- console.log(data)
+
let matchDevice = allDevList.filter(x => x.device_number == data.device_number_full)[0];
if (!matchDevice) {
return false;
}
- console.log(data)
+
//將訂閱值塞入 subDeviceData
if (subDeviceData.findIndex(x => x.device_number == matchDevice.device_number) == -1) {
let obj = {};
@@ -144,6 +143,10 @@
myBaja.setSubscribeDeviceEndCallBack(function (data) {
endPageLoading();
+ if (data.findIndex(x => x.point_name == "Temp") != -1) {
+ // 顯示溫度條
+ showHeat("[name=forgeHeatBar]");
+ }
});
}
@@ -267,7 +270,7 @@
- ${devObj.full_name}
+ ${devObj.full_name}
@@ -282,13 +285,28 @@
})
// Niagara 產生 file 開頭字串問題
strHtml = strHtml.replaceAll(`src="/file/`, `src="`);
+
if (!res.data || res.data.length == 0) {
endPageLoading();
} else {
+ // 訂閱 baja 設備
subDevice();
}
+
+ // 繪製 html
$("#floDevList").append(strHtml);
+
+ // 存入 device 基本資料至元素 data 屬性
+ $("#floDevList a[name=devItem]").each((idx, ele) => {
+ if (allDevList.findIndex(x => x.device_number == $(ele).data("number")) != -1) {
+ $(ele).data("devobj", allDevList.filter(x => x.device_number == $(ele).data("number"))[0]);
+ }
+ })
+
+ // 初始化 pop 視窗
initPopover();
+ // 卡片設備名稱點擊事件
+ devItemNameEvent();
}
}, null, "POST").send();
}
@@ -349,9 +367,10 @@
function show3DModel(urn) {
$(loadEle).Loading("start");
- //getLightData(allDevList);
+ if (pageAct.sysMainTag == "LT") {
+ setLightPoint(allDevList);
+ }
launchViewerForHotspot(urn, (viewer, nodeIds) => {
- showHeat("[name=forgeHeatBar]");
let devDbIds = allDevList.map(x => x.forge_dbid);
/*hideAllObjects(devDbIds);*/
@@ -454,8 +473,7 @@
$.extend(item, data);
myDataList.push(item);
})
-
- console.log("1", myDataList)
+
setHotspotPoint(myDataList);
callback ? callback() : "";
}
@@ -463,45 +481,12 @@
}
- async function getLightPoint(callback = null) {
- let url = baseApiUrl + "/api/GetDevNodeForCor";
- let sendData = {
- "device_area_tag": pageAct.AreaTag,
- "device_building_tag": pageAct.buiTag,
- "device_system_tag": pageAct.sysMainTag,
- "device_name_tag": pageAct.sysSubTag,
- };
- objSendData.Data = sendData;
- ytAjax = new YourTeam.Ajax(url, objSendData, function (res) {
- if (!res || res.code != "0000" || !res.data) {
-
- } else {
-
- let myDataList = [];
- $.each(res.data, (idx, data) => {
- let item = {};
- item.position = {};
- if (data.device_node_coordinate_3d != null && isJSON(data.device_node_coordinate_3d)) {
- item.position = JSON.parse(data.device_node_coordinate_3d);
- }
- $.extend(item, data);
- myDataList.push(item);
- })
-
- console.log("2", myDataList)
- setLightPoint(myDataList);
- callback ? callback() : "";
- }
- }, null, "POST").send();
-
- }
-
function setHotspotPoint(myDataList = []) {
console.log(myDataList)
getHopspotPoint(myDataList);
}
- async function setLightPoint(myDataList = []) {
+ function setLightPoint(myDataList = []) {
console.log(myDataList)
getLightData(myDataList);
}
diff --git a/Frontend/css/site.css b/Frontend/css/site.css
index a878acc..7c0e702 100644
--- a/Frontend/css/site.css
+++ b/Frontend/css/site.css
@@ -93,6 +93,9 @@ input:-webkit-autofill { background-color: rgba(0, 0, 0, 0.15) !important; }
.device-wrap .card-body #info, .device-wrap .card-body #errRec, .device-wrap .card-body #opeRec { min-width: 500px; }
.scrolledTable { overflow-y: auto; clear: both; max-height:100%;}
+#toast-container > div {
+ width:330px !important;
+}
/*a[data-tabname="topFunBtn"] { color: #fff }
a[data-tabname="topFunBtn"].active { color: #886ab5 }
@@ -103,7 +106,7 @@ a[data-tabname="topFunBtn"]:hover { color: var(--theme-primary-50); }
}
.userblock:hover { color: var(--theme-primary-50); }
.dropdown.show .userblock { color: var(--theme-primary-50) !important; }*/
-.page-header a {color:#fff !important;}
+.page-header a { color: #fff !important; }
.page-header a:hover { color: var(--theme-primary-50) !important; }
.page-header a.active { color: var(--theme-primary-500) !important; }
.dropdown.show a { color: var(--theme-primary-50) !important; }
diff --git a/Frontend/index.html b/Frontend/index.html
index f3eeba6..0095295 100644
--- a/Frontend/index.html
+++ b/Frontend/index.html
@@ -725,6 +725,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"
@@ -837,6 +838,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
getBuiList();
getSysMonBtnList();
checkDevState();
+
if (lastPage) {
let lastPageAct = {};
@@ -855,6 +857,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
$("#app").load("_dashboard.html", loadCallback);
}
+ timeOutGetData();
function getBuiList() {
let url = baseApiUrl + "/api/Device/GetBuild";
@@ -935,7 +938,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
endPageLoading();
$(".yt-alert").YTAlert().hide();
- if (typeof timeOuters != "undefined") {
+ if (typeof timeOuters != "undefined" && timeOuters) {
$.each(timeOuters, (idx, timeOut) => {
clearInterval(timeOut);
})
@@ -989,6 +992,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
})
$(window).on("timeout:3s", function () {
+ debugger
getSystemAlarmByBaja((data) => {
if (typeof getAlarmSub != "undefined" && getAlarmSub) {
getAlarmSub(data);
@@ -996,6 +1000,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
alarmIconBlink();
})
+ showWarToast();
})
}
@@ -1103,52 +1108,60 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
let lightHtml = type == "light" ? `
` : "";
let option = {
html: `
+
+
+ ${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) {
let iframe = $(ui.element).find("iframe");
@@ -1167,9 +1180,11 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
minWidth: 200,
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 +1197,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) {
@@ -1433,6 +1457,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");
@@ -1531,7 +1556,6 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
};
objSendData.Data = sendData;
ytAjax = new YourTeam.Ajax(url, objSendData, function (res) {
- console.log(res);
if (!res || res.code != "0000" || !res.data) {
} else {
@@ -1576,6 +1600,56 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
}
}, null, "POST").send();
}
+
+ function showWarToast() {
+ let options = {
+ "closeButton": false,
+ "debug": false,
+ "newestOnTop": true,
+ "progressBar": false,
+ "positionClass": "toast-top-right",
+ "preventDuplicates": false,
+ "onclick": null,
+ "showDuration": "300",
+ "hideDuration": "1000",
+ "timeOut": 0,
+ "extendedTimeOut": 0,
+ "showEasing": "swing",
+ "hideEasing": "linear",
+ "showMethod": "fadeIn",
+ "hideMethod": "fadeOut",
+ "tapToDismiss": false
+ }
+
+ if ($("#toast-container .toast").length < 2) {
+ let strConHtml = `