diff --git a/FrontendWebApi/ApiControllers/AlarmController.cs b/FrontendWebApi/ApiControllers/AlarmController.cs
index 7179149..924ab5a 100644
--- a/FrontendWebApi/ApiControllers/AlarmController.cs
+++ b/FrontendWebApi/ApiControllers/AlarmController.cs
@@ -65,7 +65,7 @@ namespace FrontendWebApi.ApiControllers
client.DefaultRequestHeaders.Add("Authorization", "Basic " + encoded);
// 建構 XML 數據
string xmlData = @$"
-
+
";
HttpContent content = new StringContent(xmlData, Encoding.UTF8, "application/xml");
@@ -130,12 +130,13 @@ namespace FrontendWebApi.ApiControllers
}).ToList();
// obix alarm 回傳 device_number + point 取出棟別分組
- alarmObj.buildingAlarmDeviceAmount = alarmObj.alarmorion.Where(a => a.device_number?.Contains("_") ?? false)
- .GroupBy(g => g.device_number.Split("_")[0]).Select(g => new BuildingAlarmDeviceAmount()
- {
- building_tag = g.Key,
- device_amount = g.Count()
- }).ToList();
+ // 20230920 - 佳豪表示棟別按鈕不顯示數量
+ //alarmObj.buildingAlarmDeviceAmount = alarmObj.alarmorion.Where(a => a.device_number?.Contains("_") ?? false)
+ // .GroupBy(g => g.device_number.Split("_")[0]).Select(g => new BuildingAlarmDeviceAmount()
+ //{
+ // building_tag = g.Key,
+ // device_amount = g.Count()
+ //}).ToList();
apiResult.Data = alarmObj;
diff --git a/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs b/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs
index 0b92271..6bad12b 100644
--- a/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs
+++ b/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs
@@ -135,7 +135,7 @@ namespace FrontendWebApi.ApiControllers
d.device_guid,
d.device_number,
d.full_name AS device_name,
- d.device_building_tag,
+ d.device_building_tag AS building_tag,
b.full_name AS building_name,
CONCAT(b.ip_address , ':', b.ip_port) AS ip_address,
v.layer2,
@@ -163,7 +163,7 @@ namespace FrontendWebApi.ApiControllers
from variable v
where v.system_type = 'device_system_category_layer3') v
LEFT JOIN variable v2 ON v2.deleted = 0 AND v.system_parent_id = v2.id
- ) v on v.system_value = d.device_system_category_layer3
+ ) v on v.system_value = d.device_name_tag
left join device_disaster dd on dd.device_guid = d.device_guid
left join (select * from variable v where v.system_type = 'disaster') ddd on ddd.system_value = dd.device_system_value
LEFT JOIN building b ON b.deleted = 0 AND d.device_building_tag = b.building_tag
diff --git a/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml b/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml
index a814352..951d24f 100644
--- a/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml
+++ b/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml
@@ -391,10 +391,10 @@
if (show_mode == "alarm" && (is_need_reload || is_diff)) {
enable_alarm_timer = false; //關閉查詢異常設備,避免重複呼叫
- $("#building").find(".building_device_amount").html(0);
- data.buildingAlarmDeviceAmount.forEach(function (item) {
- $(`#${item.building_tag}_device_amount`).html(item.device_amount);
- });
+ //$("#building").find(".building_device_amount").html(0);
+ //data.buildingAlarmDeviceAmount.forEach(function (item) {
+ // $(`#${item.building_tag}_device_amount`).html(item.device_amount);
+ //});
ResetDeviceTable();
}
})
@@ -639,6 +639,7 @@
is_need_reload = true;
}
+ $(`button[id^=buildingBtn]`).removeClass("btn-danger").addClass("btn-secondary");
enable_alarm_timer = true;
is_need_reload = false;
@@ -710,7 +711,7 @@
backfill_layer3_alarm_device_amount[temp_layer3_index].device_amount += 1;
}
-
+ $(`#buildingBtn${temp_device.building_tag}`).removeClass("btn-secondary").addClass("btn-danger");
alarm_data.push(obj);
}
});
@@ -949,8 +950,7 @@
`;*@
html += `
-
-
+
`;
});
$('#building').append(``);