| | |
| | | </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>
|
| | |
| | | // 放电电流
|
| | | $('#discurr').testVal({
|
| | | pattern: /^[0-9]+(\.[0-9]*)?$/,
|
| | | regVal: false,
|
| | | msg: '输入的数据格式不正确'
|
| | | regVal: true,
|
| | | min: 0,
|
| | | max: 1000,
|
| | | msg: '取值范围0~1000A'
|
| | | });
|
| | |
|
| | | // 放电小时率
|
| | |
| | | // 放电电容
|
| | | $('#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'
|
| | | });
|
| | |
|
| | | // 单体下限数量
|
| | |
| | | // 设置参数
|
| | | 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){
|
| | |
| | | $('#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设备测试信息
|
| | |
| | | // 根据数据的正确性修改文本框的样式
|
| | | _proto.changeVal = function() {
|
| | | var testVal = this;
|
| | | this.ele.off('input propertychange blur focus');
|
| | |
|
| | | // 文本框内容改变
|
| | | this.ele.on('input propertychange', function() {
|
| | |
| | | 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',
|
| | |
| | | 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');
|
| | | }
|
| | |
| | |
|
| | | 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",
|
| | |
| | | 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;
|