81041
2019-12-02 338c58c282214599141bd8aa88cad6745a1a1f4b
Merge branch 'dev_lxw' of http://whyclxw@118.89.139.230:10101/r/~whyclxw/Idce_Lithium.git into dev_lxw
2个文件已修改
63 ■■■■■ 已修改文件
Idce_Lithium/WebRoot/batt-station-update1.jsp 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Idce_Lithium/WebRoot/iframe/batt-info-edit.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Idce_Lithium/WebRoot/batt-station-update1.jsp
@@ -153,20 +153,21 @@
                var element = layui.element;    // 获取元素操作模块
                
                // 设置检测文件名弹出框的content
                var cFilenameContent = '<div style="width:300px; height: 110px;"><div style="margin-top: 20px;margin-left: 8px; margin-right: 8px; text-algin: center;">'+
                var cFilenameContent = '<div style="width:300px; height: 80px;"><div style="margin-top: 20px;margin-left: 8px; margin-right: 8px; text-algin: center;">'+
                                        '<span>选择文件名:</span>'+
                                        '<select id="equipeTypeSel" style="width: 200px;height: 26px; border: 1px solid #ccc">'+
                                        '<select id="equipeTypeSel" style="width: 200px;height: 26px; border: 1px solid #ccc" disabled>'+
                                            '<option value="IDCE-Power8kw.bin">IDCE-Power8kw.bin</option>'+
                                            '<option value="avr_dfu.uc3">avr_dfu.uc3</option>'+
                                            '<option value="E51_DFU_1.SM5">E51_DFU_1.SM5</option>'+
                                            '<option value="E51_DFU_2.SM5">E51_DFU_2.SM5</option>'+
                                        '</select><br><br>'+
                                        '<span>系&nbsp;统&nbsp;类&nbsp;型:</span>'+
                                        '<select id="sysType" style="width: 200px;height: 26px; border: 1px solid #ccc">'+
                                        '<span style="display: none">系&nbsp;统&nbsp;类&nbsp;型:</span>'+
                                        '<select id="sysType" style="display: none; width: 200px;height: 26px; border: 1px solid #ccc">'+
                                            '<option value="12">1U</option>'+
                                            '<option value="2">2U</option>'+
                                        '</select><br><br>'+
                                        '<span>输入版本号:</span>'+
                                        '<input type="text" id="newestVer" style="width: 200px;height: 24px; border: 1px solid #ccc">'+
                                        '<span style="display: none">输入版本号:</span>'+
                                        '<input type="text" id="newestVer" style="display: none; width: 200px;height: 24px; border: 1px solid #ccc">'+
                                    '</div></div>';
                                    
                var cVerContent = '<div style="width:300px; height: 50px;"><div style="margin-top: 20px;margin-left: 8px; margin-right: 8px; text-algin: center;">'+
@@ -435,7 +436,7 @@
                        ,{field:'stationname', title:'机房名称', align:'center', width: 400}
                        ,{field:'fbsid', title:'设备ID', align:'center'}
                        ,{field:'updatestatus', title:'升级状态', align:'center'}
                        ,{field: 'version', title: '版本号', align: 'center'}
                        ,{field: 'version', title: '版本号', align: 'center', width: 240}
                        ,{field:'filename', title:'升级文件名', align:'center'}
                        ,{field:'status', title:'读写状态', align:'center'}
                        ,{field:'progress', title:'读/写进度', align: 'center', templet:'#upProgress'}
