From af4137cbcd23ec8b0e94ddb9504e5c1eebaceee6 Mon Sep 17 00:00:00 2001 From: hdw <496960745@qq.com> Date: 星期三, 28 十一月 2018 16:44:30 +0800 Subject: [PATCH] 数据的简单校验 --- gx_tieta/WebRoot/control.jsp | 51 ++++++++++++++++++++++++++++++++++----------------- 1 files changed, 34 insertions(+), 17 deletions(-) diff --git a/gx_tieta/WebRoot/control.jsp b/gx_tieta/WebRoot/control.jsp index 423c39b..bffa62a 100644 --- a/gx_tieta/WebRoot/control.jsp +++ b/gx_tieta/WebRoot/control.jsp @@ -1087,47 +1087,47 @@ <td><input type="text" id="battInfo_home_name" readonly="readonly" value=""></td> </tr> <tr> - <th>鐢垫睜鏍囩О瀹归噺(AH)</th> - <th>鐢垫睜鏍囩О鍐呴樆(u惟)</th> + <th>鐢垫睜鏍囩О瀹归噺锛�1~6000.0AH锛�</th> + <th>鐢垫睜鏍囩О鍐呴樆锛�1~60000u惟锛�</th> </tr> <tr> <td><input type="text" id="battInfo_nom_cap" value=""></td> <td><input type="text" id="battInfo_nom_res" value=""></td> </tr> <tr> - <th>鐢垫睜缁勬暟</th> - <th>姣忕粍鐢垫睜鍗曚綋鏁伴噺</th> + <th>鐢垫睜缁勬暟锛�1~2锛�</th> + <th>姣忕粍鐢垫睜鍗曚綋鏁伴噺锛�1~300 锛�</th> </tr> <tr> <td><input type="text" id="battInfo_batt_num" value=""></td> <td><input type="text" id="battInfo_batt_mon_num" value=""></td> </tr> <tr> - <th>鍗曚綋鏍囩О鐢靛帇锛圴锛�</th> - <th>鐢垫睜缁勭鏍囩О鐢靛帇锛圴锛�</th> + <th>鍗曚綋鏍囩О鐢靛帇锛�0.1~20.0V锛�</th> + <th>鐢垫睜缁勭鏍囩О鐢靛帇锛�0.1~600.0V锛�</th> </tr> <tr> <td><input type="text" id="battInfo_batt_nom_vol" value=""></td> <td><input type="text" id="battInfo_group_nom_vol" value=""></td> </tr> <tr> - <th>鐢垫睜鏍囩О娓╁害锛堚剝锛�</th> - <th>鐢垫睜娴厖鐢靛帇闃�鍊硷紙V锛�</th> + <th>鐢垫睜鏍囩О娓╁害锛�0.1~60.0鈩冿級</th> + <th>鐢垫睜娴厖鐢靛帇闃�鍊硷紙0.1~60.0V锛�</th> </tr> <tr> <td><input type="text" id="battInfo_batt_nom_temp" value=""></td> <td><input type="text" id="battInfo_batt_float_vol" value=""></td> </tr> <tr> - <th>鐢垫睜娴厖鐢垫祦闃�鍊硷紙A锛�</th> - <th>鍦ㄧ嚎鐢靛帇浣庨榾鍊硷紙V锛�</th> + <th>鐢垫睜娴厖鐢垫祦闃�鍊硷紙0.1~30.0A锛�</th> + <th>鍦ㄧ嚎鐢靛帇浣庨榾鍊硷紙0.1~60.0V锛�</th> </tr> <tr> <td><input type="text" id="battInfo_batt_float_curr" value=""></td> <td><input type="text" id="battInfo_online_low_vol" value=""></td> </tr> <tr> - <th>鐢垫睜缁勮繛鎺ョ被鍨�</th> + <th>鐢垫睜缁勮繛鎺ョ被鍨�(0~1)</th> </tr> <tr> <td><input type="text" id="battInfo_batt_link_type" value=""></td> @@ -1138,7 +1138,7 @@ </div> <div class="popup-footer"> <input type="button" name="" id="battInfo_read" value="璇诲彇" > - <input type="button" name="" id="battInfo_en" class="status-change-set " value="璁剧疆" > + <input type="button" name="" id="battInfo_en" class="status-change-set whyc-btn-disabled" value="璁剧疆" > </div> </div> @@ -5151,9 +5151,10 @@ // 鐢垫睜鍙傛暟 var battCMD = GLOBAL.CMD.batt; // cmd鍛戒护 var battPopup = GLOBAL.battInfoPopup; // 鐢垫睜鍙傛暟妯″潡 + battPopup.testVal(); // 璁剧疆闈㈡澘鐨勫彇鍊艰寖鍥� $('#battInfoBtn').click(function() { + // 鑾峰彇鐢垫睜淇℃伅 var batt = getBatt(); - // console.log(batt); var temp = { dev_id: batt.FBSDeviceId }; @@ -5162,13 +5163,16 @@ var load = layer.load(1); battPopup.search(temp, batt, function(res, binf) { layer.close(load); - // console.log(res); + battInfo_popup.showPopup(); // 鏄剧ずbattInfo_popup寮瑰嚭妗嗗拰閬僵灞� }); - battInfo_popup.showPopup(); // 鏄剧ずbattInfo_popup寮瑰嚭妗嗗拰閬僵灞� + }); // 鐐瑰嚮璁惧畾 $('#battInfo_en').click(function() { + if($(this).hasClass('whyc-btn-disabled')) { + return; + } // 璁剧疆鐢垫睜鍙傛暟闈㈡澘淇℃伅 var load = layer.load(1); battPopup.set(function(res) { @@ -5179,11 +5183,24 @@ // 鐐瑰嚮璇诲彇 $('#battInfo_read').click(function() { + var batt = getBatt(); + var temp = { + dev_id: batt.FBSDeviceId + }; // 璁剧疆鐢垫睜鍙傛暟闈㈡澘淇℃伅 var load = layer.load(1); battPopup.read(function(res) { layer.close(load); - layer.msg('鑾峰彇鍙傛暟鎴愬姛'); + // console.log(res); + if(res.code == 1) { + battPopup.search(temp, batt, function(res, binf) { + layer.close(load); + layer.msg('鑾峰彇鍙傛暟鎴愬姛'); + }); + }else { + layer.msg('鑾峰彇鍙傛暟澶辫触'); + } + }); }); @@ -5199,7 +5216,7 @@ ,dataType: 'json' ,success: function(res) { var rs = JSON.parse(res.result); - console.log(rs); + //console.log(rs); } ,complete: function() { layer.close(load); -- Gitblit v1.9.1