//创建楼层选择器 function creatFloorChoose() { var floorsign = `
`; $('#div2d').append($(floorsign)); var car = app.query(".Floor") var html = `` for(let i = 0 ; i < car.length; i++){ html += `
${car[i].id}
` } $('#floorChooseDiv').append($(html)); $('head').append($(` `)); } //楼层切换 function floorclick(id) { // test(); // delMydiv(); // floormen = id.id; // building = app.buildings[0]; // var num = floormen.substring(1, 3); // var s = parseInt(num); // var floor = building.floors[s - 1]; var floor = app.query("#" + id)[0]; app.level.change(floor); // creatbutType(s); creatbutElement(id) } // 点击右侧侧边栏开关 function handleSide() { if ($('#rightSideSwitch').attr('value') == 'close') { $('.closeIocn').animate({ right: 48 }, 300); $('.showFloorBtn').animate({ right: 0 }, 300); // $('#rightSideSwitch').attr('value', 'open'); $('#rightSideSwitch').attr('value', 'open').css('background-image', 'url(/uploads/wechat/163607/file/杨浦16/icons/yCRGIf.png)'); } else if ($('#rightSideSwitch').attr('value') == 'open') { $('.closeIocn').animate({ right: 0 }, 300); $('.showFloorBtn').animate({ right: -52 }, 300); $('#rightSideSwitch').attr('value', 'close').css('background-image', 'url(/uploads/wechat/163607/file/杨浦16/icons/yCR8dP.png)'); // $('#rightSideSwitch').attr('value', 'close'); } } //设备类型div删除 function delMydiv() { var mydiv = document.getElementById("bottomBtnsRight") if (mydiv) { if (mydiv != null) mydiv.parentNode.removeChild(mydiv); } } //设备类型选择器 function creatbutElement(floorNum) { if(floorNum == "B1"){ floorNum = "F-1" } delMydiv(); var devType = []; var data = cleanObj(buildingStore); for (var i = 0; i < data.length; i++) { var floorData = data[i] var floorId = floorData.min_level; var num = floorNum.substring(1, 3); var s = parseInt(num) if (floorId == s) { var dataArray = floorData.item; if (dataArray) { for (var q = 0; q < dataArray.length; q++) { var eee = dataArray[q].dwtype; devType.push(eee); } } break; } } var darray = uniq(devType); var textAndPictureMarkerHtml = `
`; $('#div2d').append($(textAndPictureMarkerHtml)); var cont = 1; console.log(darray) darray.forEach(function (name) { if (name == "YTVA") { var yTVAHtml = `
视频告警监测
`; $('#bottomBtnsRight').append($(yTVAHtml)); } else if (name == "YTWP") { var yTVAHtml = `
水压监测
`; $('#bottomBtnsRight').append($(yTVAHtml)); } else if (name == "YTCI") { var yTVAHtml = `
环境监测
`; $('#bottomBtnsRight').append($(yTVAHtml)); } else if (name == "YTEF") { var yTVAHtml = `
电气火灾监测
`; $('#bottomBtnsRight').append($(yTVAHtml)); } else if (name == "YTFC") { var yTVAHtml = `
消防控制柜
`; $('#bottomBtnsRight').append($(yTVAHtml)); } else if (name == "YTSM") { var yTVAHtml = `
烟感
`; $('#bottomBtnsRight').append($(yTVAHtml)); } else if (name == "YTLL") { var yTVAHtml = `
液位
`; $('#bottomBtnsRight').append($(yTVAHtml)); } else if (name == "YTWI") { var yTVAHtml = `
水浸
`; $('#bottomBtnsRight').append($(yTVAHtml)); }else if (name == "YTWG") { var yTVAHtml = `
网关
`; $('#bottomBtnsRight').append($(yTVAHtml)); }else if (name == "YTRU") { var yTVAHtml = `
路由
`; $('#bottomBtnsRight').append($(yTVAHtml)); } }) $('head').append($(` `)); } //创建设备点位标识 function icon_click(deviceType, floorNum) { buildingStore; deviceList = []; for (var i = 0; i < buildingStore.length; i++) { if (floorNum == buildingStore[i].min_level) { deviceList.push(buildingStore[i]); } } create_ui(deviceType, floorNum, deviceList); }