hdw
2018-11-21 47baad903367aab2cc21475ee8b15bb25a90fc97
更新实时界面放电测试面板数据
3个文件已修改
74 ■■■■ 已修改文件
gx_tieta/WebRoot/control.jsp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/WebRoot/js/dischargetest/bts.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/WebRoot/js/whyc-jqueryui.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/WebRoot/control.jsp
@@ -660,7 +660,7 @@
                        </tr>
                        <tr>
                            <th><s:text name="Booster"/><s:text name="Upper_limit"/><!-- 升压上限 -->(V)</th>
                            <th><s:text name="Charging_current"/><!-- 充电电流 -->(A)</th>
                            <th id="ChargeCurrSetLabel"><s:text name="Charging_current"/><!-- 充电电流 -->(A)</th>
                        </tr>
                        <tr>
                            <td><input id="DCVolHighLimit" type="text" value="0"><i class="fa fa-frown-o error-img" title="数据格式错误"></i></td>
gx_tieta/WebRoot/js/dischargetest/bts.js
@@ -39,8 +39,10 @@
    // 放电电流
    $('#discurr').testVal({
        pattern: /^[0-9]+(\.[0-9]*)?$/,
        regVal: false,
        msg: '输入的数据格式不正确'
        regVal: true,
        min: 0,
        max: 1000,
        msg: '取值范围0~1000A'
    });
    
    // 放电小时率
@@ -53,29 +55,37 @@
    // 放电电容
    $('#discap').testVal({
        pattern: /^[0-9]+$/,
        regVal: false,
        msg: '输入的数据格式不正确'
        regVal: true,
        min: 0,
        max: 90000,
        msg: '取值范围0~90000AH'
    });
    
    // 放电时长
    $('#distime').testVal({
        pattern: /^[0-9]+$/,
        regVal: false,
        msg: '输入的数据格式不正确'
        regVal: true,
        min: 0,
        max: 5940,
        msg: '取值范围0~5940分钟'
    });
    
    // 单体下限阀值
    $('#MonomerVol_low').testVal({
        pattern: /^[0-9]+(\.[0-9]*)?$/,
        regVal: false,
        msg: '输入的数据格式不正确'
        regVal: true,
        min: 0,
        max: 20,
        msg: '取值范围0~20V'
    });
    
    // 组端下限阀值GroupVol_low
    $('#GroupVol_low').testVal({
        pattern: /^[0-9]+(\.[0-9]*)?$/,
        regVal: false,
        msg: '输入的数据格式不正确'
        regVal: true,
        min: 0,
        max: 20,
        msg: '取值范围0~60V'
    });
    
    // 单体下限数量
@@ -203,7 +213,7 @@
// 设置参数
function setBTSParam(list, errorStatus) {
    //setDischageBattinfo(list[0].fsparam.BattGroupNum);                //设置被测电池组信息
    console.log(list);
    if(list[0].fsparam.TestCmd == CMD_BTS_StartDischarge){
        $('#discharge_type').val(CMD_BTS_StartDischarge);
    }else if(list[0].fsparam.TestCmd == CMD_BTS_StartRESTest){
@@ -222,6 +232,10 @@
    $('#DCVolHighLimit').val(list[0].fsparam.DCVolHighLimit);
    $('#ChargeCurrSet').val(list[0].fsparam.ChargeCurrSet);
    $('#TempUpHighLimit').val(list[0].fsparam.MonomerTmp_High);
    // 充电电流
    $('#ChargeCurrSet').testVal('option', 'msg', '取值范围0~'+list[0].binf.charge_curr_max+'A');
    $('#ChargeCurrSetLabel').text('充电电流(0~'+list[0].binf.charge_curr_max+'A)');
}
// 更新BTS设备测试信息
gx_tieta/WebRoot/js/whyc-jqueryui.js
@@ -490,6 +490,7 @@
    // 根据数据的正确性修改文本框的样式
    _proto.changeVal = function() {
        var testVal = this;
        this.ele.off('input propertychange blur focus');
        
        // 文本框内容改变
        this.ele.on('input propertychange', function() {
@@ -515,9 +516,17 @@
            ele.myTooltip('hide');
            ele.removeClass('error-data');
            
            testVal.opts.btn.removeClass('whyc-btn-disabled');
            // 遍历testVal.opts.btn的值
            testVal.opts.btn.each(function() {
                if(!$(this).hasClass('error-data')) {
                    $(this).removeClass('whyc-btn-disabled');
                }
                $(this).removeClass('error-data');
            });
        }else {
            ele.next('i').addClass('error-data');
            //console.log(testVal.opts.msg);
            ele.myTooltip({
                position: testVal.opts.position,
                thing: 'show',
@@ -525,6 +534,15 @@
                content: '<span style="color:#FF0000">'+testVal.opts.msg+'</span>'
            });
            ele.addClass('error-data');
            // 遍历testVal.opts.btn的值
            testVal.opts.btn.each(function() {
                if(!$(this).hasClass('whyc-btn-disabled') && !$(this).hasClass('error-data')) {
                    $(this).addClass('whyc-btn-disabled');
                }else {
                    $(this).addClass('whyc-btn-disabled error-data');
                }
            });
            
            testVal.opts.btn.addClass('whyc-btn-disabled');
        }
@@ -548,10 +566,11 @@
        
        return flag;
    };
    _proto.error = function() {
        console.info(this.opts.msg);
    };
    $.fn.testVal = function(options) {
    $.fn.testVal = function(options, attr, val) {
        var defaults = {
            pattern: "",
            event: "changeVal",
@@ -563,13 +582,24 @@
            max: 0,
            position: 'bottom'
        };
        var opts = $.extend(true, {}, defaults, options||{});
        var opts = {};
        // 判断是否为更新配置项
        if(isString(options)) {
            var oldOpts = this.data('testVal');
            opts = $.extend({}, opts, oldOpts);
            opts[attr] = val;
        }else if(isObject(options)){
            opts = $.extend(true, {}, defaults, options||{});
        }
        // console.log(opts);
        if(opts.pattern.constructor.name != 'RegExp') {
            opts.event = "error";
            opts.msg = '请输入正确的正则表达式格式!!!'
        }
        
        var testVal = new TestVal(this, opts);
        this.data('testVal', testVal.opts);
        testVal[opts.event]();
        
        return this;