diff --git a/Backend/Controllers/DeviceImportController.cs b/Backend/Controllers/DeviceImportController.cs index 7b03b95..a0baac1 100644 --- a/Backend/Controllers/DeviceImportController.cs +++ b/Backend/Controllers/DeviceImportController.cs @@ -777,6 +777,11 @@ namespace Backend.Controllers { device_guid_record = device_guid.ToString(); node_priority = 1; + Dictionary deviceForLight = new Dictionary(); + deviceForLight.Add("@device_coordinate_3d", idfc.device_coordinate_3d); + deviceForLight.Add("@forge_dbid", idfc.forge_dbid); + deviceForLight.Add("@updated_at", DateTime.Now); + await backendRepository.UpdateOneByCustomTable(deviceForLight, "device", $@" device_guid = '{device_guid}'"); } //燈具 @@ -798,11 +803,9 @@ namespace Backend.Controllers Dictionary device = new Dictionary(); device.Add("@device_coordinate_3d", idfc.device_coordinate_3d); device.Add("@forge_dbid", idfc.forge_dbid); + device.Add("@updated_at", DateTime.Now); await backendRepository.UpdateOneByCustomTable(device, "device", $@" device_number = '{idfc.device_number}'"); } - - - } } apiResult.Code = "0000"; @@ -823,5 +826,91 @@ namespace Backend.Controllers return apiResult; } + + /// + /// 更新forge_room room_id(dbid), room_name + /// + /// + [HttpPost] + public async Task> ImportForgeRoom([FromBody] List post) + { + ApiResult apiResult = new ApiResult(); + //var device_guid_record = ""; + try + { + if (post != null) + { + if (post.Count > 0) + { + //清空device_node資料表 + await backendRepository.TruncateTable("forge_room"); + + foreach (var idfc in post) + { + // var room_name_arr = idfc.room_name.Split('_'); + string full_name = idfc.room_name; + char first = full_name[0]; + if (first != 'B' && first != 'R' && first != 'U') + { + full_name = 'U' + full_name; + } + + //var param = new { floor_name = floor_name }; + + //房間 新增Data至forge_room資料表 + Dictionary room = new Dictionary(); + room.Add("@room_id", idfc.room_id); + room.Add("@deleted", 0); + room.Add("@room_name", full_name); + room.Add("@created_at", DateTime.Now); + + await backendRepository.AddOneByCustomTableReturnId(room, "forge_room", false); + + + } + + //更新forge_room資料表 building_tag, floor_guid欄位 + string sql = @" + update forge_room a + join ( + select building_tag, floor_guid, + case when right(floor_name, 1) = 'F' then floor_name + else CONCAT(floor_name, 'F') end floor_name , priority + from ( + SELECT + a.building_tag, + a.floor_guid, a.full_name, + case when left(a.full_name, 1) = 'B' then a.full_name + when left(a.full_name, 1) = 'R' then a.full_name + when left(a.full_name, 1) = 'U' then a.full_name + else CONCAT('U', a.full_name) end as floor_name, + a.priority + FROM floor AS a + INNER JOIN building AS b ON a.building_tag = b.building_tag + WHERE a.deleted = 0 AND b.deleted = 0 + )y + )x on SUBSTRING_INDEX(a.room_name, '_', 1) = x.floor_name + set a.building_tag = x.building_tag, + a.floor_guid = x.floor_guid"; + await backendRepository.ExecuteSql(sql); + } + apiResult.Code = "0000"; + apiResult.Msg = "編輯成功"; + } + else + { + apiResult.Code = "0001"; + apiResult.Msg = "無資料輸入"; + } + } + catch (Exception exception) + { + apiResult.Code = "9999"; + apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + } + + return apiResult; + } } } diff --git a/Backend/Models/Device.cs b/Backend/Models/Device.cs index 668e3f7..2d9dd3a 100644 --- a/Backend/Models/Device.cs +++ b/Backend/Models/Device.cs @@ -270,4 +270,23 @@ namespace Backend.Models public string device_coordinate_3d { get; set; } public int forge_dbid { get; set; } } + + public class ImportForgeRoom + { + public string building_tag { get; set; } + public string floor_guid { get; set; } + public int room_id { get; set; } + public int deleted { get; set; } + public string room_name { get; set; } + public string created_at { get; set; } + } + + public class Import_floor_data + { + public string building_tag { get; set; } + public string floor_guid { get; set; } + public string floor_name { get; set; } + public int priority { get; set; } + } + } diff --git a/Backend/Views/BuildMenu/Index.cshtml b/Backend/Views/BuildMenu/Index.cshtml index b780a8f..c8ff911 100644 --- a/Backend/Views/BuildMenu/Index.cshtml +++ b/Backend/Views/BuildMenu/Index.cshtml @@ -54,11 +54,9 @@ 左邊預設頁面 左邊是否顯示
平面圖 左邊昇位圖
詳細資料設定 - 左邊昇位圖
詳細資料URL 右邊預設頁面 右邊是否顯示
平面圖 右邊昇位圖
詳細資料設定 - 右邊昇位圖
詳細資料URL @*昇位圖URL*@ 功能 @@ -215,12 +213,12 @@
- +
-
+ @*

@@ -229,7 +227,7 @@ -
+
*@

@@ -340,12 +338,12 @@
- +
-
+ @*

@@ -354,7 +352,7 @@ -
+
*@

