ibms-dome/Backend/Views/EmergencyDeviceMenu/Index.cshtml

86 lines
3.3 KiB
Plaintext
Raw Normal View History

2022-10-14 16:08:54 +08:00
@{
ViewData["MainNum"] = "4";
ViewData["SubNum"] = "1";
ViewData["Title"] = "設備總覽";
}
<ol class="breadcrumb page-breadcrumb">
<li class="breadcrumb-item"><a href="javascript:void(0);">首頁</a></li>
<li class="breadcrumb-item active">設備總覽</li>
<li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
</ol>
<div class="row">
<div class="col-xl-12">
<div id="panel-5" class="panel">
<div class="panel-container show">
<div class="panel-content">
<ul class="nav nav-tabs" id="tabs" role="tablist">
<li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#tab-alarm-device" role="tab"><span class="hidden-sm-down ml-1">報警設備</span></a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#tab-emergency-device" role="tab"><span class="hidden-sm-down ml-1">緊急應變設備</span></a></li>
</ul>
<div class="tab-content p-3">
<div class="tab-pane fade show active" id="tab-alarm-device" role="tabpanel" aria-labelledby="tab-build-info">
@Html.Partial("_AlarmDevice")
</div>
<div class="tab-pane fade" id="tab-emergency-device" role="tabpanel" aria-labelledby="tab-build-floor">
@Html.Partial("_EmergencyDevice")
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@section Scripts {
<script>
var AlarmDeviceTable, EmergencyDeviceTable;
//#region 報警設備 document ready
$(function () {
});
//#endregion
</script>
<script>
//#region 緊急應變設備 document ready
$(function () {
//#region 取得防災類別
var url = "/EmergencyDeviceMenu/GetDisaster/";
$.post(url, null, function (rel) {
if (rel.code != "0000") {
if (rel.code == "9999") {
toast_error(rel.msg);
}
else {
toast_warning(rel.msg);
}
return;
}
else {
$("#disaster").empty();
var html = "";
rel.data.forEach(function (item, index) {
if (index == 0) {
html += '<button type="button" class="btn btn-success ml-2" onclick="SelectDisaster(' + item.value + ',this)">' + item.name + '</button>';
}
else {
html += '<button type="button" class="btn btn-secondary ml-2" onclick="SelectDisaster(' + item.value + ',this)">' + item.name + '</button>';
}
});
html += '<button type="button" class="btn btn-secondary ml-auto" onclick="OnSimulationExercise(``,1)">' + '模擬演練' + '</button>';
$('#disaster').append(html);
$('#disaster').find('.btn-success').click();
}
}, 'json');
});
//#endregion
</script>
}