diff --git a/Backend/wwwroot/forgeDemo.html b/Backend/wwwroot/forgeDemo.html index 3c82c9f..e9ee919 100644 --- a/Backend/wwwroot/forgeDemo.html +++ b/Backend/wwwroot/forgeDemo.html @@ -257,13 +257,26 @@ /* 0201 更換好電梯順序 */ /* launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8wMjAxLm53ZA")*/ // 0202 將感測器新增到電梯內 - launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dmVnb29nemNhdmNia2l0aHl2bHJzdnJjdGg2dHR3eWgtMjAyMzAyX2libXMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8wMjAyLm53ZA==") + //launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dmVnb29nemNhdmNia2l0aHl2bHJzdnJjdGg2dHR3eWgtMjAyMzAyX2libXMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8wMjAyLm53ZA==") //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlFX2ZvcmdlX3Rlc3QvJUUzJFTgwJTkwQVJDJUUzJTgwJTkxXzIwMjJfMTJfMTMubndk');//new ARC //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwTUVQJUUzJTgwJTkxXzIwMjJfMTJfMTMubndj');//new MEP //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwQVJDJUUzJTgwJTkxJUU1JTg1JUE4JUU2JUEzJTlGXzIwMjJfMTJfMTMubndj');//全棟 ARC + //0218 + // 感測器修正 + //launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dmVnb29nemNhdmNia2l0aHl2bHJzdnJjdGg2dHR3eWgtMjAyMzAyX2libXMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8wMjE4Lm53ZA") + // 0221 電梯細節 30 + //launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dmVnb29nemNhdmNia2l0aHl2bHJzdnJjdGg2dHR3eWgtMjAyMzAyX2libXMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8lRTklOUIlQkIlRTYlQTIlQUYlRTclQjQlQjAlRTclQUYlODAlRTclODklODhfMDIyMS5ud2Q") + // 0222 電梯 30 + //launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dmVnb29nemNhdmNia2l0aHl2bHJzdnJjdGg2dHR3eWgtMjAyMzAyX2libXMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8lRTklOUIlQkIlRTYlQTIlQUYlRTclQjQlQjAlRTclQUYlODAlRTclODklODhfMDIyMi5ud2Q") + + // 0224 電梯 30 + launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dmVnb29nemNhdmNia2l0aHl2bHJzdnJjdGg2dHR3eWgtMjAyMzAyX2libXMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8lRTklOUIlQkIlRTYlQTIlQUYlRTclQjQlQjAlRTclQUYlODAlRTclODklODhfMDIyNC5ud2Q") + + // 0221 WSP + //launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dmVnb29nemNhdmNia2l0aHl2bHJzdnJjdGg2dHR3eWgtMjAyMzAyX2libXMvQmFucWlhbyUyMFRhaXBlaSUyME1haW4lMjBPZmZpY2UtQUxMXzAyMjEubndk") }); function move1Floor() { @@ -395,6 +408,8 @@ } function importDevCor() { + + //console.log(tagIdDevList) ImportDevForCor(); ImportForgeRoom(); } diff --git a/Backend/wwwroot/js/forge/ForgeDemo.js b/Backend/wwwroot/js/forge/ForgeDemo.js index ff2ba48..58a503f 100644 --- a/Backend/wwwroot/js/forge/ForgeDemo.js +++ b/Backend/wwwroot/js/forge/ForgeDemo.js @@ -268,10 +268,9 @@ function onDocumentLoadSuccess(doc) { // }) //}) - allDbIdsStr.forEach((dbId) => { curDbId = parseInt(dbId); - viewer.getProperties(curDbId, function (e) { + viewer.getProperties(curDbId, function (e) { e.properties.forEach(function (item) { if (item.displayName == "【tag_id】") { // Tag_name tag_id 【tag_id】 if (item.displayValue != "") { @@ -297,21 +296,69 @@ function onDocumentLoadSuccess(doc) { //console.log("position: (" + (position.x).toFixed(2) + ", " + (position.y).toFixed(2) + ", " + (position.z).toFixed(2) + ")"); //console.log("--------------------------------------------------"); ////} - tagIdDevList.push({ device_number: item.displayValue, device_coordinate_3d: '{ "x": ' + (position.x).toFixed(2) + ', "y": ' + (position.y).toFixed(2) + ', "z": ' + (position.z).toFixed(2) + ' }', forge_dbid: e.dbId, room_name: "" }); + tagIdDevList.push( + { + device_number: item.displayValue, + device_coordinate_3d: '{ "x": ' + (position.x).toFixed(2) + ', "y": ' + (position.y).toFixed(2) + ', "z": ' + (position.z).toFixed(2) + ' }', + forge_dbid: e.dbId, room_name: "" + }); } } - } - if (item.displayName == "【room_id】") { - tagIdDevList = tagIdDevList.map(tagItem => { - if (tagItem.forge_dbid === e.dbId) { - tagItem = { ...tagItem, room_name: item.displayValue } - } - return tagItem - }) - } + } + + if (item.displayName == "【room_id】") { + tagIdDevList = tagIdDevList.map(tagItem => { + if (tagItem.forge_dbid === e.dbId) { + tagItem = { ...tagItem, room_name: item.displayValue } + } + return tagItem + }) + } + if (item.displayName == "Group_id" && item.displayValue !== '') { + //取得座標 + let bounds = new THREE.Box3(); + instanceTree.enumNodeFragments(e.dbId, (fragId) => { + let box = new THREE.Box3(); + fragList.getWorldBounds(fragId, box); + bounds.union(box); + }, true); + var position = bounds.center(); + + tagIdDevList.push({ + device_number: item.displayValue, + //device_coordinate_3d: '{ "x": ' + (position.x).toFixed(2) + ', "y": ' + (position.y).toFixed(2) + ', "z": ' + (position.z).toFixed(2) + ' }', + forge_dbid: e.dbId, + room_name: "" + }) + } + if (item.displayName == "Tag_name" && item.displayValue !== '') { + //取得座標 + let bounds = new THREE.Box3(); + instanceTree.enumNodeFragments(e.dbId, (fragId) => { + let box = new THREE.Box3(); + fragList.getWorldBounds(fragId, box); + bounds.union(box); + }, true); + var position = bounds.center(); + if (tagIdDevList.some(item => item.forge_dbid === e.dbId)) { + tagIdDevList.find(item => item.forge_dbid === e.dbId).node = { + device_number: item.displayValue, + device_coordinate_3d: '{ "x": ' + (position.x).toFixed(2) + ', "y": ' + (position.y).toFixed(2) + ', "z": ' + (position.z).toFixed(2) + ' }', + forge_dbid: e.dbId, + room_name: "" + } + } else { + tagIdDevList.push({ + device_number: item.displayValue, + device_coordinate_3d: '{ "x": ' + (position.x).toFixed(2) + ', "y": ' + (position.y).toFixed(2) + ', "z": ' + (position.z).toFixed(2) + ' }', + forge_dbid: e.dbId, + room_name: "" + }) + } + } }); - }) + }) }) //---------------------- end --------------------------------------------------- diff --git a/Frontend/_alert.html b/Frontend/_alert.html index acf3e2a..934a073 100644 --- a/Frontend/_alert.html +++ b/Frontend/_alert.html @@ -299,7 +299,11 @@ pageAct.alr_startdate = $("#alr_startdate").val(); pageAct.alr_enddate = $("#alr_enddate").val(); - getData(); + pageAct.SysType = 'all'; + + if (!first) getData(); + else selAllSysVal($('#selAllSys')) + // getData(); }); onEvent('change', '#alr_startdate, #alr_enddate', function () { @@ -551,20 +555,20 @@ if (i2 == 0 && i == 0) { firstMain = v.main_system_tag; firstSub = v2.sub_system_tag; + console.log(v.main_system_tag, v2.sub_system_tag) } }); }); - if (pageAct.mainStatus) { $('#alr_mainList').html(mainStrHtml); $('#alr_subList').html(subStrHtml); + console.log($('input[data-type=main][id=' + firstMain + ']')) $('input[data-type=main][id=' + firstMain + ']').click(); } else { $('#alr_mainList').html(subStrHtml); } - - $('input[data-type=sub][id=' + firstSub + ']').click(); + // $('input[data-type=sub][id=' + firstSub + ']').click(); } ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send(); } @@ -584,6 +588,7 @@ } }); $(elem).html('取消全選'); + pageAct.SysType = 'all'; } else { @@ -643,6 +648,7 @@ } function refTable(data) { + console.log(data) let tag = "#alertTable"; $.each(data, function (i, v) { @@ -671,7 +677,7 @@ "title": "異常ID", "data": "uuid", render: (data) => { - return data.split("-")[0] + return data.$val ? data.$val.split("-")[0] : data.split("-")[0] } }, { @@ -736,6 +742,7 @@ ytAjax = new YourTeam.Ajax(url, objSendData, function (rel) { if (rel.code == "0000") a = rel.data; + // console.log(rel) }, null, "POST").send(); return a; diff --git a/Frontend/_dashboard.html b/Frontend/_dashboard.html index c263940..b9f4cbd 100644 --- a/Frontend/_dashboard.html +++ b/Frontend/_dashboard.html @@ -16,7 +16,8 @@ 今日用電量 kWH - +