`;
html += ``;
var device_master_arr = [];
var a = getdeviceresult.data.filter(function (n, i) {
if (n.floor_guid === floors.floor_guid) {
html += `
`
n.device.forEach(device => {
if (device.device_master_number != undefined && device.device_master_number != null && (device.device_system_category_layer3 == "L1" || device.device_system_category_layer3 == "L2")) {
if (device_master_arr.findIndex(x => x == device.device_master_number) < 0) {
device_master_arr.push(device.device_master_number);
html += `
`;
html += `
`;
html += `
`;
html += `
`;
if (device.device_master_icon != null) {
html += `
`;
}
var ifhtml = `./_FloorMap.html?building_guid=${localStorage.getItem('building_guid')}&main_system_guid=${localStorage.getItem('main_system_guid')}&sub_system_guid=${localStorage.getItem('sub_system_guid')}&floor_guid=${n.floor_guid}&device_system_category_layer3=${device.device_system_category_layer3}&device_master=${device.device_master_number}`;
var name_html = "";
if (device.device_master_full_name != null) {
name_html = `${device.device_master_full_name}
`;
}
html += `
`;
html += `
${name_html}
${device.device_master_number}
`;
html += `
`;
html += `
`;
html += `
`;
html += `
`;
html += `
`;
}
} else {
//沒有master的情況
var erbool = '';
$.keyframe.define([{
name: 'bglink123',
'0%': { 'background-color': device.device_error_color },
'80%': { 'background-color': device.device_error_color },
'81%': { 'background-color': "#FFF" },
'100%': { 'background-color': "#FFF" },
}]);
var ercolor = 0;//0:沒有,1:有顏色,2:會閃鑠
if (alarmjson == undefined || alarmjson == null) {
alarmjson = [];
}
if (device.device_error_point_name != "" && device.device_error_point_name != null && device.device_error_point_name != undefined) {
if (device.device_error_point_name == "ER") // 有ER時
{
alarmjson.filter(function (n, i) {
if (n.device_number == device.device_number) {
erbool = n.points[device.device_error_point_name];
}
})
if (erbool == "true") {
if (device.device_error_flashing == 1) {
ercolor = 2;
}
else {
ercolor = 1;
}
}
else {
ercolor = 0;
}
}
else // 非ER用其他點位時
{
alarmjson.filter(function (n, i) {
if (n.device_number == device.device_number) {
erbool = n.points[device.device_error_point_name];
}
})
if (erbool == device.device_error_point_value) {
if (device.device_error_flashing == 1) {
ercolor = 2;
}
else {
ercolor = 1;
}
}
else {
ercolor = 0;
}
}
}
if (ercolor == 0) {
html += `
`;
}
else if (ercolor == 1) {
html += `
`;
}
else {
html += `
`;
}
html += `
`;
html += `
`;
html += `
`;
if (device.device_image != null) {
html += `
`;
}
var ifhtml = `./_FloorMap.html?building_guid=${localStorage.getItem('building_guid')}&main_system_guid=${localStorage.getItem('main_system_guid')}&sub_system_guid=${localStorage.getItem('sub_system_guid')}&floor_guid=${n.floor_guid}&device_system_category_layer3=${device.device_system_category_layer3}&device_number=${device.device_number}`;
html += `
`;
html += `
${device.full_name}
${device.device_number}
`;
html += `
`
html += `
`;
html += `
`;
html += `
`;
var normalpoint = device.device_normal_point_name;
var closepoint = device.device_close_point_name;
var pointname = '';
var checker = 0;//nor:1 close:2
if (normalpoint == closepoint) {
pointname = normalpoint;
}
else {
if (normalpoint == "ER" || closepoint == "ER") {
if (normalpoint == "ER") {
checker = 1;
}
else {
checker = 2;
}
pointname = "ER";
}
else {
if (normalpoint != null && normalpoint != "ER") {
pointname = normalpoint;
}
if (closepoint != null && closepoint != "ER") {
pointname = closepoint;
}
}
}
var bool = "";
if (pointname != '') {
alarmjson.filter(function (n, i) {
if (n.device_number == device.device_number) {
bool = n.points[pointname];
}
})
}
var color = "";
if (device.device_close_point_value == bool && bool != "") {
color = device.device_close_color;
}
if (device.device_normal_point_value == bool && bool != "") {
color = device.device_normal_color;
}
if (checker == 1) {
color = device.device_normal_color;
}
else if (checker == 2) {
color = device.device_close_color;
}
html += `
`;
html += ` `;
if (device.icon_click & 1 > 0) {
// html += `
//
//
//
`;
if (device.deviceURL != null) {
html += `
詳細資料 `;
}
}
html += ``;
html += `
`;
html += `
`;
html += `
`;
}
})
html += `
`;
}
});
html += `
`;
html += `
`;
});
$('#riser-diagram').append(html);
$(".bglink").playKeyframe({
name: 'bglink123',
duration: "1s",
timingFunction: 'ease',
iterationCount: 'infinite',
});
}
function openiframe(iframeurl, width = 0, height = 0, mode = 0) {
if (mode == 0) {
$('#iframemodal > .modal-content').css("width", "80%");
$('#iframemodal > .modal-content').css("height", "85vh");
}
else {
if (width != undefined && width != null && width > 0) {
$('#iframemodal > .modal-content').css("width", width + "px");
} else {
$('#iframemodal > .modal-content').css("width", "80%");
}
if (height != undefined && height != null && height > 0) {
$('#iframemodal > .modal-content').css("height", height + "px");
} else {
$('#iframemodal > .modal-content').css("height", "85vh");
}
}
$('#iframemodal').find('.modal-body').empty();
var html = `
`;
$('#iframemodal').find('.modal-body').append(html);
$('#iframemodal').show();
}
function Turndevice() {
$('#device_onclick').modal('show');
}
//燈控排程開啟
function openlightschedule() {
//console.log(selected_subsystem);
$('#lightschedule').show();
$('#floorlist').empty();
$('#addschedulefloorlist').empty();
var floorhtml = '
全選 ';
var addfloorhtml = '';
Allfloors = new Array(0);
$.each(selected_subsystem.floors, function (ind, val) {
floorhtml += `
` + val.full_name + ` `;
if (ind == 0) {
addfloorhtml += `
` + val.full_name + ` `
}
else {
addfloorhtml += `
` + val.full_name + ` `
}
Allfloors.push(val.floor_guid);
});
$('#floorlist').append(floorhtml);
$('#addschedulefloorlist').append(addfloorhtml);
$('#allbtn').click();
$('#addschedulefloorlist').find('.btn-success').click();
}
//外層選擇樓層
function SelectTablefloor(guid, e) {
if ($(e).hasClass("btn-outline-success")) {
$(e).removeClass("btn-outline-success").addClass("btn-success");
tablefloorlist.push(guid);
} else if ($(e).hasClass("btn-success")) {
$(e).removeClass("btn-success").addClass("btn-outline-success");
var a = tablefloorlist.filter(function (n, i) {
if (n === guid) {
tablefloorlist.splice(i, 1);
}
});
}
MakeScheduleTable()
//console.log(tablefloorlist);
}
function MakeScheduleTable() {
$('#ScheduleTablediv').empty();
var html = `
`;
$('#ScheduleTablediv').append(html);
var send_data =
{
Floors: tablefloorlist,
};
var url = baseApiUrl + "api/LightSchedule/ScheduleTable";
$.ajax({
method: "post",
url: url,
data: send_data,
async: false,
dataType: 'json',
success: function (rel) {
console.log(rel);
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
else {
html = '';
rel.data.forEach(function (element, i) {
html += '
';
html += '' + Number(i + 1) + ' ';
html += '' + element.full_name + ' ';
html += '' + element.devicecount + ' ';
var talk = '';
switch (element.cycle) {
case 0: { talk += "僅一次"; break; }
case 1: { talk += "每周"; break; }
}
var week = element.week.split(",")
week.sort(function (a, b) {
return Number(a) - Number(b);
});
week.forEach(function (elemente, i) {
switch (elemente) {
case '0': { talk += "日"; break; }
case '1': { talk += "一"; break; }
case '2': { talk += "二"; break; }
case '3': { talk += "三"; break; }
case '4': { talk += "四"; break; }
case '5': { talk += "五"; break; }
case '6': { talk += "六"; break; }
}
if (i != week.length - 1) {
talk += "、";
} else {
talk += "";
}
});
talk += element.start_time + " - ";
talk += element.end_time;
html += '' + talk + ' ';
if (element.status == 0) {
html += '' + "停用" + ' ';
}
else {
html += '' + "啟用" + ' ';
}
html += '' + `觸發執行
修改
刪除 ` + ' ';
html += ' '
})
$('#ScheduleTable').find('tbody').append(html);
new simpleDatatables.DataTable('#ScheduleTable', {
searchable: false,
perPage: 10,
});
$('#ScheduleTable').parent().parent().find('.dataTable-top').empty();
}
}
})
}
function Callapi(guid) {
var url = baseApiUrl + "api/LightSchedule/SendAPI";
var send_data =
{
guid: guid
};
$.ajax({
method: "post",
url: url,
data: send_data,
async: false,
dataType: 'json',
success: function (rel) {
if (rel.code != "0000") {
toast_error("觸發失敗");
}
else {
toast_ok("已觸發");
}
}
});
}
function GetOneschedule(guid) {
resetSchedule();
var send_data =
{
schedule_guid: guid
};
var url = baseApiUrl + "api/LightSchedule/GetOneschedule";
AllDevicebool = false;
$.ajax({
method: "post",
url: url,
data: send_data,
async: false,
dataType: 'json',
success: function (rel) {
console.log(rel);
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
else {
schedule_guid = rel.data.light_schedule_guid;
$('#bt_' + rel.data.floor_guid).click();
$('#ScheduleFullName').val(rel.data.full_name);
var weekbacklist = rel.data.week.split(',');
weekbacklist.forEach(function (elemente, i) {
switch (elemente) {
case '0': { $('#weekselect').find('.bt0').click(); break; }
case '1': { $('#weekselect').find('.bt1').click(); break; }
case '2': { $('#weekselect').find('.bt2').click(); break; }
case '3': { $('#weekselect').find('.bt3').click(); break; }
case '4': { $('#weekselect').find('.bt4').click(); break; }
case '5': { $('#weekselect').find('.bt5').click(); break; }
case '6': { $('#weekselect').find('.bt6').click(); break; }
}
});
$("input[name*='cycle'][value='" + rel.data.cycle + "']").prop("checked", true);
$("input[name*='status'][value='" + rel.data.status + "']").prop("checked", true);
$('#StartTime').val(rel.data.start_time);
$('#EndTime').val(rel.data.end_time);
$('#ScheduleFullName').val(rel.data.full_name);
$('#addschedulefloorlist').find('.btn').attr('disabled', true);
$('#addlightschedule').show();
}
}
})
}
function DeleteSchedule(guid) {
Swal.fire(
{
title: "刪除",
text: "你確定是否刪除此筆資料?",
type: "warning",
icon: 'warning',
showCancelButton: true,
confirmButtonText: "是",
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
var send_data =
{
schedule_guid: guid
};
var url = baseApiUrl + "api/LightSchedule/DeleteSchedule";
$.ajax({
method: "post",
url: url,
data: send_data,
async: false,
dataType: 'json',
success: function (rel) {
console.log(rel);
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
else {
toast_ok("刪除成功");
MakeScheduleTable();
}
}
})
}
});
}
function closemodal(modalid) {
//toast_ok("關閉");
Allfloorsbool = false;
$('#' + modalid).hide();
}
//新增排程
function Addschedule() {
resetSchedule();
schedule_guid = '';
$('#addschedulefloorlist').find('.btn').first().click();
$('#addlightschedule').show();
}
//選擇設備樓層
function SelectDevicefloor(floorguid, e) {
selectfloorguid = floorguid;
$(e).parent().find('.btn-success').removeClass('btn-success').addClass('btn-secondary');
$(e).removeClass('btn-secondary').addClass('btn-success');
var send_data =
{
building_guid: localStorage.getItem('building_guid'),
sub_system_guid: localStorage.getItem('sub_system_guid'),
floor_guid: floorguid,
schedule_guid: schedule_guid
};
//$('#devicetable').find('tbody').empty();
var url = baseApiUrl + "api/LightSchedule/GetLightDevice";
$.ajax({
method: "post",
url: url,
data: send_data,
async: false,
dataType: 'json',
success: function (rel) {
console.log(rel);
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
else {
devicelist = rel.data;
AllDevicebool = false;
MakeDeviceTable();
}
}
})
}
//生成設備Table
function MakeDeviceTable() {
$('#devicetablediv').empty();
var html = `
全選設備
`;
$('#devicetablediv').append(html);
$('#devicetable').find('tbody').empty();
selectdeviceList = [];
var html = '';
devicelist.forEach(function (element, i) {
html += '
';
if (allcheck) {
if (AllDevicebool) {
html += '' + ' ' + ' ';
selectdeviceList.push(element.device_guid);
} else {
html += '' + ' ' + ' ';
selectdeviceList = [];
}
}
else {
if (element.check == 0) {
html += '' + ' ' + ' ';
}
else {
html += '' + ' ' + ' ';
selectdeviceList.push(element.device_guid);
}
}
html += '' + element.device_number + ' ';
html += '' + element.full_name + ' ';
html += ' '
})
allcheck = false;
$('#devicetable').find('tbody').append(html);
new simpleDatatables.DataTable('#devicetable', {
searchable: false,
perPage: 10,
});
$('#devicetable').parent().parent().find('.dataTable-top').empty();
}
//設備全選
function SelectAllDevice() {
allcheck = true;
if (AllDevicebool) {
AllDevicebool = false;
}
else {
AllDevicebool = true;
}
MakeDeviceTable();
}
function SelectAllFloor() {
if (Allfloorsbool) {
$('#floorlist').find('.btn-success').removeClass('btn-success').addClass('btn-outline-success');
tablefloorlist = [];
Allfloorsbool = false;
}
else {
tablefloorlist = Allfloors
$('#floorlist').find('.btn-outline-success').removeClass('btn-outline-success').addClass('btn-success');
Allfloorsbool = true;
}
MakeScheduleTable();
}
//選擇星期
function SelectWeek(week, e) {
if ($(e).hasClass("btn-outline-success")) {
$(e).removeClass("btn-outline-success").addClass("btn-success");
weekList.push(week);
} else if ($(e).hasClass("btn-success")) {
$(e).removeClass("btn-success").addClass("btn-outline-success");
var a = weekList.filter(function (n, i) {
if (n === week) {
weekList.splice(i, 1);
}
});
}
//console.log(weekList);
}
//勾選設備
function SelectDevice(e) {
if ($(e).attr('checked')) {
$(e).removeAttr('checked');
selectdeviceList.filter(function (n, i) {
if (n === $(e).val()) {
selectdeviceList.splice(i, 1);
}
});
}
else {
$(e).attr("checked", true);
selectdeviceList.push($(e).val());
}
//console.log(selectdeviceList);
}
function resetSchedule() {
$('#addschedulefloorlist').find('.btn').attr('disabled', false);
$('#ScheduleFullName').val('');
weekList = new Array(0);
$('#weekselect').find('.btn-success').removeClass('btn-success').addClass('btn-outline-success');
$("input[name*='cycle'][value='0']").prop("checked", true);
$("input[name*='status'][value='0']").prop("checked", true);
$('#StartTime').val('');
$('#EndTime').val('');
}
function SaveSchedule() {
var alerthtml = "";
if ($('#ScheduleFullName').val() == "") {
alerthtml += '沒有填寫名稱
';
}
if (weekList.length == 0) {
alerthtml += '沒選擇週期
';
}
if ($('#StartTime').val() == "") {
alerthtml += '沒選擇開始時間
';
}
if ($('#EndTime').val() == "") {
alerthtml += '沒選擇結束時間
';
}
if (selectdeviceList.length == 0) {
alerthtml += '沒選擇設備
';
}
if (alerthtml != "") {
Swal.fire(
{
title: "儲存失敗",
icon: 'warning',
html: "原因:
" + alerthtml,
});
return;
}
var send_data = {
light_schedule_guid: schedule_guid,
full_name: $('#ScheduleFullName').val(),
week: weekList.join(),
cycle: $('input[name="cycle"]:checked').val(),
floor_guid: selectfloorguid,
start_time: $('#StartTime').val(),
end_time: $('#EndTime').val(),
status: $('input[name="status"]:checked').val(),
devicelist: selectdeviceList
}
var url = baseApiUrl + "api/LightSchedule/SaveSchedule";
$.ajax({
method: "post",
url: url,
data: send_data,
async: false,
dataType: 'json',
success: function (rel) {
console.log(rel);
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
else {
toast_ok("儲存成功");
$('#addlightschedule').hide();
MakeScheduleTable();
}
}
})
}
function initLoad() {
send_data = {
building_guid: localStorage.getItem('building_guid'),
main_system_guid: localStorage.getItem('main_system_guid'),
sub_system_guid: localStorage.getItem('sub_system_guid')
}
console.log("我要來抓設備資料囉");
var init_start = new Date(Date.now());
$.ajax({
url: baseApiUrl + 'api/GetDevice',
data: send_data,
type: 'POST',
dataType: 'json',
success: function (code, statut) {
console.log("取得設備資訊-花費時間", (new Date(Date.now()).getTime() - init_start.getTime()) / 1000 + "sec");
getdeviceresult = code;
code.data.forEach(function (item, index) {
item.device.forEach(function (device_item, device_index) {
current_devices.push(device_item)
});
});
// myBaja.setPrepareSubscribeDevices(current_devices);
// myBaja.setCallBack(myFunc)
var light_html = "";
//抓出第一筆設備來帶代表上方狀態
if (code.data != undefined && code.data != null && code.data.length > 0) {
$("#light-description").empty();
if (code.data[0].device[0].device_system_category_layer3 != "L1" && code.data[0].device[0].device_system_category_layer3 != "L2") {
temp_light = code.data[0].device[0];
if (temp_light.device_normal_text != undefined && temp_light.device_normal_text != null) {
light_html += `
${temp_light.device_normal_text} `;
}
if (temp_light.device_close_text != undefined && temp_light.device_close_text != null) {
light_html += `
${temp_light.device_close_text} `;
}
if (temp_light.device_error_text != undefined && temp_light.device_error_text != null) {
light_html += `
${temp_light.device_error_text} `;
}
$.keyframe.define([{
name: 'bglinkErrorColor',
'0%': { 'background-color': temp_light.device_error_color },
'80%': { 'background-color': temp_light.device_error_color },
'81%': { 'background-color': "#FFF" },
'100%': { 'background-color': "#FFF" },
}]);
$("#light-description").append(light_html);
}
}
var render_start = new Date(Date.now());
makedeviceRiser();
console.log("Render昇位圖-花費時間", (new Date(Date.now()).getTime() - render_start.getTime()) / 1000 + "sec");
console.log("準備進入執行BQL訂閱Function");
ordPath = {
"building_tag": localStorage.getItem('device_building_tag'),
"system_tag": localStorage.getItem('device_system_tag')
}
myBaja.setSubscribeDevicesByBql(ordPath);
myBaja.setSubscribeDevicesCallBack(subscribeCallBack);
}
});
function subscribeCallBack(change_device) {
if (change_device != undefined && change_device != null) {
var target_device = current_devices.filter(x => x.device_number == change_device.device_number)[0];
//判斷點位是否為燈號控制的點位
if (change_device.point_name != undefined &&
change_device.point_name != null &&
change_device.point_name != "" &&
target_device != undefined &&
(change_device.point_name == target_device.device_normal_point_name ||
change_device.point_name == target_device.device_close_point_name ||
change_device.point_name == target_device.device_error_point_name)) {
//判斷 欲修改的點位是否為設備異常燈號點位
if (change_device.point_name == target_device.device_error_point_name) {
if (target_device.device_error_point_name == "ER") { //為ER點位的判斷
if (change_device.value == "true") { //目標設備點位發生異常
if (target_device.device_error_flashing == 1) {
$(`#${target_device.device_number}`).addClass("bglink");
} else {
$(`#${target_device.device_number}`).removeClass("bglink").removeAttr("style").css("width", "300px");
$(`#${target_device.device_number}`).css("background-color", target_device.device_error_color);
}
} else { //目標設備點位未發生異常
$(`#${target_device.device_number}`).removeClass("bglink").removeAttr("style").css("width", "300px");
$(`#${target_device.device_number}`).css("background-color", "#FFF");
}
} else {
if (change_device.value == target_device.device_error_point_value) { //目標設備點位發生異常
if (target_device.device_error_flashing == 1) {
$(`#${target_device.device_number}`).addClass("bglink");
} else {
$(`#${target_device.device_number}`).removeClass("bglink").removeAttr("style").css("width", "300px");
$(`#${target_device.device_number}`).css("background-color", target_device.device_error_color);
}
} else { //目標設備點位未發生異常
$(`#${target_device.device_number}`).removeClass("bglink").removeAttr("style").css("width", "300px");
$(`#${target_device.device_number}`).css("background-color", "#FFF");
}
}
$(".bglink").playKeyframe({
name: 'bglinkErrorColor',
duration: "1s",
timingFunction: 'ease',
iterationCount: 'infinite',
});
}
//判斷 欲修改的點位是否為設備燈號點位
if (change_device.point_name == target_device.device_normal_point_name ||
change_device.point_name == target_device.device_close_point_name) {
//判斷 設備正常與關閉點位設定是否相同
if (target_device.device_normal_point_name == target_device.device_close_point_name) { //相同
if (change_device.value == target_device.device_normal_point_value) {
$(`#${target_device.device_number}_status`).css("background-color", target_device.device_normal_color);
} else if (change_device.value == target_device.device_close_point_value) {
$(`#${target_device.device_number}_status`).css("background-color", target_device.device_close_color);
}
} else { //不相同
//判斷正常或關閉是否有點位為ER
if ((target_device.device_normal_point_name != undefined && target_device.device_normal_point_name == "ER") ||
(target_device.device_close_point_name != undefined && target_device.device_close_point_name == "ER")) {
if (change_device.point_name == target_device.device_normal_point_name &&
target_device.device_normal_point_name == "ER") {
$(`#${target_device.device_number}_status`).css("background-color", target_device.device_normal_color);
} else if (change_device.point_name == target_device.device_close_point_name &&
target_device.device_close_point_name == "ER") {
$(`#${target_device.device_number}_status`).css("background-color", target_device.device_close_color);
}
} else { //正常、異常不是為ER點位
if (change_device.point_name == target_device.device_normal_point_name) {
if (change_device.value == target_device.device_normal_point_value) {
$(`#${target_device.device_number}_status`).css("background-color", target_device.device_normal_color);
} else {
$(`#${target_device.device_number}_status`).css("background-color", '');
}
} else if (modify_target_device.point_name == target_device.device_close_point_name) {
if (change_device.value == target_device.device_close_point_value) {
$(`#${target_device.device_number}_status`).css("background-color", target_device.device_close_color);
} else {
$(`#${target_device.device_number}_status`).css("background-color", '');
}
}
}
}
}
}
else if (
target_device != undefined &&
change_device.point_name == target_device.points) {
$(`#${target_device.device_number}_${target_device.points}`).html(change_device.value);
}
}
}
}
//繪製昇位圖內容
function makedeviceRiser() {
if (selected_subsystem == undefined) {
return;
}
$('#riser-diagram').empty();
selected_subsystem.floors.forEach(floor => {
var html = "";
html += `
`;
html += `
`;
//因改為跳出新視窗所以註解
// html += ``;
var floorparam = `?building_guid=${localStorage.getItem('building_guid')}&main_system_guid=${localStorage.getItem('main_system_guid')}&sub_system_guid=${localStorage.getItem('sub_system_guid')}&floor_guid=${floor.floor_guid}`;
html += ``;
var device_master_arr = [];
var select_floor_device = getdeviceresult.data.find(x => x.floor_guid == floor.floor_guid);
html += `
`;
select_floor_device.device.forEach(device => {
if (device.device_master_number != undefined && device.device_master_number != null && (device.device_system_category_layer3 == "L1" || device.device_system_category_layer3 == "L2")) {
if (device_master_arr.findIndex(x => x == device.device_master_number) < 0) {
device_master_arr.push(device.device_master_number);
html += `
`;
html += `
`;
html += `
`;
html += `
`;
if (device.device_master_icon != null) {
html += `
`;
}
var ifhtml = `./_FloorMap.html?building_guid=${localStorage.getItem('building_guid')}&main_system_guid=${localStorage.getItem('main_system_guid')}&sub_system_guid=${localStorage.getItem('sub_system_guid')}&floor_guid=${select_floor_device.floor_guid}&device_system_category_layer3=${device.device_system_category_layer3}&device_master=${device.device_master_number}`;
var name_html = "";
if (device.device_master_full_name != null) {
name_html = `${device.device_master_full_name}
`;
}
html += `
`;
// html += `
// ${name_html}
// ${device.device_master_number}
// `;
var param = `?building_guid=${localStorage.getItem('building_guid')}&main_system_guid=${localStorage.getItem('main_system_guid')}&sub_system_guid=${localStorage.getItem('sub_system_guid')}&floor_guid=${select_floor_device.floor_guid}&device_system_category_layer3=${device.device_system_category_layer3}&device_master=${device.device_master_number}`
html += `
${name_html}
${device.device_master_number}
`;
html += `
`;
if (OpenChange) {
html += `
更改名稱`;
}
html += `
`;
html += `
`;
html += `
`;
html += `
`;
}
} else {
html += `
`;
html += `
`;
html += `
`;
html += `
`;
if (device.device_image != null) {
html += `
`;
}
var ifhtml = `./_FloorMap.html?building_guid=${localStorage.getItem('building_guid')}&main_system_guid=${localStorage.getItem('main_system_guid')}&sub_system_guid=${localStorage.getItem('sub_system_guid')}&floor_guid=${select_floor_device.floor_guid}&device_system_category_layer3=${device.device_system_category_layer3}&device_number=${device.device_number}`;
if (device.device_system_category_layer3 == 'C') {
ifhtml += "&show_cctv=1"
}
html += `
`;
// html += `
// ${device.full_name}
//
// ${device.device_number}
// `;
var param = `?building_guid=${localStorage.getItem('building_guid')}&main_system_guid=${localStorage.getItem('main_system_guid')}&sub_system_guid=${localStorage.getItem('sub_system_guid')}&floor_guid=${select_floor_device.floor_guid}&device_system_category_layer3=${device.device_system_category_layer3}&device_master=${device.device_master_number}`
if (device.device_system_category_layer3 == 'C') {
param += "&show_cctv=1"
}
html += `
${device.full_name}
${device.device_number}
`;
html += `
`;
html += ``;
html += `
`;
html += `
`;
html += `
`;
html += `
`;
html += ` `;
// html += ` `;
if (device.points != undefined && device.points != null) {
html += `${device.point_name} : `
}
if (device.icon_click & 1 > 0) {
if (device.deviceURL != null) {
html += ` 詳細資料 `;
}
}
if (OpenChange) {
html += ` 更改名稱 `;
}
html += `
`;
html += `
`;
html += `
`;
html += `
`;
}
})
html += `
`;
html += `
`;
html += `
`;
$('#riser-diagram').append(html);
});
}