From e77715fb0e552c2c63fba47b21303ba57aafff22 Mon Sep 17 00:00:00 2001 From: dev01 Date: Fri, 19 May 2023 14:26:54 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=89=8D=E5=8F=B0][=E7=B7=8A=E6=80=A5?= =?UTF-8?q?=E6=87=89=E8=AE=8A]=20=E5=89=8D=E7=AB=AF=E4=BA=94=E6=AE=B5?= =?UTF-8?q?=E6=94=B9=E5=85=AB=E6=AE=B5=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/EmergencyDeviceMenu/Index.cshtml | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml b/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml index 9d69c45..19ef091 100644 --- a/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml +++ b/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml @@ -337,7 +337,7 @@ var SelectedFilter = { disasters: [], - building_guid: '', + building_tag: '', floor_guids: [], layer2: [], layer3: [] @@ -393,7 +393,7 @@ $("#building").find(".building_device_amount").html(0); rel.data.buildingAlarmDeviceAmount.forEach(function (item) { - $(`#${item.building_guid}_device_amount`).html(item.device_amount); + $(`#${item.building_tag}_device_amount`).html(item.device_amount); }); ResetDeviceTable(); } @@ -562,13 +562,13 @@ "data": "device_number", "render": function (data, type, row, meta) { @*var html = ` - + ${data} `;*@ var html = ` - + ${data} `; @@ -620,7 +620,7 @@ "type": "POST", "data": function (d) { d.select_disasters = SelectedFilter.disasters; - d.selectbuilding = SelectedFilter.building_guid; + d.selectbuilding = SelectedFilter.building_tag; d.select_Floors = SelectedFilter.floor_guids; d.select_Layer3 = SelectedFilter.layer3; }, @@ -656,7 +656,7 @@ device_number: temp_device.device_number, device_name: temp_device.device_name, building_name: temp_device.building_name, - building_guid: temp_device.building_guid, + building_tag: temp_device.building_tag, ip_address: temp_device.ip_address, disaster: temp_device.disaster, disaster_name: temp_device.disaster_name, @@ -669,10 +669,10 @@ alarm_timestamp: alarm_device.alarm_timestamp, } - var temp_building_index = backfill_building_alarm_device_amount.findIndex(x => x.building_guid == temp_device.building_guid); + var temp_building_index = backfill_building_alarm_device_amount.findIndex(x => x.building_tag == temp_device.building_tag); if (temp_building_index < 0) { var building_obj = { - building_guid: temp_device.building_guid, + building_tag: temp_device.building_tag, device_amount: 1 } @@ -681,10 +681,10 @@ backfill_building_alarm_device_amount[temp_building_index].device_amount += 1; } - var temp_layer2_index = backfill_layer2_alarm_device_amount.findIndex(x => x.value == temp_device.layer2 && x.building_guid == temp_device.building_guid) + var temp_layer2_index = backfill_layer2_alarm_device_amount.findIndex(x => x.value == temp_device.layer2 && x.building_tag == temp_device.building_tag) if (temp_layer2_index < 0) { var layer2_obj = { - building_guid: temp_device.building_guid, + building_tag: temp_device.building_tag, value: temp_device.layer2, device_amount: 1 } @@ -694,10 +694,10 @@ backfill_layer2_alarm_device_amount[temp_layer2_index].device_amount += 1; } - var temp_layer3_index = backfill_layer3_alarm_device_amount.findIndex(x => x.layer3 == temp_device.layer3 && x.layer2 == temp_device.layer2 && x.building_guid == temp_device.building_guid) + var temp_layer3_index = backfill_layer3_alarm_device_amount.findIndex(x => x.layer3 == temp_device.layer3 && x.layer2 == temp_device.layer2 && x.building_tag == temp_device.building_tag) if (temp_layer3_index < 0) { var layer3_obj = { - building_guid: temp_device.building_guid, + building_tag: temp_device.building_tag, layer2: temp_device.layer2, layer3: temp_device.layer3, device_amount: 1 @@ -764,10 +764,10 @@ device_amount: layer3.device_amount } - var temp_building_index = backfill_building_device_amount.findIndex(x => x.building_guid == building.guid); + var temp_building_index = backfill_building_device_amount.findIndex(x => x.building_tag == building.guid); if (temp_building_index < 0) { var building_obj = { - building_guid: building.guid, + building_tag: building.guid, device_amount: new_layer3.device_amount } @@ -776,10 +776,10 @@ backfill_building_device_amount[temp_building_index].device_amount += new_layer3.device_amount; } - var temp_layer2_index = backfill_layer2_device_amount.findIndex(x => x.value == layer2.value && x.building_guid == building.guid) + var temp_layer2_index = backfill_layer2_device_amount.findIndex(x => x.value == layer2.value && x.building_tag == building.guid) if (temp_layer2_index < 0) { var layer2_obj = { - building_guid: building.guid, + building_tag: building.guid, value: layer2.value, device_amount: new_layer3.device_amount } @@ -789,10 +789,10 @@ backfill_layer2_device_amount[temp_layer2_index].device_amount += new_layer3.device_amount; } - var temp_layer3_index = backfill_layer3_device_amount.findIndex(x => x.layer3 == layer3.value && x.layer2 == layer2.value && x.building_guid == building.guid) + var temp_layer3_index = backfill_layer3_device_amount.findIndex(x => x.layer3 == layer3.value && x.layer2 == layer2.value && x.building_tag == building.guid) if (temp_layer3_index < 0) { var layer3_obj = { - building_guid: building.guid, + building_tag: building.guid, layer2: layer2.value, layer3: layer3.value, device_amount: new_layer3.device_amount @@ -909,7 +909,7 @@ var html = ""; temp_all_building.forEach(function (building, building_index) { - var building_device_amount = backfill_building_device_amount.filter(x => x.building_guid == building.guid)[0]; + var building_device_amount = backfill_building_device_amount.filter(x => x.building_tag == building.guid)[0]; @*html += `
@@ -941,10 +941,10 @@ //#endregion //#region 選擇棟別 - function SelectBuilding(building_guid, e) { + function SelectBuilding(building_tag, e) { $('#building').find('button').removeClass('btn-success').addClass('btn-secondary') - SelectedFilter.building_guid = building_guid; + SelectedFilter.building_tag = building_tag; if (show_mode == 'alarm') { $(e).find('button').addClass('btn-success'); } else { @@ -963,7 +963,7 @@ 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.guid == SelectedFilter.building_guid) { //抓取選擇棟別的底下樓層 + if (building.guid == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層 building.groupFloors.forEach(function (floor, floor_index) { if (temp_all_floor.findIndex(x => x.guid == floor.guid) < 0) { //表示未加入,需加入 temp_all_floor.push(floor); @@ -1034,7 +1034,7 @@ 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.guid == SelectedFilter.building_guid) { //抓取選擇棟別的底下樓層 + if (building.guid == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層 building.groupFloors.forEach(function (floor, floor_index) { if (SelectedFilter.floor_guids.findIndex(x => x == floor.guid) > -1) { //抓取選擇樓層的底下大類 floor.groupLayer2s.forEach(function (layer2, layer2_index) { @@ -1056,18 +1056,18 @@ 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_guid == SelectedFilter.building_guid)[0]; + var layer2_device_amount = backfill_layer2_device_amount.filter(x => x.value == layer2.value && x.building_tag == SelectedFilter.building_tag)[0]; @*html += `
- +
`;*@ html += `
- +
`; }); @@ -1125,7 +1125,7 @@ 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.guid == SelectedFilter.building_guid) { //抓取選擇棟別的底下樓層 + if (building.guid == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層 building.groupFloors.forEach(function (floor, floor_index) { if (SelectedFilter.floor_guids.findIndex(x => x == floor.guid) > -1) { //抓取選擇樓層的底下大類 floor.groupLayer2s.forEach(function (layer2, layer2_index) { @@ -1161,18 +1161,18 @@ 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_guid == SelectedFilter.building_guid)[0]; + var layer3_device_amount = backfill_layer3_device_amount.filter(x => x.layer3 == layer3.value && x.building_tag == SelectedFilter.building_tag)[0]; @*html += `
- +
`;*@ html += `
- +
`; }); @@ -1226,20 +1226,20 @@ function ResetDeviceTable() { if ((SelectedFilter.disasters == null || SelectedFilter.disasters.length <= 0) - || (SelectedFilter.building_guid == null || SelectedFilter.building_guid == "") + || (SelectedFilter.building_tag == null || SelectedFilter.building_tag == "") || (SelectedFilter.floor_guids == null || SelectedFilter.floor_guids.length <= 0) || (SelectedFilter.layer3 == null || SelectedFilter.layer3.length <= 0) ) { return; } - if (changeBuilding != "" && changeBuilding != SelectedFilter.building_guid) { + if (changeBuilding != "" && changeBuilding != SelectedFilter.building_tag) { alarmDeviceTable.clear().draw(); } else { alarmDeviceTable.ajax.reload(null, false); } - changeBuilding = SelectedFilter.building_guid; + changeBuilding = SelectedFilter.building_tag; } //#endregion @@ -1250,39 +1250,39 @@ if (show_mode == 'alarm') { backfill_building_alarm_device_amount.forEach(function (building, index) { - $(`#${building.building_guid}_device_amount`).html(building.device_amount); + $(`#${building.building_tag}_device_amount`).html(building.device_amount); }); backfill_layer2_alarm_device_amount.forEach(function (layer2, index) { - $(`#${layer2.building_guid}_${layer2.value}_device_amount`).html(layer2.device_amount); + $(`#${layer2.building_tag}_${layer2.value}_device_amount`).html(layer2.device_amount); }); backfill_layer3_alarm_device_amount.forEach(function (layer3, index) { - $(`#${layer3.building_guid}_${layer3.layer3}_device_amount`).html(layer3.device_amount); + $(`#${layer3.building_tag}_${layer3.layer3}_device_amount`).html(layer3.device_amount); }); } else { backfill_building_device_amount.forEach(function (building, index) { - $(`#${building.building_guid}_device_amount`).html(building.device_amount); + $(`#${building.building_tag}_device_amount`).html(building.device_amount); }); backfill_layer2_device_amount.forEach(function (layer2, index) { - $(`#${layer2.building_guid}_${layer2.value}_device_amount`).html(layer2.device_amount); + $(`#${layer2.building_tag}_${layer2.value}_device_amount`).html(layer2.device_amount); }); backfill_layer3_device_amount.forEach(function (layer3, index) { - $(`#${layer3.building_guid}_${layer3.layer3}_device_amount`).html(layer3.device_amount); + $(`#${layer3.building_tag}_${layer3.layer3}_device_amount`).html(layer3.device_amount); }); } } //#endregion //#region 變更右方地圖(改為跳新分頁) - function ChangeFloormap(building_guid, floor_guid, device_number, layer3) { + function ChangeFloormap(building_tag, floor_guid, device_number, layer3) { @* $("#iframe-floormap").empty(); $("#iframe-floormap").append( - `` + `` ) *@ } @@ -1312,7 +1312,7 @@ // de_number = $(e).parent().parent().attr('de-number'); var url = "/api/EmergencyDevice/SaveAndOpenSimulationExercise"; var send_data = { - build: SelectedFilter.building_guid, + build: SelectedFilter.building_tag, disaster: disaster, type: type, device: guid