IGD3000系列(一体屏)网关的app和文件系统的打包目录
local/www/js/page/three-img.js
@@ -20,50 +20,58 @@
var testList = [
    {
        "id":"21",
        "id":"2211",
        "name":"温湿度#1",
        "category":"2001",
        "type":"0",
        "leftV":"0.4840",
        "topV":"0.2015",
        "value":[{
            "passcode":"3",
            "name":"温度",
            "value":"18"
        },{
            "passcode":"4",
            "name":"湿度",
            "value":"60"
        }]
    },{
        "id":"2",
        "name":"温湿度#1",
        "category":"2001",
        "type":"0",
        "leftV":"0.4840",
        "topV":"0.2015",
        "value":[{
            "passcode":"3",
            "name":"温度",
            "value":"18"
        },{
            "passcode":"4",
            "name":"湿度",
            "value":"60"
        }]
    },{
        "id":"3",
        "name":"精密空调#1",
        "category":"3004",
        "type":"0",
        "leftV":"0.4040",
        "topV":"0.2515",
        "value":[{
            "passcode":"2",
            "name":"温度",
            "value":"1"
        },{
            "passcode":"3",
            "name":"温度",
            "value":"18"
        },{
            "passcode":"4",
            "name":"湿度",
            "value":"60"
        }]
    },{
        "id":"2221",
        "name":"温湿度#1",
        "category":"2002",
        "type":"0",
        "leftV":"0.4840",
        "topV":"0.2015",
        "value":[{
            "passcode":"3",
            "name":"温度",
            "value":"18"
        },{
            "passcode":"4",
            "name":"湿度",
            "value":"60"
        }]
    },{
        "id":"3331",
        "name":"精密空调#1",
        "category":"2002",
        "type":"0",
        "leftV":"0.6840",
        "topV":"0.5015",
        "value":[{
            "passcode":"1",
            "name":"温度",
            "value":"18"
            "value":"1"
        },{
            "passcode":"2",
            "name":"温度",
            "value":"1"
        },{
            "passcode":"3",
            "name":"湿度",
            "value":"60"
        }]
@@ -144,7 +152,9 @@
    if(imgData){
        $("#img-three").attr('src', imgData);
    }
    // $("#img-three").css("height", imgHei);
    $("#img-three").css("height", imgHei);
    // $("#img-three").css("width", "100%");
    $("#img-three").show();
};
//获取设备列表,渲染显示设备信息
@@ -179,74 +189,113 @@
    var tagValue;
    var category;
    var recordMap;
    var warnState;
    var warnState = 0;
    var i;
    console.log("=========所有设备信息=========");
    console.log(listDevice);
    var name;
    var warnStr = " warn-div ";
    // console.log("=========所有设备信息=========");
    // console.log(listDevice);
    $.each(listDevice, function (index, device) {
        i = index;
        left = (parentWidth * device.leftV).toFixed(4);
        top = (parentHeight * device.topV).toFixed(4);
        category = device.category;//设备类型
        id = device.id;//设备ID
        if(id && category){
            if(category != CATEGORY.D2090.code && category != CATEGORY.D2091.code){
                recordMap = device.value;//设备监控属性集合
                warnState = device.type;
                tagValue = addCurData(category, recordMap, warnState,device);
                temp = "";
                if(device.id == thId1 || device.id == thId2){
                    if(device.id == thId1){
                        thData1 = device;
        name = device.name;
        if(category != CATEGORY.D3009.code){
            if(id && category){
                if(category != CATEGORY.D2090.code && category != CATEGORY.D2091.code){
                    recordMap = device.value;//设备监控属性集合
                    warnState = device.type;
                    tagValue = addCurData(category, recordMap, warnState,device);
                    warnState = tagValue.warnState;
                    if(warnState == 0){
                        warnStr = "";
                    }else{
                        thData2 = device;
                    }
                    temp += "<div id='" + device.id
                        + "' class='tip arrow_box'  style='left:" + left+ "px;top:" + top + "px;display: none;' "
                        + "name='" + device.name + "' category='" + category + "' index='" + index + "'>";
                    temp += "<div class = 'div-c'>";
                    temp += "</div>";
                    temp += "<div class = 'div-d' style='font-size: 14px;'><p style='margin-bottom: 5px;'><span>露点温度1</span><span style='margin-left: 10%;'>露点温度2</span></p>" +
                        "<p><span style='margin-left: 1%;background-color: rgba(21, 221, 86, 1);padding: 0% 5%;'>22.2℃</span>" +
                        "<span style='margin-left: 15%;background-color: rgba(21, 221, 86, 1);padding: 0% 5%;'>22.2℃</span></div>";
                    temp += "</div>";
                }else{
                    if ("FULL" == tagValue.code) {
                        temp += "<div id='" + device.id
                            + "' class='tip arrow_box'  style='left:" + left+ "px;top:" + top + "px;' "
                            + "name='" + device.name + "' category='" + category + "' index='" + index + "'>";
                    } else {
                        temp += "<div id='" + device.id
                            + "' class='tip arrow_min'  style='left:" + left + "px;top:" + top + "px;' "
                            + "name='" + device.name + "' category='" + category + "' index='" + index + "'>";
                        warnStr = " warn-div ";
                    }
                    temp += "<div class = 'div-c'>";
                    temp += addCurImg(category);
                    temp += "</div>";
                    temp += tagValue.htm;
                    temp += "</div>";
                }
                // if(category == CATEGORY.D3001.code){
                //     console.log("=========门禁设备=========设备信息:");
                //     console.log(device);
                // }
                    temp = "";
                    if(device.id == thId1 || device.id == thId2){
                        if(device.id == thId1){
                            thData1 = device;
                        }else{
                            thData2 = device;
                        }
                        temp += "<div id='" + device.id
                            + "' class='tip arrow_box "+warnStr+"'  style='left:" + left+ "px;top:" + top + "px;display: none;' "
                            + "name='" + device.name + "' category='" + category + "' index='" + index + "'>";
                        temp += "<div class = 'div-c'>";
                        temp += "</div>";
                        temp += "<div class = 'div-d' style='font-size: 14px;'><p style='margin-bottom: 5px;'><span>露点温度1</span><span style='margin-left: 10%;'>露点温度2</span></p>" +
                            "<p><span style='margin-left: 1%;background-color: rgba(21, 221, 86, 1);padding: 0% 5%;'>22.2℃</span>" +
                            "<span style='margin-left: 15%;background-color: rgba(21, 221, 86, 1);padding: 0% 5%;'>22.2℃</span></div>";
                        temp += "</div>";
                if(device.id != "1001" && device.id != "1002"){
                    }else{
                        if ("FULL" == tagValue.code) {
                            temp += "<div id='" + device.id
                                + "' class='tip arrow_box "+warnStr+"'  style='left:" + left+ "px;top:" + top + "px;' "
                                + "name='" + device.name + "' category='" + category + "' index='" + index + "'>";
                            temp += "<div class = 'div-c'>";
                            temp += addCurImg(category,warnState);
                            temp += "</div>";
                            temp += tagValue.htm;
                            // temp += "<div class = 'div-d' style='margin-top: -5px;'>";
                            // temp += "<span style='padding: 2px;background-color: #524c4c;color: white;'>";
                            // temp += name;
                            // temp += "</span>";
                            // temp += "</div>";
                            temp += "</div>";
                        } else {
                            temp += "<div id='" + device.id
                                + "' class='tip arrow_min "+warnStr+"'  style='left:" + left + "px;top:" + top + "px;' "
                                + "name='" + device.name + "' category='" + category + "' index='" + index + "'>";
                            temp += "<div class = 'div-c'>";
                            temp += addCurImg(category,warnState);
                            temp += "</div>";
                            temp += tagValue.htm;
                            // temp += "<div class = 'div-d' style='margin-top: -10px;'>";
                            // temp += "<span style='padding: 2px;background-color: #524c4c;color: white;'>";
                            // temp += name;
                            // temp += "</span>";
                            // temp += "</div>";
                            temp += "</div>";
                        }
                        // temp += "<div class = 'div-c'>";
                        // temp += addCurImg(category);
                        // temp += "</div>";
                        // temp += tagValue.htm;
                        // temp += "</div>";
                    }
                    // if(category == CATEGORY.D3001.code){
                    //     console.log("=========门禁设备=========设备信息:");
                    //     console.log(device);
                    // }
                    // if(device.id != "1001" && device.id != "1002"){
                    //     //删除原有元素,在进行追加
                    //     $("#"+device.id).remove();
                    //     parent.append(temp);
                    //
                    // }
                    //删除原有元素,在进行追加
                    $("#"+device.id).remove();
                    parent.append(temp);
                }
                // //删除原有元素,在进行追加
                // $("#"+device.id).remove();
                // parent.append(temp);
            }else{
                console.log("=========没有获取到该设备的设备id(类型)=========设备信息:");
                console.log(device);
            }
        }else{
            console.log("=========没有获取到该设备的设备id(类型)=========设备信息:");
            console.log(device);
        }
    });
@@ -308,25 +357,25 @@
            name = "温感";
        }
        if (category == CATEGORY.D3004.code) {
            // url = "./detail-video.html?id=999&type=" + category;
            // name = "视频";
            var html = '';
            html += '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" ';
            html += 'src="./detail-video-pop.html?id='+deviceId+'&type='+category+'" ';
            html += ' frameborder="0" data-id="detail-ty-2.html" seamless></iframe>';
            $("#video .popCon").html(html);
            $("#device-name").text(name);
            layer.open({
                skin: 'mypop',
                type: 1,
                title: false,
                area: ['100%', '100%'],
                closeBtn: 0,
                shade: 0,
                scrollbar: false,
                content: $('#video')
            });
            return;
            url = "./detail-video.html?id=999&type=" + category;
            name = "视频";
            // var html = '';
            // html += '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" ';
            // html += 'src="./detail-video-pop.html?id='+deviceId+'&type='+category+'" ';
            // html += ' frameborder="0" data-id="detail-ty-2.html" seamless></iframe>';
            // $("#video .popCon").html(html);
            // $("#device-name").text(name);
            // layer.open({
            //     skin: 'mypop',
            //     type: 1,
            //     title: false,
            //     area: ['100%', '100%'],
            //     closeBtn: 0,
            //     shade: 0,
            //     scrollbar: false,
            //     content: $('#video')
            // });
            // return;
        }
        // console.log("===================跳转==================");
        // console.log("url="+url);
@@ -586,20 +635,22 @@
            recordMap[record[i].passcode] = record[i];
        }
    }
    var result = {code: "FULL", htm: ""};
    var result = {code: "FULL", htm: "",warnState:0};
    var temp = "";
    //温湿度-只显示温度和湿度
    // //温湿度-只显示温度和湿度
    if (category == CATEGORY.D2001.code) {
        if(recordMap){
            if(recordMap[1] && recordMap[1].value == 1){
                temp += "<div class = 'div-d font-warn'>";
                // temp += "<p><span>"+device.name+"</span></p>";
                temp += "<p><span>通讯异常</span></p>";
                result.warnState = 1;
            }else{
                if(recordMap[2] && recordMap[2].value == 1){
                    temp += "<div class = 'div-d font-warn'>";
                    // temp += "<p><span>"+device.name+"</span></p>";
                    // temp += "<p><span>报警</span></p>";
                    result.warnState = 1;
                }else{
                    temp += "<div class = 'div-d'>";
                    // temp += "<p><span>"+device.name+"</span></p>";
@@ -616,6 +667,7 @@
            temp += "<div class = 'div-d font-warn'>";
            temp += "<p><span>"+device.name+"</span></p>";
            temp += "<p><span>通讯异常</span></p>";
            result.warnState = 1;
        }
        temp += "</div>";
        result.htm = temp;
@@ -628,108 +680,114 @@
                temp += "<div class = 'div-d font-warn'>";
                // temp += "<p><span>"+device.name+"</span></p>";
                temp += "<p><span>通讯异常</span></p>";
                result.warnState = 1;
            }else{
                if(recordMap[2] && recordMap[2].value == 1){
                    temp += "<div class = 'div-d font-warn'>";
                    // temp += "<p><span>"+device.name+"</span></p>";
                    // temp += "<p><span>报警</span></p>";
                    result.warnState = 1;
                }else{
                    temp += "<div class = 'div-d'>";
                    // temp += "<p><span>"+device.name+"</span></p>";
                    // temp += "<p><span>正常</span></p>";
                }
                if (recordMap[6]) {
                    temp += "<p><span>设定温度:" + recordMap[7].value + "℃</span></p>";
                }
                if (recordMap[6]) {
                    temp += "<p><span>设定湿度:" + recordMap[7].value + "%</span></p>";
                }
            }
        }else{
            temp += "<div class = 'div-d font-warn'>";
            temp += "<p><span>"+device.name+"</span></p>";
            temp += "<p><span>通讯异常</span></p>";
        }
        temp += "</div>";
        result.htm = temp;
        return result;
    }
    //普通空调
    if (category == CATEGORY.D2003.code) {
        if(recordMap){
            if(recordMap[1] && recordMap[1].value == 1){
                temp += "<div class = 'div-d font-warn'>";
                // temp += "<p><span>"+device.name+"</span></p>";
                temp += "<p><span>通讯异常</span></p>";
            }else{
                if(recordMap[2] && recordMap[2].value == 1){
                    temp += "<div class = 'div-d font-warn'>";
                    // temp += "<p><span>"+device.name+"</span></p>";
                    // temp += "<p><span>报警</span></p>";
                }else{
                    temp += "<div class = 'div-d'>";
                    // temp += "<p><span>"+device.name+"</span></p>";
                    // temp += "<p><span>正常</span></p>";
                }
                if (recordMap[3]) {
                    temp += "<p><span>设定温度:" + recordMap[3].value + "℃</span></p>";
                }
                if (recordMap[4]) {
                    temp += "<p><span>设定湿度:" + recordMap[4].value + "%</span></p>";
                    temp += "<p><span>室内温度:" + recordMap[4].value + "℃</span></p>";
                }
                if (recordMap[5]) {
                    temp += "<p><span>室内湿度:" + recordMap[5].value + "%</span></p>";
                }
                if (recordMap[6]) {
                    temp += "<p><span>设定温度" + recordMap[6].value + "℃</span></p>";
                }
            }
        }else{
            temp += "<div class = 'div-d font-warn'>";
            temp += "<p><span>"+device.name+"</span></p>";
            temp += "<p><span>通讯异常</span></p>";
            result.warnState = 1;
        }
        temp += "</div>";
        result.htm = temp;
        return result;
    }
    //电池
    if (category == CATEGORY.D1005.code) {
        if(recordMap){
            if(recordMap[1] && recordMap[1].value == 1){
                temp += "<div class = 'div-d font-warn'>";
                // temp += "<p><span>"+device.name+"</span></p>";
                temp += "<p><span>通讯异常</span></p>";
            }else{
                if(recordMap[2] && recordMap[2].value == 1){
                    temp += "<div class = 'div-d font-warn'>";
                    // temp += "<p><span>"+device.name+"</span></p>";
                    // temp += "<p><span>报警</span></p>";
                }else{
                    temp += "<div class = 'div-d'>";
                    // temp += "<p><span>"+device.name+"</span></p>";
                    // temp += "<p><span>正常</span></p>";
                }
                if (recordMap[125]) {
                    temp += "<p><span>总 电 压:" + recordMap[125].value + "</span></p>";
                }
                if (recordMap[124]) {
                    temp += "<p><span>总 电 流:" + recordMap[124].value + "</span></p>";
                }
                // if (recordMap[3]) {
                //     temp += "<p><span>电池个数:" + recordMap[3].value + "</span></p>";
                // }
                // if (recordMap[126]) {
                //     temp += "<p><span>后备时间:" + recordMap[126].value + "</span></p>";
                // }
            }
        }else{
            temp += "<div class = 'div-d font-warn'>";
            temp += "<p><span>"+device.name+"</span></p>";
            temp += "<p><span>通讯异常</span></p>";
        }
        temp += "</div>";
        // temp += "</marquee>";
        result.htm = temp;
        return result;
    }
    // //普通空调
    // if (category == CATEGORY.D2003.code) {
    //     if(recordMap){
    //         if(recordMap[1] && recordMap[1].value == 1){
    //             temp += "<div class = 'div-d font-warn'>";
    //             // temp += "<p><span>"+device.name+"</span></p>";
    //             temp += "<p><span>通讯异常</span></p>";
    //         }else{
    //             if(recordMap[2] && recordMap[2].value == 1){
    //                 temp += "<div class = 'div-d font-warn'>";
    //                 // temp += "<p><span>"+device.name+"</span></p>";
    //                 // temp += "<p><span>报警</span></p>";
    //             }else{
    //                 temp += "<div class = 'div-d'>";
    //                 // temp += "<p><span>"+device.name+"</span></p>";
    //                 // temp += "<p><span>正常</span></p>";
    //             }
    //             if (recordMap[3]) {
    //                 temp += "<p><span>设定温度:" + recordMap[3].value + "℃</span></p>";
    //             }
    //             if (recordMap[4]) {
    //                 temp += "<p><span>设定湿度:" + recordMap[4].value + "%</span></p>";
    //             }
    //         }
    //     }else{
    //         temp += "<div class = 'div-d font-warn'>";
    //         temp += "<p><span>"+device.name+"</span></p>";
    //         temp += "<p><span>通讯异常</span></p>";
    //     }
    //     temp += "</div>";
    //     result.htm = temp;
    //     return result;
    // }
    // //电池
    // if (category == CATEGORY.D1005.code) {
    //     if(recordMap){
    //         if(recordMap[1] && recordMap[1].value == 1){
    //             temp += "<div class = 'div-d font-warn'>";
    //             // temp += "<p><span>"+device.name+"</span></p>";
    //             temp += "<p><span>通讯异常</span></p>";
    //         }else{
    //             if(recordMap[2] && recordMap[2].value == 1){
    //                 temp += "<div class = 'div-d font-warn'>";
    //                 // temp += "<p><span>"+device.name+"</span></p>";
    //                 // temp += "<p><span>报警</span></p>";
    //             }else{
    //                 temp += "<div class = 'div-d'>";
    //                 // temp += "<p><span>"+device.name+"</span></p>";
    //                 // temp += "<p><span>正常</span></p>";
    //             }
    //             if (recordMap[125]) {
    //                 temp += "<p><span>总 电 压:" + recordMap[125].value + "</span></p>";
    //             }
    //             if (recordMap[124]) {
    //                 temp += "<p><span>总 电 流:" + recordMap[124].value + "</span></p>";
    //             }
    //             // if (recordMap[3]) {
    //             //     temp += "<p><span>电池个数:" + recordMap[3].value + "</span></p>";
    //             // }
    //             // if (recordMap[126]) {
    //             //     temp += "<p><span>后备时间:" + recordMap[126].value + "</span></p>";
    //             // }
    //         }
    //     }else{
    //         temp += "<div class = 'div-d font-warn'>";
    //         temp += "<p><span>"+device.name+"</span></p>";
    //         temp += "<p><span>通讯异常</span></p>";
    //     }
    //     temp += "</div>";
    //     // temp += "</marquee>";
    //     result.htm = temp;
    //     return result;
    // }
    if(category == CATEGORY.D3001.code){
        temp += "<div class = 'div-d'>";
        temp += "<p><span>"+device.name+"</span></p>";
        // temp += "<p><span>"+device.name+"</span></p>";
        temp += "</div>";
        result.htm = temp;
        result.code = "EMPTY";
@@ -752,21 +810,24 @@
                temp += "<div class = 'div-d font-warn'>";
                // temp += "<p><span>"+device.name+"</span></p>";
                temp += "<p><span>通讯异常</span></p>";
                result.warnState = 1;
            }else{
                if(recordMap[2] && recordMap[2].value == 1){
                    temp += "<div class = 'div-d font-warn'>";
                    // temp += "<p><span>"+device.name+"</span></p>";
                    temp += "<p><span>报警</span></p>";
                    result.warnState = 1;
                }else{
                    temp += "<div class = 'div-d'>";
                    temp += "<div class = 'div-d '>";
                    // temp += "<p><span>"+device.name+"</span></p>";
                    temp += "<p><span>正常</span></p>";
                }
            }
        }else{
            temp += "<div class = 'div-d font-warn'>";
            temp += "<p><span>"+device.name+"</span></p>";
            // temp += "<p><span>"+device.name+"</span></p>";
            temp += "<p><span>通讯异常</span></p>";
            result.warnState = 1;
        }
        temp += "</div>";
        result.htm = temp;
@@ -778,23 +839,26 @@
    if(recordMap){
        if(recordMap[1] && recordMap[1].value == 1){
            temp += "<div class = 'div-d font-warn'>";
            temp += "<p><span>"+device.name+"</span></p>";
            temp += "<p><span>通讯异常</span></p>";
            // temp += "<p><span>"+device.name+"</span></p>";
            // temp += "<p><span>通讯异常</span></p>";
            result.warnState = 1;
        }else{
            if(recordMap[2] && recordMap[2].value == 1){
                temp += "<div class = 'div-d font-warn'>";
                temp += "<p><span>"+device.name+"</span></p>";
                temp += "<p><span>报警</span></p>";
                // temp += "<p><span>"+device.name+"</span></p>";
                // temp += "<p><span>报警</span></p>";
                result.warnState = 1;
            }else{
                temp += "<div class = 'div-d'>";
                temp += "<p><span>"+device.name+"</span></p>";
                temp += "<p><span>正常</span></p>";
                // temp += "<p><span>"+device.name+"</span></p>";
                // temp += "<p><span>正常</span></p>";
            }
        }
    }else{
        temp += "<div class = 'div-d font-warn'>";
        temp += "<p><span>"+device.name+"</span></p>";
        temp += "<p><span>通讯异常</span></p>";
        // temp += "<p><span>"+device.name+"</span></p>";
        // temp += "<p><span>通讯异常</span></p>";
        result.warnState = 1;
    }
    temp += "</div>";
    result.htm = temp;
@@ -808,7 +872,7 @@
 * @param category
 * @returns {String}
 */
function addCurImg(category) {
function addCurImg(category,warnState) {
    //温湿度
    if (category == CATEGORY.D2001.code) {
        return "<img src='images/icon-ht@64.png'/>";
@@ -823,10 +887,16 @@
    }
    //UPS-三相
    if (category == CATEGORY.D1002.code) {
        if(warnState == 1){
            return "<img src='images/icon-ups@64.png'/>";
        }
        return "<img src='images/icon-ups@64.png'/>";
    }
    //UPS-单向
    if (category == CATEGORY.D1001.code) {
        if(warnState == 1){
            return "<img src='images/icon-ups@64.png'/>";
        }
        return "<img src='images/icon-ups@64.png'/>";
    }
    //门禁
@@ -836,10 +906,12 @@
    //精密空调
    if (category == CATEGORY.D2002.code) {
        return "<img src='images/img-kt.png'/>";
        // return "<img src='images/icon-ups@64.png'/>";
    }
    //普通空调
    if (category == CATEGORY.D2003.code) {
        return "<img src='images/img-kt2.png'/>";
        // return "<img src='images/icon-ups@64.png'/>";
    }
    //风机
    if (category == CATEGORY.D2004.code) {