@@ -478,14 +476,14 @@ str.push("點擊開關") } if (1 & parseInt(data) > 0) { - str.push("顯示詳細資料") + str.push("顯示詳細資料 - (抓取設備八段路徑呈現詳細資料)") } return str.join(";"); } }, - { - "data": "left_icon_click_url" - }, + //{ + // "data": "left_icon_click_url" + //}, { "data": "right_drawing_name" }, @@ -500,14 +498,14 @@ str.push("點擊開關") } if (1 & parseInt(data) > 0) { - str.push("顯示詳細資料") + str.push("顯示詳細資料 - (抓取設備八段路徑呈現詳細資料)") } return str.join(";"); } }, - { - "data": "right_icon_click_url" - }, + //{ + // "data": "right_icon_click_url" + //}, { "data": null, "render": function (data, type, row, meta){ @@ -542,13 +540,13 @@ $.each(this.data, function (k, rel) { rel.sub_system_guid_name = "" + rel.sub_system_guid_name + "" if (rel.left_drawing == 2) { - rel.left_drawing_name = rel.left_drawing_name + "
" + '點擊連結' + rel.left_drawing_name = rel.left_drawing_name + "
" + '點擊連結' } if (rel.left_drawing == 1) { rel.left_drawing_name = rel.left_drawing_name + "
" + '[' + rel.floor_guid_name + ']' } if (rel.right_drawing == 2) { - rel.right_drawing_name = rel.right_drawing_name + "
" + '點擊連結' + rel.right_drawing_name = rel.right_drawing_name + "
" + '點擊連結' } if (rel.right_drawing == 1) { rel.right_drawing_name = rel.right_drawing_name + "
" + '[' + rel.floor_guid_name + ']' @@ -787,20 +785,20 @@ //#endregion $('#build_menu_icon_click_onoff_modal_div').on("click", "input[type=checkbox]", function () { if ($(this).prop("checked") && $(this).val() == 1) { - $('#build_menu_icon_click_url_modal_div').show(); + //$('#build_menu_icon_click_url_modal_div').show(); $('#build_menu_icon_click_url_width_height_modal_div').show(); } else { - $('#build_menu_icon_click_url_modal_div').hide(); + //$('#build_menu_icon_click_url_modal_div').hide(); $('#build_menu_icon_click_url_width_height_modal_div').hide(); } }); $('#build_menu_icon_click_onoff_modal_div_r').on("click", "input[type=checkbox]", function () { if ($(this).prop("checked") && $(this).val() == 1) { - $('#build_menu_icon_click_url_modal_div_r').show(); + //$('#build_menu_icon_click_url_modal_div_r').show(); $('#build_menu_icon_click_url_width_height_modal_div_r').show(); } else { - $('#build_menu_icon_click_url_modal_div_r').hide(); + //$('#build_menu_icon_click_url_modal_div_r').hide(); $('#build_menu_icon_click_url_width_height_modal_div_r').hide(); } }); @@ -977,7 +975,7 @@ let drawingParent = $(value).parents("[id^=build_menu_position]") $(drawingParent).find('[id^=build_menu_icon_click_onoff_modal_div]').hide(); $(drawingParent).find('[id^=build_menu_blankurl_modal_div]').hide(); - $(drawingParent).find('[id^=build_menu_icon_click_url_modal_div]').hide(); + //$(drawingParent).find('[id^=build_menu_icon_click_url_modal_div]').hide(); $(drawingParent).find('[id^=build_menu_icon_click_url_width_height_modal_div]').hide(); $(drawingParent).find('[id^=build_menu_planimetric_floor_modal_div]').hide(); $(drawingParent).find('[id^=build_menu_systemurl_modal_div]').hide(); @@ -989,7 +987,7 @@ $(drawingParent).find('[id^="planimetric_click"]').attr("disabled", false); $(drawingParent).find('[id^=build_menu_icon_click_onoff_modal_div]').show(); if ($(drawingParent).find("[id^=icon_click_url]").prop('checked')) { - $(drawingParent).find('[id^=build_menu_icon_click_url_modal_div]').show(); + //$(drawingParent).find('[id^=build_menu_icon_click_url_modal_div]').show(); $(drawingParent).find('[id^=build_menu_icon_click_url_width_height_modal_div]').show(); } } else if ($(value).val() == 1) { diff --git a/Backend/wwwroot/forgeDemo.html b/Backend/wwwroot/forgeDemo.html index 6bbdccb..ce315e7 100644 --- a/Backend/wwwroot/forgeDemo.html +++ b/Backend/wwwroot/forgeDemo.html @@ -40,7 +40,7 @@ - +
@@ -240,8 +240,13 @@ //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8yMDIyXzEyXzMxLm53ZA'); //雙模式 - launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8yMDIyXzEyXzMxLm53ZA=='); + //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8yMDIyXzEyXzMxLm53ZA=='); + //01.06 樓層刪除燈具 + //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6LW1vZGVsX3Rlc3QxMTIxLyVFMyU4MCU5MCVFNSU4RiVCMCVFNSU4QyU5NyVFNCVCOCVBRCVFOCU4RiVCMSVFNSVBNCVBNyVFNiVBOCU5MyVFMyU4MCU5MUFSQyVFOSU5QiU5OSVFNiVBOCVBMSVFNSVCQyU4RitNRVAlRTYlOEIlODYlRTclQjMlQkIlRTclQjUlQjFfJUU1JTg4JUFBJUU3JTg3JTg4JUU1JTg1JUI3XzIwMjNfMDFfMDYubndk'); + + + launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6LW1vZGVsX3Rlc3QxMTIxLyVFMyU4MCU5MCVFNSU4RiVCMCVFNSU4QyU5NyVFNCVCOCVBRCVFOCU4RiVCMSVFNSVBNCVBNyVFNiVBOCU5MyVFMyU4MCU5MUFSQyVFOSU5QiU5OSVFNiVBOCVBMSVFNSVCQyU4RitNRVAlRTYlOEIlODYlRTclQjMlQkIlRTclQjUlQjFfJUU1JTg4JUFBJUU3JTg3JTg4JUU1JTg1JUI3XzIwMjNfMDFfMDYubndk'); //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwQVJDJUUzJTgwJTkxXzIwMjJfMTJfMTMubndk');//new ARC //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwTUVQJUUzJTgwJTkxXzIwMjJfMTJfMTMubndj');//new MEP @@ -381,6 +386,7 @@ function importDevCor() { ImportDevForCor(); + ImportForgeRoom(); } function ImportDevForCor() {//callback = null @@ -412,9 +418,38 @@ fail: function (xhr, status, error) { } }); - } + function ImportForgeRoom() { + var url = "/DeviceImport/ImportForgeRoom"; + + $.ajax({ + method: "POST", + url: url, + data: JSON.stringify(roomDataList), + cache: false, + async: false, + contentType: "application/json; charset=UTF-8", + dataType: 'json', + success: function (rel) { + if (rel.code != "0000") { + if (rel.code == "9999") { + console.log(rel.msg); + } + else { + console.log(rel.msg); + } + return; + } + else { + console.log(rel.msg); + return; + } + }, + fail: function (xhr, status, error) { + } + }); + } diff --git a/Backend/wwwroot/js/forge/ForgeDemo.js b/Backend/wwwroot/js/forge/ForgeDemo.js index de1db6d..8032001 100644 --- a/Backend/wwwroot/js/forge/ForgeDemo.js +++ b/Backend/wwwroot/js/forge/ForgeDemo.js @@ -13,7 +13,8 @@ var levels;//剖面用 var baseApiUrl = "http://localhost:3604"; var instanceTree; //var objSendData = { Data: null }; -var tagIdDevList = []; +var tagIdDevList = [];//模型設備List: device_number、device_coordinate_3d、forge_dbid +var roomDataList = [];//模型房間List: room_id、room_name function launchViewer(urn) { var av = Autodesk.Viewing; @@ -274,39 +275,36 @@ function onDocumentLoadSuccess(doc) { e.properties.forEach(function (item) { if (item.displayName == "【tag_id】") { // Tag_name tag_id 【tag_id】 if (item.displayValue != "") { - //if ((item.displayValue).indexOf('TPE_B1_ME_M10') > -1) { - console.log("--------------------------------------------------"); - console.log("Tag_name dbid: " + e.dbId); - console.log("value: " + item.displayValue); - - //myDataList.forEach((myData, index) => { - // devices.push({ id: index, position: JSON.parse(myData.device_coordinate_3d), sensorTypes: ["temperature", "humidity"] }); - //}); - //} - - let bounds = new THREE.Box3(); + ////if ((item.displayValue).indexOf('TPE_B1_LT_L1') > -1) {// TPE_B1_ME_M10 + //console.log("--------------------------------------------------"); + //console.log("Tag_name dbid: " + e.dbId); + //console.log("value: " + item.displayValue); + ////} + var str = item.displayValue.split('_'); + if (str.length == 2) { //兩段為房間 ex: U7F_01 + roomDataList.push({ room_id: e.dbId, room_name: item.displayValue }); + } + else if (str.length == 8) { //八段為設備 ex: TPE_B1_ME_M10_U7F_NA_FCU_N1 + //取得座標 + 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 ((item.displayValue).indexOf('TPE_B1_LT_L1') > -1) { + //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 }); + } - instanceTree.enumNodeFragments(e.dbId, (fragId) => { - let box = new THREE.Box3(); - fragList.getWorldBounds(fragId, box); - bounds.union(box); - }, true); - var position = bounds.center(); - //if ((item.displayValue).indexOf('TPE_B1_ME_M10') > -1) { - console.log("position: (" + (position.x).toFixed(2) + ", " + (position.y).toFixed(2) + ", " + (position.z).toFixed(2) + ")"); - 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 }); - console.log("--------------------------------------------------"); - //} } - //getFragmentWorldMatrixByNodeId(e.dbId, viewer); - //let fragProxy = viewer.impl.getFragmentProxy(viewer.model, frag); - } }); - }) - }) //---------------------- end --------------------------------------------------- @@ -792,8 +790,6 @@ function setElevatorSpeed(speed) { //0.01 ~ 1 } function movElevator() { - - let tree = viewer.model.getData().instanceTree;//三組:(749,750,751),(755,756,757),(761,762,763) let nodeId = 12112;//12104; //749; //10952; let nodeId2 = 12111;//12105; //750; @@ -908,64 +904,6 @@ function hideColor(nodeId) {//顏色改成透明 viewer.setThemingColor(nodeId, color); } -//function movElevator() { - - -// let tree = viewer.model.getData().instanceTree; -// let nodeId = 750;// 10952; -// let fragProxyZ = 0; -// var movStatus = 0; // 0=no 1=up 2=down - - -// if (fragProxy.position.z > targetFloorZ) { -// movStatus = 2 -// } -// else if (fragProxy.position.z < targetFloorZ) { -// movStatus = 1 -// } - -// if (movStatus == 0) { -// return; -// } - -// tree.enumNodeFragments(nodeId, function (frag) { -// fragProxy = viewer.impl.getFragmentProxy(viewer.model, frag); -// fragProxy.getAnimTransform(); -// //let fragPosition = new THREE.Vector3(0, 0, 15);// 一樓0 二樓15 三樓 26 -// if (movStatus == 2) { -// fragProxy.position.z -= elevatorSpeed; -// } -// else if (movStatus == 1) { -// fragProxy.position.z += elevatorSpeed; -// } - -// fragProxyZ = fragProxy.position.z; -// fragProxy.updateAnimTransform() - -// }); -// viewer.impl.sceneUpdated(true); - -// if (movStatus == 2) { -// if (fragProxyZ >= targetFloorZ) { -// requestAnimationFrame(movElevator); -// } -// } -// else if (movStatus == 1) { -// if (fragProxyZ <= targetFloorZ) { -// requestAnimationFrame(movElevator); -// } -// } - - -// //let fragPosition = new THREE.Vector3(position);// 一樓0 二樓15 三樓 26 - -// //fragProxy.position = fragPosition; - -// //fragProxy.updateAnimTransform(); - -// //viewer.impl.sceneUpdated(true); -//} - function getAllDbIds(viewer) { var instanceTree = viewer.model.getData().instanceTree; @@ -1025,10 +963,6 @@ function onButtonClicked() { this.viewer.setCutPlanes([upperCutPlaneParam, lowerCutPlaneParam]); } -function displayCuttedPlane() { - -} - /** * Autodesk.Viewing.Document.load() failuire callback. */ @@ -1082,27 +1016,7 @@ async function loadHeatmaps(model) { position: { x: 6.98, y: -2.24, z: 16.86 }, // x: 0, y: 25.03, z: -2.52 (-4.93, -3.85, 16.86) sensorTypes: ["temperature", "humidity"] } - - //{ - // id: "Oficina 5", - // //name: "Oficina-", - // position: { x: 3.35, y: -4.81, z: 12.88 }, // x: 0, y: 25, z: -2.5 (3.35, -4.81, 12.88 - // sensorTypes: ["temperature", "humidity"] - //}, - //{ - // id: "Oficina 4", - // //name: "Oficina-", - // position: { x: 37.03, y: -4.81, z: 12.88 }, // x: 0, y: 25.03, z: -2.52 (37.03, -4.81, 12.88) - // sensorTypes: ["temperature", "humidity"] - //}, - //{ - // id: "Oficina 3", - // //name: "Oficina-", - // position: { x: 2.83, y: -22.60, z: 12.88 }, // x: 0, y: 25.03, z: -2.52 (2.83, -22.60, 12.88) - // sensorTypes: ["temperature", "humidity"] - //} ]; - //冷氣N5: (6.98, -19.00, 16.86), N4: (35.85, -2.24, 16.86), N3: (6.98, -2.24, 16.86) // Initialize sensor values let sensorVals = []; @@ -1228,11 +1142,6 @@ async function loadHeatmap() { function hideObject() { //viewer.hide(4); - //viewer.hide(58); - //viewer.hide(613); - //viewer.hide(640); - //viewer.hide(560); - for (var i = 0; i < allDbIdsStr.length; i++) { viewer.hide(parseInt(allDbIdsStr[i])); } @@ -1240,11 +1149,6 @@ function hideObject() { function openObject() { //viewer.show(4); - //viewer.show(58); - //viewer.show(613); - //viewer.show(640); - //viewer.show(560); - for (var i = 0; i < allDbIdsStr.length; i++) { viewer.show(parseInt(allDbIdsStr[i])); } @@ -1252,67 +1156,11 @@ function openObject() { async function setObjectTransparent() { //setTransparency(4, 0); - //setTransparency(58, 0); - //setTransparency(613, 0); - //setTransparency(640, 0); - //setTransparency(560, 0); - //setTransparency(parseInt(515), 0); - - //for (var i = 0; i < allDbIdsStr.length; i++) { - // setTransparency(parseInt(allDbIdsStr[i]), 0); - //} - - //setTransparency(parseInt(515), 0); - //setTransparency(parseInt(516), 0); - //setTransparency(parseInt(517), 0); - //setTransparency(parseInt(518), 0); - //setTransparency(parseInt(519), 0); - //setTransparency(parseInt(399), 0); - //setTransparency(parseInt(101), 0); - //setTransparency(parseInt(100), 0); - //setTransparency(parseInt(58), 0); - - //setTransparency(parseInt(587), 0); - //setTransparency(parseInt(586), 0); - //setTransparency(parseInt(585), 0); - //setTransparency(parseInt(584), 0); - //setTransparency(parseInt(583), 0); - //setTransparency(parseInt(562), 0); - //setTransparency(parseInt(361), 0); - - //test(); - //hideColor(587); - //hideColor(586); - //hideColor(585); - //hideColor(584); - //hideColor(583); - //hideColor(562); - //hideColor(361); - setTransparentBuilding(); - } async function cancelObjectTransparent() { //setTransparency(4, 1); - //setTransparency(58, 1); - //setTransparency(613, 1); - //setTransparency(640, 1); - //setTransparency(560, 1); - //for (var i = 0; i < allDbIdsStr.length; i++) { - // setTransparency(parseInt(allDbIdsStr[i]), 1); - //} - - //setTransparency(515, 0.2); - //setTransparency(516, 0.2); - //setTransparency(517, 0.2); - //setTransparency(518, 0.2); - //setTransparency(519, 0.2); - //setTransparency(399, 0.2); - //setTransparency(101, 0.2); - //setTransparency(100, 0.2); - //setTransparency(58, 0.2); - recoverTransparentBuilding(); } @@ -1348,7 +1196,6 @@ async function test() { } - //------------ 剖面 ---------------------- async function getRemoteLevels() { const aecData = await Autodesk.Viewing.Document.getAecModelData(this.viewer.model.getDocumentNode()); @@ -1364,26 +1211,6 @@ async function getLevelsData() { this.levels = data; } -//function getCutPlaneParam(idx, n) { -// if (idx < 0 || !n) return; - -// const level = this.levels[idx]; -// if (!level) return; - -// //const precision = Autodesk.Viewing.Private.calculatePrecision( level.elevation ); -// const model = this.viewer.model; -// const globalOffset = model.getData().globalOffset; -// const units = model.getUnitString(); -// const elevRaw = Autodesk.Viewing.Private.convertUnits('ft', units, 1, level.elevation); - -// let d = elevRaw - globalOffset.z - 0.5; -// if (n == 1) -// d = -1 * d; - -// return new THREE.Vector4(0, 0, n, d); -//} - - function profile() { const upperIdx = 6; const upperCutPlaneParam = this.getCutPlaneParam(upperIdx, 1); @@ -1393,71 +1220,3 @@ function profile() { } //----------------- end ----------------------------------------------- -// 設備的dbid和3D座標 存進 資料庫 -//function ImportDevForCor() {//callback = null -// var url = "/DeviceImport/ImportDevForCor"; -// //let sendData = { -// // "device_number": pageAct.AreaTag, -// // "device_coordinate_3d": "", -// // "device_dbid": "", -// //}; -// objSendData.Data = tagIdDevList; -// //ytAjax = new YourTeam.Ajax(url, objSendData, function (res) { -// // if (!res || res.code != "0000" || !res.data) { - -// // } else { - -// // } -// //}, null, "POST").send(); - -// //$.post(url, objSendData, function (rel) { -// // if (rel.code != "0000") { -// // if (rel.code == "9999") { -// // toast_error(rel.msg); -// // } -// // else { -// // toast_warning(rel.msg); -// // } -// // return; -// // } -// // else { -// // toast_ok(rel.msg); -// // //ReloadRawDataCheckTable(); -// // } - -// //}, 'json'); - -// //headers={'content-type': 'application/json'} - -// $.ajax({ -// type: "POST", -// url: url, -// data: objSendData, -// cache: false, -// contentType: 'application/json', -// processData: false, -// success: function (rel) { -// //$("#save-building-btn").html('確定').attr("disabled", false); -// if (rel.code != "0000") { -// if (rel.code == "9999") { -// toast_error(rel.msg); -// } -// else { -// toast_warning(rel.msg); -// } -// return; -// } -// else { -// toast_ok(rel.msg); -// //buildInfoTable.ajax.reload(null, false); -// //$('#build-modal').modal('hide'); -// return; -// } -// }, -// fail: function (xhr, status, error) { -// //$("#save-building-btn").html('確定').attr("disabled", false); -// //toast_error(rel.msg); -// } -// }); - -//} \ No newline at end of file diff --git a/Frontend/Web.config b/Frontend/Web.config new file mode 100644 index 0000000..44aa1d6 --- /dev/null +++ b/Frontend/Web.config @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/Frontend/_dashboard.html b/Frontend/_dashboard.html index 473449a..5d5460b 100644 --- a/Frontend/_dashboard.html +++ b/Frontend/_dashboard.html @@ -161,27 +161,16 @@
-
+
-
+

