[緊急應變] 設備總攬 Filter Panel 前端程序優化及調整 | 緊急應變初始頁面直接導進設備總覽
This commit is contained in:
parent
86548b7fb6
commit
a5bcf2e8fb
@ -224,7 +224,7 @@
|
|||||||
</button>*@
|
</button>*@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form id="emergency-item-form">
|
<form id="emergency-item-form" onsubmit="PassVerify(true)">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-6">
|
<div class="form-group col-6">
|
||||||
<label class="form-label" for="emergency_verify_modal"><span class="text-danger">*</span>指揮官密碼</label>
|
<label class="form-label" for="emergency_verify_modal"><span class="text-danger">*</span>指揮官密碼</label>
|
||||||
@ -351,6 +351,9 @@
|
|||||||
var ToVerifyType = 0;
|
var ToVerifyType = 0;
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
$("#emergency-item-form").submit((e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
})
|
||||||
|
|
||||||
//#region 定時取得報警設備(3s)
|
//#region 定時取得報警設備(3s)
|
||||||
interval_id = setInterval(function () {
|
interval_id = setInterval(function () {
|
||||||
@ -409,7 +412,7 @@
|
|||||||
emergencyContactTable = $("#membertable").DataTable({
|
emergencyContactTable = $("#membertable").DataTable({
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
"data": "full_name"
|
"data": "name"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"data": "departmentName"
|
"data": "departmentName"
|
||||||
@ -453,7 +456,7 @@
|
|||||||
SmsMemberTable = $("#smsMemberTable").DataTable({
|
SmsMemberTable = $("#smsMemberTable").DataTable({
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
"data": "full_name"
|
"data": "name"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"data": "departmentName"
|
"data": "departmentName"
|
||||||
@ -869,6 +872,7 @@
|
|||||||
|
|
||||||
is_need_reload = true;
|
is_need_reload = true;
|
||||||
ChangeFilterBuilding();
|
ChangeFilterBuilding();
|
||||||
|
UpdateDeviceAmount();
|
||||||
@*console.log("SelectedFilter", SelectedFilter);*@
|
@*console.log("SelectedFilter", SelectedFilter);*@
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -889,6 +893,7 @@
|
|||||||
|
|
||||||
is_need_reload = true;
|
is_need_reload = true;
|
||||||
ChangeFilterBuilding();
|
ChangeFilterBuilding();
|
||||||
|
UpdateDeviceAmount();
|
||||||
@*console.log("SelectedFilter", SelectedFilter);*@
|
@*console.log("SelectedFilter", SelectedFilter);*@
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -956,6 +961,7 @@
|
|||||||
|
|
||||||
is_need_reload = true;
|
is_need_reload = true;
|
||||||
ChangeFilterFloor();
|
ChangeFilterFloor();
|
||||||
|
UpdateDeviceAmount();
|
||||||
@*console.log("SelectedFilter", SelectedFilter);*@
|
@*console.log("SelectedFilter", SelectedFilter);*@
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -968,7 +974,7 @@
|
|||||||
disaster.groupBuildings.forEach(function (building, building_index) {
|
disaster.groupBuildings.forEach(function (building, building_index) {
|
||||||
if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層
|
if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層
|
||||||
building.groupFloors.forEach(function (floor, floor_index) {
|
building.groupFloors.forEach(function (floor, floor_index) {
|
||||||
if (temp_all_floor.findIndex(x => x.guid == floor.guid) < 0) { //表示未加入,需加入
|
if (temp_all_floor.findIndex(x => x.name == floor.name) < 0) { //表示未加入,需加入
|
||||||
temp_all_floor.push(floor);
|
temp_all_floor.push(floor);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -981,7 +987,7 @@
|
|||||||
$("#floors").append(`<button type="button" class="btn btn-secondary ml-2 mb-2" onclick="AllFloor()">全選</button>`);
|
$("#floors").append(`<button type="button" class="btn btn-secondary ml-2 mb-2" onclick="AllFloor()">全選</button>`);
|
||||||
var html = "";
|
var html = "";
|
||||||
temp_all_floor.forEach(function (floor, floor_index) {
|
temp_all_floor.forEach(function (floor, floor_index) {
|
||||||
html += '<button type="button" class="btn btn-outline-success ml-2 mb-2" onclick="SelectFloor(\'' + floor.guid + '\',this)">' + floor.name + '</button>';
|
html += '<button type="button" class="btn btn-outline-success ml-2 mb-2" onclick="SelectFloor(\'' + floor.name + '\',this)">' + floor.name + '</button>';
|
||||||
});
|
});
|
||||||
$('#floors').append(html);
|
$('#floors').append(html);
|
||||||
|
|
||||||
@ -1001,32 +1007,34 @@
|
|||||||
$('#floors').find('.btn-outline-success').removeClass('btn-outline-success').addClass('btn-success');
|
$('#floors').find('.btn-outline-success').removeClass('btn-outline-success').addClass('btn-success');
|
||||||
SelectedFilter.floor_guids = [];
|
SelectedFilter.floor_guids = [];
|
||||||
temp_all_floor.forEach(function (floor, floor_index) {
|
temp_all_floor.forEach(function (floor, floor_index) {
|
||||||
SelectedFilter.floor_guids.push(floor.guid);
|
SelectedFilter.floor_guids.push(floor.name);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
is_need_reload = true;
|
is_need_reload = true;
|
||||||
ChangeFilterLayer2();
|
ChangeFilterLayer2();
|
||||||
|
UpdateDeviceAmount();
|
||||||
@*console.log("SelectedFilter", SelectedFilter);*@
|
@*console.log("SelectedFilter", SelectedFilter);*@
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region 選擇樓層
|
//#region 選擇樓層
|
||||||
function SelectFloor(floor_guid, e) {
|
function SelectFloor(floor_tag, e) {
|
||||||
select_all_floor = false;
|
select_all_floor = false;
|
||||||
|
|
||||||
var floor_index = SelectedFilter.floor_guids.findIndex(x => x == floor_guid);
|
var floor_index = SelectedFilter.floor_guids.findIndex(x => x == floor_tag);
|
||||||
if (floor_index > -1) { //已選擇 -> 未選擇
|
if (floor_index > -1) { //已選擇 -> 未選擇
|
||||||
SelectedFilter.floor_guids.splice(floor_index, 1);
|
SelectedFilter.floor_guids.splice(floor_index, 1);
|
||||||
$(e).removeClass('btn-success').addClass('btn-outline-success');
|
$(e).removeClass('btn-success').addClass('btn-outline-success');
|
||||||
}
|
}
|
||||||
else { //未選擇 -> 已選擇
|
else { //未選擇 -> 已選擇
|
||||||
SelectedFilter.floor_guids.push(floor_guid);
|
SelectedFilter.floor_guids.push(floor_tag);
|
||||||
$(e).removeClass('btn-outline-success').addClass('btn-success');
|
$(e).removeClass('btn-outline-success').addClass('btn-success');
|
||||||
}
|
}
|
||||||
|
|
||||||
is_need_reload = true;
|
is_need_reload = true;
|
||||||
ChangeFilterLayer2();
|
ChangeFilterLayer2();
|
||||||
|
UpdateDeviceAmount();
|
||||||
@*console.log("SelectedFilter", SelectedFilter);*@
|
@*console.log("SelectedFilter", SelectedFilter);*@
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -1039,7 +1047,7 @@
|
|||||||
disaster.groupBuildings.forEach(function (building, building_index) {
|
disaster.groupBuildings.forEach(function (building, building_index) {
|
||||||
if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層
|
if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層
|
||||||
building.groupFloors.forEach(function (floor, floor_index) {
|
building.groupFloors.forEach(function (floor, floor_index) {
|
||||||
if (SelectedFilter.floor_guids.findIndex(x => x == floor.guid) > -1) { //抓取選擇樓層的底下大類
|
if (SelectedFilter.floor_guids.findIndex(x => x == floor.name) > -1) { //抓取選擇樓層的底下大類
|
||||||
floor.groupLayer2s.forEach(function (layer2, layer2_index) {
|
floor.groupLayer2s.forEach(function (layer2, layer2_index) {
|
||||||
if (temp_all_layer2.findIndex(x => x.value == layer2.value) < 0) {
|
if (temp_all_layer2.findIndex(x => x.value == layer2.value) < 0) {
|
||||||
temp_all_layer2.push(layer2);
|
temp_all_layer2.push(layer2);
|
||||||
@ -1098,6 +1106,7 @@
|
|||||||
|
|
||||||
is_need_reload = true;
|
is_need_reload = true;
|
||||||
ChangeFilterLayer3();
|
ChangeFilterLayer3();
|
||||||
|
UpdateDeviceAmount();
|
||||||
@*console.log("SelectedFilter", SelectedFilter);*@
|
@*console.log("SelectedFilter", SelectedFilter);*@
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -1118,6 +1127,7 @@
|
|||||||
|
|
||||||
is_need_reload = true;
|
is_need_reload = true;
|
||||||
ChangeFilterLayer3();
|
ChangeFilterLayer3();
|
||||||
|
UpdateDeviceAmount();
|
||||||
@*console.log("SelectedFilter", SelectedFilter);*@
|
@*console.log("SelectedFilter", SelectedFilter);*@
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -1130,7 +1140,7 @@
|
|||||||
disaster.groupBuildings.forEach(function (building, building_index) {
|
disaster.groupBuildings.forEach(function (building, building_index) {
|
||||||
if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層
|
if (building.tag == SelectedFilter.building_tag) { //抓取選擇棟別的底下樓層
|
||||||
building.groupFloors.forEach(function (floor, floor_index) {
|
building.groupFloors.forEach(function (floor, floor_index) {
|
||||||
if (SelectedFilter.floor_guids.findIndex(x => x == floor.guid) > -1) { //抓取選擇樓層的底下大類
|
if (SelectedFilter.floor_guids.findIndex(x => x == floor.name) > -1) { //抓取選擇樓層的底下大類
|
||||||
floor.groupLayer2s.forEach(function (layer2, layer2_index) {
|
floor.groupLayer2s.forEach(function (layer2, layer2_index) {
|
||||||
if (SelectedFilter.layer2.findIndex(x => x == layer2.value) > -1) { //抓取選擇大類的底下小類
|
if (SelectedFilter.layer2.findIndex(x => x == layer2.value) > -1) { //抓取選擇大類的底下小類
|
||||||
layer2.groupLayer3s.forEach(function (layer3, layer3_index) {
|
layer2.groupLayer3s.forEach(function (layer3, layer3_index) {
|
||||||
@ -1203,6 +1213,7 @@
|
|||||||
|
|
||||||
is_need_reload = true;
|
is_need_reload = true;
|
||||||
ResetDeviceTable();
|
ResetDeviceTable();
|
||||||
|
UpdateDeviceAmount();
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
@ -1222,6 +1233,7 @@
|
|||||||
|
|
||||||
is_need_reload = true;
|
is_need_reload = true;
|
||||||
ResetDeviceTable();
|
ResetDeviceTable();
|
||||||
|
UpdateDeviceAmount();
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
@ -1601,9 +1613,9 @@
|
|||||||
var includeli = "";
|
var includeli = "";
|
||||||
$.each(rel.data, function (index, val) {
|
$.each(rel.data, function (index, val) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
includeli += '<li class="list-group-item active" id="li_' + val.emergency_guid + '" > <a class="abc" onclick="GetContentAndMakeItem(\'' + val.emergency_guid + '\',this,' + setting + ')" >' + val.full_name + '</a></li>';
|
includeli += '<li class="list-group-item active" id="li_' + val.emergency_guid + '" > <a class="abc" onclick="GetContentAndMakeItem(\'' + val.emergency_guid + '\',this,' + setting + ')" >' + val.name + '</a></li>';
|
||||||
} else {
|
} else {
|
||||||
includeli += '<li class="list-group-item" id="li_' + val.emergency_guid + '"> <a class="abc" onclick="GetContentAndMakeItem(\'' + val.emergency_guid + '\',this,' + setting + ')" >' + val.full_name + '</a></li>';
|
includeli += '<li class="list-group-item" id="li_' + val.emergency_guid + '"> <a class="abc" onclick="GetContentAndMakeItem(\'' + val.emergency_guid + '\',this,' + setting + ')" >' + val.name + '</a></li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -1666,7 +1678,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#hbr_' + setting).empty();
|
$('#hbr_' + setting).empty();
|
||||||
$('#hbr_' + setting).append('<h2>' + rel.data.full_name + '</h2>');
|
$('#hbr_' + setting).append('<h2>' + rel.data.name + '</h2>');
|
||||||
$('#tag_' + setting).empty();
|
$('#tag_' + setting).empty();
|
||||||
$('#tag_' + setting).append(rel.data.set_doing);
|
$('#tag_' + setting).append(rel.data.set_doing);
|
||||||
|
|
||||||
@ -1751,7 +1763,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function PassVerify(Vbool) {
|
function PassVerify(Vbool) {
|
||||||
console.log(SmsMemberTable.data().toArray())
|
|
||||||
if (ToVerifyType == 0) {
|
if (ToVerifyType == 0) {
|
||||||
if (Vbool) {
|
if (Vbool) {
|
||||||
var url = "api/EmergencyDevice/CheckVerifybool";
|
var url = "api/EmergencyDevice/CheckVerifybool";
|
||||||
@ -1788,9 +1799,6 @@
|
|||||||
$('#list_' + EmerLastsetting).find('.active').children().trigger('click');
|
$('#list_' + EmerLastsetting).find('.active').children().trigger('click');
|
||||||
$('#emergency-verify-modal').modal('hide');
|
$('#emergency-verify-modal').modal('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ToVerifyType == 1) {
|
if (ToVerifyType == 1) {
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
async: false,
|
async: false,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (rel) {
|
success: function (rel) {
|
||||||
window.location = "/Home/Index/";
|
window.location = "/EmergencyDeviceMenu";
|
||||||
},
|
},
|
||||||
error: function (xhr, textStatus, thrownError) {
|
error: function (xhr, textStatus, thrownError) {
|
||||||
alert(textStatus);
|
alert(textStatus);
|
||||||
|
Loading…
Reference in New Issue
Block a user