@@ -59,6 +53,7 @@
var forgeInvTypeDef = null;
$(function () {
+ $(loadEle).Loading("start");
getBuildMenu((arr, data) => {
buildMenuData = data;
if (arr.indexOf(4) != -1) {
@@ -162,15 +157,31 @@
if (lightOn) {
setLightValues(matchDevice.device_guid, 200, 0xe1cf18);
// changeColorForHotspot(matchDevice.spriteDbid, null, true)
- lightOnHotColorArr.push(matchDevice.spriteDbid);
+ if (
+ !lightOnHotColorArr.some(
+ ({ spriteDbid }) => spriteDbid === matchDevice.spriteDbid
+ )
+ ) {
+ lightOnHotColorArr.push(matchDevice);
+ }
+ lightOffHotColorArr = lightOffHotColorArr.filter(
+ (light) => light.spriteDbid !== matchDevice.spriteDbid
+ );
heatMap?.changeTemp(matchDevice.device_number, 40);
} else {
setLightValues(matchDevice.device_guid, 0, 0xffffff);
// changeColorForHotspot(matchDevice.spriteDbid)
+ if (
+ !lightOffHotColorArr.some(
+ ({ spriteDbid }) => spriteDbid === matchDevice.spriteDbid
+ )
+ ) {
+ lightOffHotColorArr.push(matchDevice);
+ }
lightOnHotColorArr = lightOnHotColorArr.filter(
- (light) => light !== matchDevice.spriteDbid
+ (light) => light.spriteDbid !== matchDevice.spriteDbid
);
- lightOffHotColorArr.push(matchDevice.spriteDbid);
+
heatMap?.changeTemp(matchDevice.device_number, 0);
}
}
@@ -187,7 +198,6 @@
? parseInt(data.value)
: 0;
}
-
if (
data.point_name == norDevPoiName &&
data.value == matchDevice.device_normal_point_value
@@ -211,9 +221,24 @@
.attr("data-light-type", "error")
.data("light-type", "error");
}
+ if (
+ allDevList.length ===
+ lightOnHotColorArr.length + lightOffHotColorArr.length
+ ) {
+ changeColorForHotspot(
+ lightOnHotColorArr.map(({ spriteDbid }) => spriteDbid),
+ null,
+ true
+ );
+ changeColorForHotspot(
+ lightOffHotColorArr.map(({ spriteDbid }) => spriteDbid),
+ null,
+ false
+ );
+
+ }
+ $(loadEle).Loading("close");
- changeColorForHotspot(lightOnHotColorArr, null, true);
- changeColorForHotspot(lightOffHotColorArr, null, false);
setLightColor();
setForgeHotSpotColor(matchDevice);
lightDevForgeSpotLig(matchDevice);
@@ -230,7 +255,7 @@
});
}
- function lightDevForgeSpotLig(devObj) {}
+ function lightDevForgeSpotLig(devObj) { }
// 從設備訂閱更新每個設備卡片即時點位
function setDevItemPoiValBySub(data) {
@@ -289,7 +314,7 @@
if (
subData &&
subData[device.device_error_point_name] ==
- device.device_error_point_value &&
+ device.device_error_point_value &&
(!isNaN(parseInt(device.spriteDbid)) || !isNaN(parseInt(device._dbId)))
) {
const _dbId = parseInt(device.spriteDbid) || parseInt(device._dbId);
@@ -299,7 +324,7 @@
} else if (
subData &&
subData[device.device_error_point_name] !==
- device.device_error_point_value &&
+ device.device_error_point_value &&
(!isNaN(parseInt(device.spriteDbid)) || !isNaN(parseInt(device._dbId)))
) {
const _dbId = parseInt(device.spriteDbid) || parseInt(device._dbId);
@@ -342,44 +367,33 @@
$.each(floObj.device_list, (index2, devObj) => {
allDevList.push(devObj);
let devItem = getRiserPoiObj();
- strHtml += `
+ strHtml += `
-
-
${
- devItem?.full_name
- }:${devItem?.unit}
-
詳細資料
+
+
${devItem?.full_name
+ }:${devItem?.unit}
+
詳細資料
`;
@@ -469,9 +483,9 @@
callback
? callback(
- [res.data.left_drawing, res.data.right_drawing],
- res.data
- )
+ [res.data.left_drawing, res.data.right_drawing],
+ res.data
+ )
: "";
}
},
@@ -511,12 +525,11 @@
}
function show3DModel(urn) {
- $(loadEle).Loading("start");
launchViewerForHotspot(
urn,
(viewer, nodeIds) => {
// 隱藏 toolbar
- // document.querySelector("#guiviewer3d-toolbar").style.display = "none";
+ document.querySelector("#guiviewer3d-toolbar").style.display = "none";
let devDbIds = allDevList.map((x) => x.forge_dbid);
// 大類
let subDevDbId = [];
@@ -534,11 +547,11 @@
setInviForge(forgeInvTypeDef, [...devDbIds, ...subDevDbId]);
}
- $(loadEle).Loading("close");
let sensorObjs = [];
let devices = [];
if (pageAct.sysSubTag === "M12") {
addHotPoint(viewer);
+ Forge3DSensor.sensorTimes = 0;
allDevList.forEach((device) => {
Forge3DSensor.sensorTimes++;
const sensorObj = new Forge3DSensor({
@@ -550,23 +563,23 @@
selector: "[name=forgeViewer]",
elevCb: elevatorShow
? () => {
- let elevOption = {
- selector: "[name=forgeViewer]",
- viewer: viewer,
- ordPath: {
- area_tag: pageAct.AreaTag,
- building_tag: pageAct.buiTag,
- },
- sensorObjs,
- };
+ let elevOption = {
+ selector: "[name=forgeViewer]",
+ viewer: viewer,
+ ordPath: {
+ area_tag: pageAct.AreaTag,
+ building_tag: pageAct.buiTag,
+ },
+ sensorObjs,
+ };
- // 電梯移動訂閱程序載入
- let forge3DElev = new Forge3DElevFull(elevOption);
- forge3DElev.bajaEndCallback = function () {
- endPageLoading();
- };
- forge3DElev.init();
- }
+ // 電梯移動訂閱程序載入
+ let forge3DElev = new Forge3DElevFull(elevOption);
+ forge3DElev.bajaEndCallback = function () {
+ endPageLoading();
+ };
+ forge3DElev.init();
+ }
: null,
curDevice: {
...device,
@@ -670,9 +683,7 @@
getE1NodeId(viewer);
}
},
- () => {
- $(loadEle).Loading("close");
- },
+ () => { },
"[name=forgeViewer]"
);
}
diff --git a/Frontend/_sysMonFloor.html b/Frontend/_sysMonFloor.html
index f53807c..969b9de 100644
--- a/Frontend/_sysMonFloor.html
+++ b/Frontend/_sysMonFloor.html
@@ -49,7 +49,7 @@
getHotspotPoint(() => {
show3DModel(pageAct.urn);
});
- if (!tempSubTag.includes(pageAct.sysSubTag)) {
+ if (tempSubTag.includes(pageAct.sysSubTag)) {
$("#topLight").html(setTopLight());
setLightColor();
}
@@ -573,7 +573,13 @@
if (lightOn && matchDevice.spriteDbid) {
// setLightValues(matchDevice.device_guid, 200, 0xe1cf18);
// changeColorForHotspot(matchDevice.spriteDbid, null, lightOn);
- lightOnHotColorArr.push(matchDevice);
+ if (
+ !lightOnHotColorArr.some(
+ ({ spriteDbid }) => spriteDbid === matchDevice.spriteDbid
+ )
+ ) {
+ lightOnHotColorArr.push(matchDevice);
+ }
lightOffHotColorArr = lightOffHotColorArr.filter(
(light) => light.spriteDbid !== matchDevice.spriteDbid
);
@@ -582,10 +588,16 @@
// console.log(lightOn, matchDevice);
// setLightValues(matchDevice.device_guid, 0, 0xffffff);
// changeColorForHotspot(matchDevice.spriteDbid, null, lightOn);
+ if (
+ !lightOffHotColorArr.some(
+ ({ spriteDbid }) => spriteDbid === matchDevice.spriteDbid
+ )
+ ) {
+ lightOffHotColorArr.push(matchDevice);
+ }
lightOnHotColorArr = lightOnHotColorArr.filter(
(light) => light.spriteDbid !== matchDevice.spriteDbid
);
- lightOffHotColorArr.push(matchDevice);
heatMap?.changeTemp(matchDevice.device_number, 0);
}
}
@@ -681,7 +693,6 @@
deviceScatterErrorArr.length ===
option.series[0].data.length
) {
- console.log("deviceScatterNormalArr", deviceScatterNormalArr)
deviceScatterNormalArr.forEach((device) => {
const cur = option.series[0].data.find(
({ device_number }) => device_number === device.device_number
@@ -693,7 +704,6 @@
cur.itemStyle = { color: normalColor };
});
-
deviceScatterCloseArr.forEach((device) => {
const cur = option.series[0].data.find(
({ device_number }) => device_number === device.device_number
@@ -1150,7 +1160,7 @@
};
obj.itemStyle = {
- color: item.device_color || item.device_normal_color,
+ color: item.device_color || item.device_close_color,
};
res.push(obj);
diff --git a/Frontend/index.html b/Frontend/index.html
index f6fa463..b983e40 100644
--- a/Frontend/index.html
+++ b/Frontend/index.html
@@ -8,102 +8,72 @@ Purchase: https://wrapbootstrap.com/theme/smartadmin-responsive-webapp-WB0573SK0
License: You must have a valid license purchased only from wrapbootstrap.com (link above) in order to legally use this theme for your project.
-->
-
-
-
Marketing Dashboard - Application Intel - SmartAdmin v4.5.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
Marketing Dashboard - Application Intel - SmartAdmin v4.5.1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-