From f1f366aae8980943756a4eabcbba31ea756e4a83 Mon Sep 17 00:00:00 2001 From: dev01 Date: Wed, 7 Jun 2023 17:12:22 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E5=8F=B0][=E7=B7=8A=E6=80=A5?= =?UTF-8?q?=E6=87=89=E8=AE=8A]=20=E7=A1=AC=E9=AB=94=E6=B8=85=E5=96=AE?= =?UTF-8?q?=E9=81=B8=E5=96=AE=E5=A2=9E=E5=8A=A0=20|=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=A1=AC=E9=AB=94=E6=B8=85=E5=96=AE=E6=AC=8A=E9=99=90=20|=20?= =?UTF-8?q?=E7=A1=AC=E9=AB=94=E6=B8=85=E5=96=AE=E5=89=8D=E7=AB=AF=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=8F=8A=E4=BB=8B=E9=9D=A2=E8=AA=BF=E6=95=B4=20|=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=B8=85=E5=96=AE=E5=89=8D=E7=AB=AF=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=8F=8A=E4=BB=8B=E9=9D=A2=E8=AA=BF=E6=95=B4=20|=20?= =?UTF-8?q?=E5=B7=A6=E9=82=8A=E9=81=B8=E5=96=AE=E9=A0=86=E5=BA=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../18991846-0586-4710-9178-593c7ba336d3.svg | 1393 ++++++++++++ .../EmergencyHardwareMenuController.cs | 24 + .../Views/EmergencyContact/Index.cshtml | 2 +- .../Views/EmergencyDeviceMenu/Index.cshtml | 307 +-- .../Views/EmergencyHardwareMenu/Index.cshtml | 1950 +++++++++++++++++ .../Views/EmergencyRecord/Index.cshtml | 2 +- FrontendWebApi/Views/RescueDevice/AED.cshtml | 2 +- .../RescueDevice/FireExtinguisher.cshtml | 2 +- FrontendWebApi/Views/Shared/_Layout.cshtml | 20 +- FrontendWebApi/appsettings.Development.json | 4 +- FrontendWebApi/appsettings.json | 5 +- 11 files changed, 3564 insertions(+), 147 deletions(-) create mode 100644 Backend/wwwroot/upload/floor_map/18991846-0586-4710-9178-593c7ba336d3.svg create mode 100644 FrontendWebApi/Controllers/EmergencyHardwareMenuController.cs create mode 100644 FrontendWebApi/Views/EmergencyHardwareMenu/Index.cshtml diff --git a/Backend/wwwroot/upload/floor_map/18991846-0586-4710-9178-593c7ba336d3.svg b/Backend/wwwroot/upload/floor_map/18991846-0586-4710-9178-593c7ba336d3.svg new file mode 100644 index 0000000..34d11ed --- /dev/null +++ b/Backend/wwwroot/upload/floor_map/18991846-0586-4710-9178-593c7ba336d3.svg @@ -0,0 +1,1393 @@ + + + + diff --git a/FrontendWebApi/Controllers/EmergencyHardwareMenuController.cs b/FrontendWebApi/Controllers/EmergencyHardwareMenuController.cs new file mode 100644 index 0000000..6136b1c --- /dev/null +++ b/FrontendWebApi/Controllers/EmergencyHardwareMenuController.cs @@ -0,0 +1,24 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace FrontendWebApi.Controllers +{ + public class EmergencyHardwareMenuController : MyBaseController + { + private readonly ILogger _logger; + + public EmergencyHardwareMenuController(ILogger logger) + { + _logger = logger; + } + + public IActionResult Index() + { + return View(); + } + } +} diff --git a/FrontendWebApi/Views/EmergencyContact/Index.cshtml b/FrontendWebApi/Views/EmergencyContact/Index.cshtml index c7e06aa..0a05b26 100644 --- a/FrontendWebApi/Views/EmergencyContact/Index.cshtml +++ b/FrontendWebApi/Views/EmergencyContact/Index.cshtml @@ -1,6 +1,6 @@ @{ ViewData["MainNum"] = "4"; - ViewData["SubNum"] = "2"; + ViewData["SubNum"] = "3"; ViewData["Title"] = "聯絡清單"; } diff --git a/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml b/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml index 9aa1481..2f8519a 100644 --- a/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml +++ b/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml @@ -15,23 +15,28 @@
-
+ @*
顯示類型
-
+
*@
防災類別
-
防災類別
+
防災類別 + +
+
+ +
-
棟別
+
棟別
棟別
-
+ @*
樓層
棟別
@@ -42,7 +47,7 @@
設備小類
設備大類
-
+
*@
@@ -322,7 +327,7 @@ temp_alarm_device = []; //暫存所有的報警設備 var backfill_building_device_amount = [], backfill_layer2_device_amount = [], backfill_layer3_device_amount = []; var backfill_building_alarm_device_amount = [], backfill_layer2_alarm_device_amount = [], backfill_layer3_alarm_device_amount = []; - var select_all_disaster = false, select_all_floor = false, + var select_all_disaster = false, select_all_floor = false,select_all_building = false, select_all_layer2 = false, select_all_layer3 = false; var changeBuilding = ""; @@ -340,7 +345,7 @@ var SelectedFilter = { disasters: [], - building_tag: '', + building_tag: [], floor_guids: [], layer2: [], layer3: [] @@ -890,7 +895,7 @@ SelectedFilter.disasters.push(disaster); $(e).removeClass('btn-outline-success').addClass('btn-success'); } - + is_need_reload = true; ChangeFilterBuilding(); UpdateDeviceAmount(); @@ -925,11 +930,11 @@
`;*@ html += `
- - + +
`; }); - + $('#building').append(``); $('#building').append(html); $('#building').find('div').first().click(); @@ -940,6 +945,7 @@ html += ''; }); + $('#building').append(``); $('#building').append(html); $('#building').find('button').first().click(); @@ -948,51 +954,71 @@ } //#endregion + //#region 計算現有勾選棟別 + function resetCalSelectBuilding(){ + SelectedFilter.building_tag = []; + $('#building').find('button.btn-success').each((index,ele) => { + let ele_building_tag = $(ele).data("tag"); + if(SelectedFilter.building_tag.indexOf(ele_building_tag) == -1){ + SelectedFilter.building_tag.push(ele_building_tag); + } + }) + console.log(SelectedFilter.building_tag) + } + //#endregion + //#region 選擇棟別 function SelectBuilding(building_tag, e) { - $('#building').find('button').removeClass('btn-success').addClass('btn-secondary') + //$('#building').find('button').removeClass('btn-success').addClass('btn-secondary') - SelectedFilter.building_tag = building_tag; + if (show_mode == 'alarm') { - $(e).find('button').addClass('btn-success'); + if($(e).find("button.btn-success").length > 0){ + $(e).find('button').removeClass('btn-success').addClass('btn-secondary'); + } else { + $(e).find('button').removeClass('btn-secondary').addClass('btn-success'); + } } else { $(e).addClass('btn-success'); } + resetCalSelectBuilding(); + is_need_reload = true; ChangeFilterFloor(); UpdateDeviceAmount(); + ResetDeviceTable(); @*console.log("SelectedFilter", SelectedFilter);*@ } //#endregion //#region 修改過濾條件(樓層) function ChangeFilterFloor() { - temp_all_floor = []; - all_device_group.forEach(function (disaster, disaster_index) { - if (SelectedFilter.disasters.findIndex(x => x == disaster.value) > -1) { //抓取已選擇的防災類型的棟別內容 - disaster.groupBuildings.forEach(function (building, building_index) { - if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層 - building.groupFloors.forEach(function (floor, floor_index) { - if (temp_all_floor.findIndex(x => x.name == floor.name) < 0) { //表示未加入,需加入 - temp_all_floor.push(floor); - } - }); - } - }); - } - }); + //temp_all_floor = []; + //all_device_group.forEach(function (disaster, disaster_index) { + // if (SelectedFilter.disasters.findIndex(x => x == disaster.value) > -1) { //抓取已選擇的防災類型的棟別內容 + // disaster.groupBuildings.forEach(function (building, building_index) { + // if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層 + // building.groupFloors.forEach(function (floor, floor_index) { + // if (temp_all_floor.findIndex(x => x.name == floor.name) < 0) { //表示未加入,需加入 + // temp_all_floor.push(floor); + // } + // }); + // } + // }); + // } + //}); - $("#floors").empty(); - $("#floors").append(``); - var html = ""; - temp_all_floor.forEach(function (floor, floor_index) { - html += ''; - }); - $('#floors').append(html); + //$("#floors").empty(); + //$("#floors").append(``); + //var html = ""; + //temp_all_floor.forEach(function (floor, floor_index) { + // html += ''; + //}); + //$('#floors').append(html); - select_all_floor = false; - $('#floors').find('button').first().click(); + //select_all_floor = false; + //$('#floors').find('button').first().click(); } //#endregion @@ -1041,51 +1067,68 @@ //#region 修改過濾條件(大類) function ChangeFilterLayer2() { - temp_all_layer2 = []; - all_device_group.forEach(function (disaster, disaster_index) { - if (SelectedFilter.disasters.findIndex(x => x == disaster.value) > -1) { //抓取選擇防災類型的底下棟別 - disaster.groupBuildings.forEach(function (building, building_index) { - if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層 - building.groupFloors.forEach(function (floor, floor_index) { - if (SelectedFilter.floor_guids.findIndex(x => x == floor.name) > -1) { //抓取選擇樓層的底下大類 - floor.groupLayer2s.forEach(function (layer2, layer2_index) { - if (temp_all_layer2.findIndex(x => x.value == layer2.value) < 0) { - temp_all_layer2.push(layer2); - } - }); - } - }); - } - }); - } - }); + //temp_all_layer2 = []; + //all_device_group.forEach(function (disaster, disaster_index) { + // if (SelectedFilter.disasters.findIndex(x => x == disaster.value) > -1) { //抓取選擇防災類型的底下棟別 + // disaster.groupBuildings.forEach(function (building, building_index) { + // if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層 + // building.groupFloors.forEach(function (floor, floor_index) { + // if (SelectedFilter.floor_guids.findIndex(x => x == floor.name) > -1) { //抓取選擇樓層的底下大類 + // floor.groupLayer2s.forEach(function (layer2, layer2_index) { + // if (temp_all_layer2.findIndex(x => x.value == layer2.value) < 0) { + // temp_all_layer2.push(layer2); + // } + // }); + // } + // }); + // } + // }); + // } + //}); - $("#layer2").empty(); - $("#layer2").append(`
- -
`); - var html = ""; - temp_all_layer2.forEach(function (layer2, layer2_index) { + //$("#layer2").empty(); + //$("#layer2").append(`
+ // + //
`); + //var html = ""; + //temp_all_layer2.forEach(function (layer2, layer2_index) { - var layer2_device_amount = backfill_layer2_device_amount.filter(x => x.value == layer2.value && x.building_tag == SelectedFilter.building_tag)[0]; + // var layer2_device_amount = backfill_layer2_device_amount.filter(x => x.value == layer2.value && x.building_tag == SelectedFilter.building_tag)[0]; - @*html += ` -
- - -
`;*@ + // @*html += ` + //
+ // + // + //
`;*@ - html += ` -
- - -
`; + // html += ` + //
+ // + // + //
`; - }); - $('#layer2').append(html); + //}); + //$('#layer2').append(html); - select_all_layer2 = false; - $('#layer2').find('div').first().click(); + //select_all_layer2 = false; + //$('#layer2').find('div').first().click(); + } + //#endregion + + //#region 全選棟別 + function AllBuilding() { + if (select_all_building) { //全選 -> 取消全選 + select_all_building = false; + $('#building').find('div > button.btn-success').removeClass('btn-success').addClass('btn-secondary'); + } else { //取消全選 -> 全選 + select_all_building = true; + $('#building').find('div > button.btn-secondary').removeClass('btn-secondary').addClass('btn-success'); + } + + resetCalSelectBuilding(); + is_need_reload = true; + UpdateDeviceAmount(); + @*console.log("SelectedFilter", SelectedFilter);*@ } //#endregion @@ -1134,65 +1177,65 @@ //#region 修改過濾條件(小類) function ChangeFilterLayer3() { - temp_all_layer3 = []; - all_device_group.forEach(function (disaster, disaster_index) { - if (SelectedFilter.disasters.findIndex(x => x == disaster.value) > -1) { //抓取選擇防災類型的底下棟別 - disaster.groupBuildings.forEach(function (building, building_index) { - if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層 - building.groupFloors.forEach(function (floor, floor_index) { - if (SelectedFilter.floor_guids.findIndex(x => x == floor.name) > -1) { //抓取選擇樓層的底下大類 - floor.groupLayer2s.forEach(function (layer2, layer2_index) { - if (SelectedFilter.layer2.findIndex(x => x == layer2.value) > -1) { //抓取選擇大類的底下小類 - layer2.groupLayer3s.forEach(function (layer3, layer3_index) { - var new_layer3 = { - name: layer3.name, - value: layer3.value, - device_amount: layer3.device_amount - } + //temp_all_layer3 = []; + //all_device_group.forEach(function (disaster, disaster_index) { + // if (SelectedFilter.disasters.findIndex(x => x == disaster.value) > -1) { //抓取選擇防災類型的底下棟別 + // disaster.groupBuildings.forEach(function (building, building_index) { + // if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層 + // building.groupFloors.forEach(function (floor, floor_index) { + // if (SelectedFilter.floor_guids.findIndex(x => x == floor.name) > -1) { //抓取選擇樓層的底下大類 + // floor.groupLayer2s.forEach(function (layer2, layer2_index) { + // if (SelectedFilter.layer2.findIndex(x => x == layer2.value) > -1) { //抓取選擇大類的底下小類 + // layer2.groupLayer3s.forEach(function (layer3, layer3_index) { + // var new_layer3 = { + // name: layer3.name, + // value: layer3.value, + // device_amount: layer3.device_amount + // } - var temp_device_amount = new_layer3.device_amount; - var temp_layer3_index = temp_all_layer3.findIndex(x => x.value == layer3.value); - if (temp_layer3_index < 0) { - temp_all_layer3.push(new_layer3); - } else { - temp_all_layer3[temp_layer3_index].device_amount += temp_device_amount; - } - }); - } - }); - } - }); - } - }); - } - }); + // var temp_device_amount = new_layer3.device_amount; + // var temp_layer3_index = temp_all_layer3.findIndex(x => x.value == layer3.value); + // if (temp_layer3_index < 0) { + // temp_all_layer3.push(new_layer3); + // } else { + // temp_all_layer3[temp_layer3_index].device_amount += temp_device_amount; + // } + // }); + // } + // }); + // } + // }); + // } + // }); + // } + //}); - $("#layer3").empty(); - $("#layer3").append(`
- -
`); - var html = ""; - temp_all_layer3.forEach(function (layer3, layer3_index) { + //$("#layer3").empty(); + //$("#layer3").append(`
+ // + //
`); + //var html = ""; + //temp_all_layer3.forEach(function (layer3, layer3_index) { - var layer3_device_amount = backfill_layer3_device_amount.filter(x => x.layer3 == layer3.value && x.building_tag == SelectedFilter.building_tag)[0]; + // var layer3_device_amount = backfill_layer3_device_amount.filter(x => x.layer3 == layer3.value && x.building_tag == SelectedFilter.building_tag)[0]; - @*html += ` -
- - -
`;*@ + // @*html += ` + //
+ // + // + //
`;*@ - html += ` -
- - -
`; - }); + // html += ` + //
+ // + // + //
`; + //}); - $('#layer3').append(html); + //$('#layer3').append(html); - select_all_layer3 = false; - $('#layer3').find('div').first().click(); + //select_all_layer3 = false; + //$('#layer3').find('div').first().click(); } //#endregion @@ -1241,9 +1284,7 @@ function ResetDeviceTable() { if ((SelectedFilter.disasters == null || SelectedFilter.disasters.length <= 0) - || (SelectedFilter.building_tag == null || SelectedFilter.building_tag == "") - || (SelectedFilter.floor_guids == null || SelectedFilter.floor_guids.length <= 0) - || (SelectedFilter.layer3 == null || SelectedFilter.layer3.length <= 0) + || (SelectedFilter.building_tag == null || SelectedFilter.building_tag.length <= 0) ) { return; } @@ -1327,7 +1368,7 @@ // de_number = $(e).parent().parent().attr('de-number'); var url = "/api/EmergencyDevice/SaveAndOpenSimulationExercise"; var send_data = { - build: SelectedFilter.building_tag, + build: SelectedFilter.building_tag[0] ?? null, disaster: disaster, type: type, device: guid diff --git a/FrontendWebApi/Views/EmergencyHardwareMenu/Index.cshtml b/FrontendWebApi/Views/EmergencyHardwareMenu/Index.cshtml new file mode 100644 index 0000000..3696639 --- /dev/null +++ b/FrontendWebApi/Views/EmergencyHardwareMenu/Index.cshtml @@ -0,0 +1,1950 @@ +@{ + ViewData["MainNum"] = "4"; + ViewData["SubNum"] = "2"; + ViewData["Title"] = "緊急應變硬體清單"; +} + + + + +
+
+
+
+ @*
+
顯示類型
+
+ + + +
+
*@ +
+
防災類別
+
防災類別
+
+ +
+
+
+
棟別
+
棟別
+
+
+
樓層
+
棟別
+
+
+
設備大類
+
設備大類
+
+
+
設備小類
+
設備大類
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + +
設備編號設備名稱棟別防災類型設備大類設備小類樓層異常時間功能
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + +@section Scripts { + +} \ No newline at end of file diff --git a/FrontendWebApi/Views/EmergencyRecord/Index.cshtml b/FrontendWebApi/Views/EmergencyRecord/Index.cshtml index da8cc75..d2ff4f5 100644 --- a/FrontendWebApi/Views/EmergencyRecord/Index.cshtml +++ b/FrontendWebApi/Views/EmergencyRecord/Index.cshtml @@ -1,6 +1,6 @@ @{ ViewData["MainNum"] = "4"; - ViewData["SubNum"] = "3"; + ViewData["SubNum"] = "4"; ViewData["Title"] = "紀錄查詢"; } diff --git a/FrontendWebApi/Views/RescueDevice/AED.cshtml b/FrontendWebApi/Views/RescueDevice/AED.cshtml index 7b5da75..c6c9a4d 100644 --- a/FrontendWebApi/Views/RescueDevice/AED.cshtml +++ b/FrontendWebApi/Views/RescueDevice/AED.cshtml @@ -1,6 +1,6 @@ @{ ViewData["MainNum"] = "4"; - ViewData["SubNum"] = "5"; + ViewData["SubNum"] = "6"; ViewData["Title"] = "AED裝置設定"; } diff --git a/FrontendWebApi/Views/RescueDevice/FireExtinguisher.cshtml b/FrontendWebApi/Views/RescueDevice/FireExtinguisher.cshtml index 0522ce3..ed119da 100644 --- a/FrontendWebApi/Views/RescueDevice/FireExtinguisher.cshtml +++ b/FrontendWebApi/Views/RescueDevice/FireExtinguisher.cshtml @@ -1,6 +1,6 @@ @{ ViewData["MainNum"] = "4"; - ViewData["SubNum"] = "4"; + ViewData["SubNum"] = "5"; ViewData["Title"] = "滅火器設定"; } diff --git a/FrontendWebApi/Views/Shared/_Layout.cshtml b/FrontendWebApi/Views/Shared/_Layout.cshtml index 4b18cd6..7e85354 100644 --- a/FrontendWebApi/Views/Shared/_Layout.cshtml +++ b/FrontendWebApi/Views/Shared/_Layout.cshtml @@ -89,14 +89,22 @@ @if (ViewBag.role.Contains("EmergencyDeviceMenuIndex")) {
  • - - 設備總覽 + + 事件清單 + +
  • + } + @if (ViewBag.role.Contains("EmergencyHardwareIndex")) + { +
  • + + 緊急應變硬體清單
  • } @if (ViewBag.role.Contains("EmergencyContactIndex")) { -
  • +
  • 聯絡清單 @@ -104,7 +112,7 @@ } @if (ViewBag.role.Contains("EmergencyRecordIndex")) { -
  • +
  • 紀錄查詢 @@ -113,7 +121,7 @@ @if (ViewBag.role.Contains("RescueDeviceFireExtinguisher")) { -
  • +
  • 滅火器設定 @@ -121,7 +129,7 @@ } @if (ViewBag.role.Contains("RescueDeviceAED")) { -
  • +
  • AED裝置設定 diff --git a/FrontendWebApi/appsettings.Development.json b/FrontendWebApi/appsettings.Development.json index b87a385..f976969 100644 --- a/FrontendWebApi/appsettings.Development.json +++ b/FrontendWebApi/appsettings.Development.json @@ -18,10 +18,10 @@ "Port": "js2LutKe+rdjzdxMPQUrvQ==", //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //30 //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp - //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome + "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office - "Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT + //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT "Root": "SzdxEgaJJ7tcTCrUl2zKsA==", "Password": "FVAPxztxpY4gJJKQ/se4bQ==" } diff --git a/FrontendWebApi/appsettings.json b/FrontendWebApi/appsettings.json index 7e6da69..e57bf74 100644 --- a/FrontendWebApi/appsettings.json +++ b/FrontendWebApi/appsettings.json @@ -23,8 +23,9 @@ "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 "Port": "js2LutKe+rdjzdxMPQUrvQ==", //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //三菱 - "Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp - //"Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome + //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp + //"Database": "Rq7Gn4x6LwBvVtl7GY8LbA==", //MCUT + "Database": "7gWfmZ28HGIJZbxEbK+0yg==", //tpe_dome_dome //"Database": "siTUcDaC/g2yGTMFWD72Kg==", //tpe_dome_hotel //"Database": "iuaY0h0+TWkir44/eZLDqw==", //tpe_dome_office "Root": "SzdxEgaJJ7tcTCrUl2zKsA==",