@@ -584,10 +585,15 @@
                                var formaterData = formaterAddData(rs.data, allData);        //解析数据
                                if(formaterData.length) {
                                    // 遍历formaterData
                                    //console.log(formaterData);
                                    // console.log(formaterData);
                                    for(var i=0; i<formaterData.length; i++) {
                                        var _formaterData = formaterData[i];
                                        var tmp = {};
                                        // 检测设备是否为8kw
                                        if(checkDevId(_formaterData.FBSDeviceId, 98) && _formaterData.StationIp == '') {
                                            _formaterData.StationIp = 'IDCE-8KW-V0.0.0';
                                        }
                                        //_formaterData.StationIp = 'IDCE-Pro-8KW-V3.01.16';
                                        tmp.stationid = _formaterData.StationId;        // 机房id
                                        tmp.stationname = _formaterData.StationName;    // 机房名称
                                        tmp.fbsid = _formaterData.FBSDeviceId;            // 设备id
@@ -801,9 +807,10 @@
                        data:"json = "+JSON.stringify(temp),    
                        success: function(result){
                            var rs = JSON.parse(result.result);
                            //console.log(rs);
                            // console.log(rs);
                            if(rs.code == 1) {
                                var data = rs.data;
                                // console.log(data);
                                var updateData = checkUpdating(data, all, filename, newestVer, sysType);
                                $('#updateIframeData').data('update', updateData.good);                // 可更新的设备信息
                                $('#updateIframeData').data('errorUpdate', updateData.bad);    // 无法更新的设备信息 
@@ -893,8 +900,8 @@
                            if(_all.updatestatusnum != 1) {
                                if(_all.fbsid == _rsData.FBSDeviceId && _all.filename == filename) {
                                    // 检测当前版本号是否为最新
                                    var isNewstVer = checkNewestVer(newestVer, _all.version);
                                    var isSysType = checkSysType(sysType, _all.version);
                                    var isNewstVer = false;
                                    var isSysType = true;
                                    if(!isNewstVer && isSysType) {
                                        isError = false;    
                                    }
@@ -909,7 +916,6 @@
                            rs.good.push(_all);
                        }
                    }
                    return rs;
                } 
                
@@ -1010,9 +1016,11 @@
                    
                    return rs;
                }
                //console.log(getFnameByVer('D:8,V2.53.40'));
                console.log(getFnameByVer('IDCE-Pro-8KW-V3.01.16'));
                // 根据版本号获取文件的名称
                function getFnameByVer(version) {
                    console.log(version.trim().length);
                    console.log(version);
                    var fileList = [
                        {
                            filename: 'avr_dfu.uc3'
@@ -1021,12 +1029,15 @@
                        ,{
                            filename: 'E51_DFU_2.SM5'
                            ,pattern: /^.*V2\.53\.[0-9]*$/
                        },{
                        }
                        ,{
                            filename: 'E51_DFU_1.SM5'
                            ,pattern: /^.*V12\.53\.[0-9]*$/
                        }
                        ,{
                            filename: 'IDCE-Power8kw.bin'
                            ,pattern: /^.*V[0-9]+\.[0-9]+\.[0-9]+.*$/
                        }
                    ];
                    
                    // 遍历并获取filename
@@ -1037,7 +1048,7 @@
                            filename = _fileList.filename;
                        }
                    }
                    console.log(filename);
                    return filename;
                }
                
@@ -1069,6 +1080,18 @@
                    // console.log(rs);
                    return rs;
                }
                // 验证设备ID
                function checkDevId(dev_id, type) {
                    var reg;
                    // 根据类型选择正则匹配规则
                    switch(type) {
                        case 98:
                            reg = /^98[0-9]{7}$/;
                        break;
                    }
                    return reg.test(dev_id);
                }
            });
        </script>
    </body>
Idce_Lithium/WebRoot/iframe/batt-info-edit.html
@@ -590,9 +590,9 @@
                    //var ptn = /^1$/;
                }
                ,devid: function(value) {
                    var ptn = /^91([0-9]{7})$/;
                    var ptn = /^9([0-9]{8})$/;
                    if(!ptn.test(value)) {
                        return '设备id的格式不正确!以91开头的11位数字';
                        return '设备id的格式不正确!以9开头的8位数字';
                    }
                }
            });
@@ -822,7 +822,7 @@
            });
            // 根据设备id计算设备ip
            function getDevIp(dev_id) {
                var ptn = /^91([0-9]{7})$/;
                var ptn = /^9([0-9]{8})$/;
                var ip = '';
                if(ptn.test(dev_id)) {
                    var value = Number(RegExp.$1);