異常狀態

-
-
- +
+
@@ -193,34 +182,20 @@
-
+

工單進度

-
-
- +
+
+
- 已完成
6
- - 未完成
8
+
- 未派工
5
- - 派工中
9
+
@@ -244,6 +219,8 @@ var timeOuters = []; var eveDayElecChart = null; var eveWeekElecChart = null; + var worOrdErrChart = null; + var worOrdFinChart = null; var errRecChart = null; var errChkChart = null; var loadedCnt = 0; @@ -262,6 +239,11 @@ { mainSys: "FE", subSys: "F2", iconClass: "fal fa-smog" }, { mainSys: "WP", subSys: "W1", iconClass: "fal fa-stopwatch" }, { mainSys: "S", subSys: "R", iconClass: "fal fa-user-shield" }, + { mainSys: "LT", subSys: "L2", iconClass: "fal fa-sun"}, + { mainSys: "ME", subSys: "M1", iconClass: "fal fa-icicles"}, + { mainSys: "ME", subSys: "M8", iconClass: "fal fa-bong"}, + { mainSys: "W3", subSys: "W1", iconClass: "fal fa-tint"}, + ]; var tempSysSubText = [ @@ -270,12 +252,16 @@ { text: "緊急發電機", mainSys: "EE", subSys: "E3", }, { text: "電錶系統", mainSys: "EE", subSys: "E4", }, { text: "二線式照明系統", mainSys: "LT", subSys: "L1", }, + { text: "景觀照明系統", mainSys: "LT", subSys: "L2", }, + { text: "儲冰系統", mainSys: "ME", subSys: "M1", }, { text: "小型送風機", mainSys: "ME", subSys: "M10", }, + { text: "排油煙設備", mainSys: "ME", subSys: "M8", }, { text: "環境感測設備", mainSys: "ME", subSys: "M12", }, { text: "電梯設備", mainSys: "ELEV", subSys: "EL", }, { text: "消防設備", mainSys: "FE", subSys: "F1", }, { text: "排煙系統", mainSys: "FE", subSys: "F2", }, { text: "電子水錶", mainSys: "WP", subSys: "W1", }, + { text: "熱水系統", mainSys: "W3", subSys: "W1", }, { text: "門禁安全系統", mainSys: "S", subSys: "R", } ]; @@ -291,7 +277,7 @@ let strHtml = ``; $.each(tempSysSubText, (idx, obj) => { - if (isExiNames.indexOf(obj.text) == -1 && $("#sysSubBtnList .dev-group").length < 12) { + if (isExiNames.indexOf(obj.text) == -1 && $("#sysSubBtnList .dev-group").length < 16) { let iconObj = sysIconList.filter(x => x.mainSys == obj.mainSys && x.subSys == obj.subSys)[0]; strHtml = `
@@ -408,14 +394,14 @@ // 本週與上週用電量 (每天) getElectricMeterDayDataByBaja(devNum + "_KWH", n4Sup, prevTwoWeek, tomorrow, (data) => { let curDay = (new Date()).getDay() == 0 ? 7 : (new Date()).getDay(); - let curWeekData = data.data.filter(x => strToDate(displayDate(new Date(), "date"), null, 0 - (curDay - 1)) <= strToDate(x.timestamp.$cEncStr)); - let prevWeekData = data.data.filter(x => strToDate(displayDate(new Date(), "date"), null, 0 - 7 - (curDay - 1)) <= strToDate(x.timestamp.$cEncStr) && strToDate(new Date(), null, 0 - 7) >= strToDate(x.timestamp.$cEncStr)); - + let curWeekData = data.data.filter(x => strToDate(displayDate(new Date(), "date"), null, 1 - 7) <= strToDate(x.timestamp.$cEncStr)); + let prevWeekData = data.data.filter(x => strToDate(displayDate(new Date(), "date"), null, 1 - 14) <= strToDate(x.timestamp.$cEncStr) && strToDate(new Date(), null, 1 - 7) >= strToDate(x.timestamp.$cEncStr)); + debugger chartEveWeeksElec(curWeekData, prevWeekData) chkBajaLoaded(); }) - // 異常數量與賦歸數量 + // 異常數量與復歸數量 getAlarmCountByBaja((aData) => { chartDataCnt.alarmCnt = aData.count; chkBajaLoaded(); @@ -424,7 +410,7 @@ chartDataCnt.recCnt = rData.count; chkBajaLoaded(); }) - // 異常數量與賦歸數量 + // 異常數量與復歸數量 getCheckedAckedCountByBaja((data) => { chartDataCnt.chkedErrCnt = data.count; chkBajaLoaded(); @@ -440,8 +426,10 @@ loadedCnt++; if (loadedCnt == 9) { - chartErrRec(["異常數量", "賦歸數量"], [chartDataCnt.alarmCnt, chartDataCnt.recCnt]); + chartErrRec(["異常數量", "復歸數量"], [chartDataCnt.alarmCnt, chartDataCnt.recCnt]); chartErrChk(["已確認異常", "未確認異常"], [chartDataCnt.chkedErrCnt, chartDataCnt.unChkedErrCnt]); + chartWorOrdErr(); + chartWorOrdFin(); endPageLoading(); } @@ -628,7 +616,7 @@ } } - // 圖表 - 異常與賦歸圖表 (圓餅圖) + // 圖表 - 異常與復歸圖表 (圓餅圖) function chartErrRec(labels, datas) { let errRecChartCanvas = ctx = $('#errRecChart').get(0).getContext('2d'); @@ -720,6 +708,101 @@ } + // 圖表 - 異常未派工與異常已派工 (圓環圖) + function chartWorOrdErr(labels, datas) { + labels = ["異常未派工", "異常已派工"] + datas = [5, 9] + let worOrdErrChartCanvas = ctx = $('#worOrdErrChart').get(0).getContext('2d'); + + let worOrdErrChartData = { + labels: labels, + datasets: [ + { + label: '數量', + unit: '個', + fill: true, + backgroundColor: [color.danger._500, color.info._300], + //data: worOrdErrArr.map(x => parseInt((Math.random() * (1500 - 300) + 300))), + data: datas, + } + ] + } + + let worOrdErrChartOptions = { + //maintainAspectRatio: false, + responsive: true, + legend: { + display: true, + }, + tooltips: { + enabled: true, + }, + + + } + + if (worOrdErrChart == null) { + worOrdErrChart = new Chart(worOrdErrChartCanvas, { + type: "doughnut", + data: worOrdErrChartData, + options: worOrdErrChartOptions + }) + } else { + worOrdErrChart.data.datasets.forEach((dataset) => { + dataset.data = datas; + }); + } + + } + + // 圖表 - 工單已完成與工單未完成 (圓環圖) + function chartWorOrdFin(labels, datas) { + labels = ["工單已完成","工單未完成"] + datas = [5,9] + let worOrdFinChartCanvas = ctx = $('#worOrdFinChart').get(0).getContext('2d'); + + let worOrdFinChartData = { + labels: labels, + datasets: [ + { + label: '數量', + unit: '個', + fill: true, + backgroundColor: [color.danger._500, color.info._300], + //data: worOrdFinArr.map(x => parseInt((Math.random() * (1500 - 300) + 300))), + data: datas, + } + ] + } + + let worOrdFinChartOptions = { + //maintainAspectRatio: false, + responsive: true, + legend: { + display: true, + }, + tooltips: { + enabled: true, + }, + + + } + + if (worOrdFinChart == null) { + worOrdFinChart = new Chart(worOrdFinChartCanvas, { + type: "doughnut", + data: worOrdFinChartData, + options: worOrdFinChartOptions + }) + } else { + worOrdFinChart.data.datasets.forEach((dataset) => { + dataset.data = datas; + }); + } + + } + + // 從 baja 訂閱 左下角各系統小類異常狀態 function getAlarmSub(data) { $.each(data.data, (idx, alaObj) => { diff --git a/Frontend/_sysMonAll.html b/Frontend/_sysMonAll.html index 4bab82c..c8ef609 100644 --- a/Frontend/_sysMonAll.html +++ b/Frontend/_sysMonAll.html @@ -38,14 +38,17 @@ var allDevList = []; //全設備清單 var subDeviceData = []; var heatMap = null; + var buildMenuData = {}; $(function () { getBuildMenu((arr, data) => { + buildMenuData = data; if (arr.indexOf(4) != -1) { - getFloDevList(); + getFloDevList(arr[0] == 4 ? "left" :"right"); setLightColor(); } if (arr.indexOf(3) != -1) { + getLightPoint(); getHotspotPoint(() => { show3DModel(data.urn_3D); }); @@ -72,7 +75,10 @@
`; break; case 3: - strHtml = `
`; + strHtml = `
+ ${setTopHeatBar()} +
+
`; break; } @@ -90,6 +96,7 @@ } 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; @@ -127,18 +134,35 @@ } 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"); } - + setLightColor(); setForgeHotSpotColor(matchDevice); + lightDevForgeSpotLig(matchDevice) + // 從設備訂閱更新每個設備卡片即時點位 + setDevItemPoiValBySub(data); }); myBaja.setSubscribeDeviceEndCallBack(function (data) { - endPageLoading(); }); } + function lightDevForgeSpotLig(devObj) { + + + } + + // 從設備訂閱更新每個設備卡片即時點位 + function setDevItemPoiValBySub(data) { + + let pointSpan = $(`.card.device-wrap[data-number=${data.device_number_full}] span[name=devItemPoiVal]`); + if (pointSpan && pointSpan.data("point") == data.point_name) { + console.log(data) + pointSpan.text(data.value); + } + } + function setLightColor() { $("[data-light-type]").each((index, ele) => { let type = $(ele).data("light-type"); @@ -192,6 +216,12 @@ return strHtml; } + // 設置 Forge 3D 溫度條 + function setTopHeatBar() { + let strHtml = ``; + return strHtml; + } + // forge 3D 異常點位變紅色 function setForgeHotSpotColor(device) { let subData = subDeviceData.filter(x => x.device_number == device.device_number)[0] @@ -200,8 +230,17 @@ } } + // 取得昇位圖點位 (deviceItem) + function getRiserPoiObj() { + let tarDevItem = pageAct.devItems?.filter(x => x.is_show_riserDiagram == 1); + if (tarDevItem && tarDevItem[0]) { + return tarDevItem[0]; + } + return null; + } + // 取得設備列表 並繪製卡片 - function getFloDevList() { + function getFloDevList(position = "left") { let url = baseApiUrl + "/api/Device/GetDeviceList"; let sendData = { sub_system_tag: pageAct.sysSubTag, @@ -220,8 +259,8 @@ strHtml += `
` $.each(floObj.device_list, (index2, devObj) => { allDevList.push(devObj); - - strHtml += `
+ let devItem = getRiserPoiObj(); + strHtml += `
@@ -233,7 +272,7 @@
- 即時功率: + ${devItem?.full_name}:${devItem?.unit} 詳細資料
@@ -295,19 +334,27 @@ // Card 即時狀態 function drawStateTabBlo(devNum) { let devPath = devNum.replaceAll("_", "/"); - let strHtml = `
- + let position = $(`.card.device-wrap[data-number=${devNum}]`).data("position"); + 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 = `
+
` return strHtml; } + function iframeResize(obj) { obj.style.height = obj.contentWindow.document.documentElement.scrollHeight + 'px'; } + function show3DModel(urn) { $(loadEle).Loading("start"); + getLightData(allDevList); launchViewerForHotspot(urn, (viewer, nodeIds) => { + showHeat("[name=forgeHeatBar]"); let devDbIds = allDevList.map(x => x.forge_dbid); /*hideAllObjects(devDbIds);*/ + setTransparentBuilding(0, devDbIds); $(loadEle).Loading("close"); @@ -416,11 +463,49 @@ } + 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 = []) { + console.log(myDataList) + getLightData(myDataList); + } + var parentEle = ""; onEvent("autodesk:click:sprite", "[name=forgeViewer]", function (e, obj) { forgeUnFocusAll(); diff --git a/Frontend/_systemMonitor.html b/Frontend/_systemMonitor.html index 00e74ad..79ff8b6 100644 --- a/Frontend/_systemMonitor.html +++ b/Frontend/_systemMonitor.html @@ -1,8 +1,4 @@ - +
diff --git a/Frontend/css/site.css b/Frontend/css/site.css index c88262d..a878acc 100644 --- a/Frontend/css/site.css +++ b/Frontend/css/site.css @@ -10,7 +10,7 @@ label[id$='-error'].error { color: var(--yt-red-2); } -[id^=yt_tooltip] { min-width: 650px !important; } +/*[id^=yt_tooltip] { min-width: 650px !important; }*/ .circle-light { display: inline-block; width: 25px; height: 25px; border-radius: 50px; } @@ -89,8 +89,25 @@ input:-webkit-autofill { background-color: rgba(0, 0, 0, 0.15) !important; } .yt-navbar-content ul li a:active, .yt-navbar-content ul li a.active { background-color: var(--theme-fusion-500); } .card-header.p-3.ui-draggable-handle:hover { cursor: move; } -@media screen and (max-width: 576px) { - .yt-left-navbar { width: 100%; max-width: 100%; margin-top: 0; } + +.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%;} + +/*a[data-tabname="topFunBtn"] { color: #fff } + +a[data-tabname="topFunBtn"].active { color: #886ab5 } +a[data-tabname="topFunBtn"]:hover { color: var(--theme-primary-50); } + +.userblock { + color:#fff; +} +.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: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; } +@media screen and (max-width: 576px) { .yt-left-navbar { width: 100%; max-width: 100%; margin-top: 0; } } @keyframes lds-ring { diff --git a/Frontend/forgetTest2.html b/Frontend/forgetTest2.html index 7eda69e..a937a3c 100644 --- a/Frontend/forgetTest2.html +++ b/Frontend/forgetTest2.html @@ -51,6 +51,7 @@
+
@@ -244,7 +245,7 @@ //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6LW1pdHN1YmlzaGkvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU5JUExJUFGXzEyMjgubndk'); //12.30 整棟樓 ARC + MEP - launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8xMl8zMC5ud2Q'); + //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8xMl8zMC5ud2Q'); //12.30 整棟樓 ARC + MEP 半透明 //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8lRTUlOEQlOEElRTklODAlOEYlRTYlOTglOEUlRTUlQkIlQkElRTclQUYlODlfMTJfMzAubndk'); @@ -254,8 +255,11 @@ //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwTUVQJUUzJTgwJTkxXzIwMjJfMTJfMTMubndj');//new MEP //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwQVJDJUUzJTgwJTkxJUU1JTg1JUE4JUU2JUEzJTlGXzIwMjJfMTJfMTMubndj');//全棟 ARC - + //01.06 加上room_id(樓層有燈具) + //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8yMDIzXzAxXzA2Lm53ZA'); + //01.06 樓層刪除燈具 + launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6LW1vZGVsX3Rlc3QxMTIxLyVFMyU4MCU5MCVFNSU4RiVCMCVFNSU4QyU5NyVFNCVCOCVBRCVFOCU4RiVCMSVFNSVBNCVBNyVFNiVBOCU5MyVFMyU4MCU5MUFSQyVFOSU5QiU5OSVFNiVBOCVBMSVFNSVCQyU4RitNRVAlRTYlOEIlODYlRTclQjMlQkIlRTclQjUlQjFfJUU1JTg4JUFBJUU3JTg3JTg4JUU1JTg1JUI3XzIwMjNfMDFfMDYubndk'); }); //function move1Floor() { @@ -412,6 +416,10 @@ createHeatmapRect(labels, colorStops); } + function showList() { + consoleList(); + } + function createHeatmapRect(labels, colorStops) { if (!this.canvas) { return; @@ -438,7 +446,7 @@ context.fillRect(10, 20, 280, 20); } - + diff --git a/Frontend/index.html b/Frontend/index.html index 95f51a5..f3eeba6 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -180,7 +180,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
-
+
${drawStateTabBlo(devNum)}
@@ -1106,18 +1145,27 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li } $(tooltipEle).draggable({ cursor: "move", - handle: ".card-header" // 只能通过卡片的标题栏拖拽 + handle: ".card-header", // 只能通过卡片的标题栏拖拽 + containment: "document", + scroll: true }); $(tooltipEle).resizable({ resize: function (event,ui) { let iframe = $(ui.element).find("iframe"); if (iframe.length != 0) { - //let cardBodyHei = $(ui.element).find(".card-body").css("height"); - //if (cardBodyHei) { - // $(iframe).css("height", cardBodyHei); - //} + 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, }); typeof subDeviceSetTable != "undefined" ? subDeviceSetTable($(oriEle).data("number")) : "" }, @@ -1172,7 +1220,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li ]; - opeRecTable = new YourTeam.JqDataTables.getTableByAjax(url, tag, null, columns, column_defs, null, null, null, null, null, null, "tpi"); + opeRecTable = new YourTeam.JqDataTables.getTableByAjax(url, tag, null, columns, column_defs, null, null, null, null, null, null, "<'scrolledTable'tpi>"); } function loadLightSchTable(devGuid) { @@ -1294,7 +1342,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li let json_object = JSON.parse(result); datas = json_object['data']; - errRecTable = new YourTeam.JqDataTables.getTableByStatic(tag, datas, columns, column_defs, null, null, null, null, "tpi"); + errRecTable = new YourTeam.JqDataTables.getTableByStatic(tag, datas, columns, column_defs, null, null, null, null, "<'scrolledTable'tpi>"); } @@ -1350,6 +1398,30 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li $(loadEle).Loading("close"); } + function setSysTagForPageAct(obj) { + pageAct.sysMainTag = $(obj).data("subSysObj").main_system_tag; + pageAct.sysSubTag = $(obj).data("subSysObj").sub_system_tag; + pageAct.sysSubName = $(obj).data("subSysObj").full_name; + pageAct.sysSubObj = $(obj).data("subSysObj"); + getDevItem(); + } + + function getDevItem() { + let url = baseApiUrl + "/api/Device/GetDeviceItem"; + + objSendData.Data = { + main_system_tag: pageAct.sysMainTag, + sub_system_tag: pageAct.sysSubTag, + } + ytAjax = new YourTeam.Ajax(url, objSendData, function (res) { + if (!res || res.code != "0000" || !res.data) { + + } else { + pageAct.devItems = res.data; + } + }, null, "POST").send(); + } + function alarmIconBlink(data) { if (data?.data.length != 0) { $(".page-header [name=topFunBtn][data-page=alert] i").addClass("blink"); @@ -1411,7 +1483,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li } else { let strHtml = `