diff --git a/Frontend/_sysMonAll.html b/Frontend/_sysMonAll.html index 5e67a8a..1e63aff 100644 --- a/Frontend/_sysMonAll.html +++ b/Frontend/_sysMonAll.html @@ -54,7 +54,6 @@ $(function () { $(loadEle).Loading("start"); - debugger getBuildMenu((arr, data) => { buildMenuData = data; if (arr.indexOf(4) != -1) { @@ -576,7 +575,7 @@ devObj.device_image }" class="profile-image rounded-circle" onerror="defDev(this)" alt="..."> - ${devObj.full_name } diff --git a/Frontend/index.html b/Frontend/index.html index 408ffc4..570385a 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -1276,7 +1276,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li setSysTagForPageAct(this); $("#sysMonTopBtn").YTTab("set"); $(`#subSysBtn${pageAct.sysSubTag}`).YTTab("set"); - debugger + if (pageAct.isShowBuildingInMenu) { let building_tag = $(this).data("building-tag"); $(`#buildTab${building_tag}`).YTTab("set"); @@ -1570,7 +1570,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li : ""; let option = { - html: `
+ html: `
@@ -1701,10 +1701,12 @@ 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( + let devObj = $(`[name=devItem][data-number=${deviceNumber(devNum)}]`).data( "devobj" ); - moveViewToDevice(devObj.forge_dbid); + if(devObj){ + moveViewToDevice(devObj.forge_dbid); + } }); } diff --git a/Frontend/js/forge/forgemodel.js b/Frontend/js/forge/forgemodel.js index 977fd34..eca1c6a 100644 --- a/Frontend/js/forge/forgemodel.js +++ b/Frontend/js/forge/forgemodel.js @@ -13,7 +13,9 @@ function getAllLeafComponents(viewer, callback) { var cbCount = 0; var tree; var jsData = []; - + if(typeof viewer == 'undefined'){ + return; + } function getLeafComponentsRec(current, parent) { cbCount++; if (tree.getChildCount(current) != 0) { @@ -833,6 +835,9 @@ async function changeColorForHotspot(dbId, type = null, OnOff = false) { // 更換 icon async function changeScaleForHotspot(dbId, type = true) { + if(typeof viewer == 'undefined'){ + return; + } const dataVizExtn = await viewer.loadExtension("Autodesk.DataVisualization"); let spriteErrIcon = baseForgeApiUrl + "/file/img/forge/sensor_circle.svg"; if (location.href.indexOf("localhost:5966") != -1) { @@ -848,6 +853,9 @@ async function changeScaleForHotspot(dbId, type = true) { // 熱點 更換大小 async function changeScaleForHotspot(dbId, type = true) { + if(typeof viewer == 'undefined'){ + return; + } const dataVizExtn = await viewer.loadExtension("Autodesk.DataVisualization"); let scale = 1; if (type) { @@ -1266,17 +1274,26 @@ function getHopspotPoint(data) { //呼叫載入熱圖 async function toLoadHeatmap(roomArr) { + if(typeof viewer == 'undefined'){ + return; + } const model = viewer.model; loadHeatmaps(model, roomArr); } function setShadowShow(type = false) { + if(typeof viewer == 'undefined'){ + return; + } viewer.setGroundShadow(type); viewer.impl.sceneUpdated(true); } //============================= end =================================== function moveViewToDevice(letter) { + if(typeof viewer == 'undefined'){ + return; + } if (letter != "") { viewer.clearSelection(); viewer.select(letter);