From aa39b7fa5eb2eb2f65e00d134c82eaa958900813 Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期四, 22 十一月 2018 10:58:33 +0800
Subject: [PATCH] 修改范围电流范围内容

---
 gx_tieta/WebRoot/js/whyc-jqueryui.js     |    2 
 gx_tieta/WebRoot/control.jsp             |   81 ++++++++++++++++++++++++++
 gx_tieta/WebRoot/js/dischargetest/bts.js |   11 ++-
 gx_tieta/WebRoot/dischargetest.jsp       |   82 ++++++++++++++++++++++++++
 4 files changed, 167 insertions(+), 9 deletions(-)

diff --git a/gx_tieta/WebRoot/control.jsp b/gx_tieta/WebRoot/control.jsp
index 6d095b9..796836d 100644
--- a/gx_tieta/WebRoot/control.jsp
+++ b/gx_tieta/WebRoot/control.jsp
@@ -120,6 +120,19 @@
     	.mr250 {
     		margin-left: -250px;
     	}
+    	.page-link {
+			cursor: pointer;
+		}
+		.page-link:hover {
+			color: #1495E7;
+		}
+		.page-link:active {
+			color: #FF0000;
+		}
+		i.fa.f-size16 {
+			font-size: 16px;
+			vertical-align: middle;
+		}
 	</style>
 	
   </head>  
@@ -660,7 +673,7 @@
 						</tr>
 						<tr>
 							<th><s:text name="Booster"/><s:text name="Upper_limit"/><!-- 鍗囧帇涓婇檺 -->锛圴锛�</th>
-							<th id="ChargeCurrSetLabel"><s:text name="Charging_current"/><!-- 鍏呯數鐢垫祦 -->锛圓锛�</th>
+							<th id="ChargeCurrSetLabel"><s:text name="Charging_current"/><!-- 鍏呯數鐢垫祦 -->锛�<span class="val-range"></span>A锛�<i class="fa fa-edit page-link f-size16" title="淇敼鍏呯數鐢垫祦鑼冨洿"></i></th>
 						</tr>
 						<tr>
 							<td><input id="DCVolHighLimit" type="text" value="0"><i class="fa fa-frown-o error-img" title="鏁版嵁鏍煎紡閿欒"></i></td>
@@ -1161,6 +1174,9 @@
 	<script type="text/javascript" src="js/elecircle.js"></script>
 	<script type="text/javascript" src="js/elecircle.content.js"></script>
 	<script type="text/javascript" src="pages/js/pages/homeInfo.js"></script>
+	<script type="text/html" id="setChargeCurrTpl">
+		
+	</script>
 	<script type="text/javascript">
 	var permits;
 	<%	Object obj=session.getAttribute("permits");
@@ -1271,6 +1287,69 @@
 				sysSet_popup.hidePopup();	// 闅愯棌sysSet_popup寮瑰嚭妗嗗拰閬僵灞�
 			});
 			
+			// bts闈㈡澘鍏呯數鐢垫祦缂栬緫
+			$('#ChargeCurrSetLabel .fa-edit').click(function() {
+				var batt =getBatt();
+				//console.log(batt);
+				// 璁剧疆闈㈡澘
+				layer.open({
+					type: 1
+					,title: '璁剧疆鍏呯數鐢垫祦闃�鍊�'
+					, content: '<div style="width:300px; height: 50px;"><div style="margin-top: 20px;margin-left: 8px; margin-right: 8px;">'+
+								'<input type="text" style="width: 100%; height:32px; border: 1px solid #ccc;" id="setChargeCurrVal" value="">'+
+								'</div></div>'
+					,btn:['璁剧疆', '鍙栨秷']
+					,yes: function(index) {
+						var chargeCurrVal = $('#setChargeCurrVal').val();
+						var num = Number(chargeCurrVal);
+						if(isNaN(num) || num==0) {
+							layer.msg('璇疯緭鍏ユ暟瀛�');
+							return;
+						}
+						var tmp = {
+							charge_curr_max: num
+							,BattGroupId: batt.BattGroupId
+						}; 
+						var load;
+						// 璇锋眰璁剧疆鐢垫祦鐨勫悗鍙�
+						$.ajax({
+							type: 'post'
+							,async: true
+							,url: 'BattInfAction!update_charge'
+							,data: 'json='+JSON.stringify(tmp)
+							,dataType: 'json'
+							,beforeSend: function(){
+								load = layer.load(1);
+							}
+							,success: function(res) {
+								var rs = JSON.parse(res.result);
+								// 鍏抽棴绛夊緟妗�
+								layer.close(load);
+								//console.log(rs);
+								if(rs.code == 1) {
+									// 璁剧疆寮瑰嚭妗嗕俊鎭�
+									layer.msg('璁剧疆鎴愬姛锛�');
+									layer.close(index);
+									// 鍏呯數鐢垫祦
+									$('#ChargeCurrSet').testVal('option', 'allOpts', {
+										regVal: true
+										,update: true
+										,min: 0
+										,max: num
+										,msg: '鍙栧�艰寖鍥�0~'+num+'A'
+									});
+									
+									// 璁剧疆鏂囨湰鍊�
+									$('#ChargeCurrSetLabel .val-range').text('0~'+num);
+								}else {
+									layer.msg('璁剧疆澶辫触!璇烽噸鏂拌缃�');
+								}
+							}
+							
+						});
+					} 
+				});
+			});
 			
 			// 绐楀彛澶у皬鏀瑰彉
 			$(window).resize(function() {
diff --git a/gx_tieta/WebRoot/dischargetest.jsp b/gx_tieta/WebRoot/dischargetest.jsp
index a087a89..492948c 100644
--- a/gx_tieta/WebRoot/dischargetest.jsp
+++ b/gx_tieta/WebRoot/dischargetest.jsp
@@ -67,6 +67,19 @@
 			outline: none !important;
 			border: 1px solid #FF0000 !important;
 		}
+		.page-link {
+			cursor: pointer;
+		}
+		.page-link:hover {
+			color: #1495E7;
+		}
+		.page-link:active {
+			color: #FF0000;
+		}
+		i.fa.f-size16 {
+			font-size: 16px;
+			vertical-align: middle;
+		}
 	</style>
   </head> 
   <body>
@@ -209,7 +222,7 @@
 						</tr>
 						<tr>
 							<th><s:text name="Booster"/><s:text name="Upper_limit"/><!-- 鍗囧帇涓婇檺 -->锛圴锛�</th>
-							<th id="ChargeCurrSetLabel"><s:text name="Charging_current"/><!-- 鍏呯數鐢垫祦 -->锛圓锛�</th>
+							<th id="ChargeCurrSetLabel"><s:text name="Charging_current"/><!-- 鍏呯數鐢垫祦 -->锛�<span class="val-range"></span>A锛�<i class="fa fa-edit page-link f-size16" title="淇敼鍏呯數鐢垫祦鑼冨洿"></i></th>
 						</tr>
 						<tr>
 							<td><input id="DCVolHighLimit" type="text" value="0"><i class="fa fa-frown-o error-img" title="鏁版嵁鏍煎紡閿欒"></i></td>
@@ -819,6 +832,71 @@
 				msg: '杈撳叆鐨勬暟鎹牸寮忎笉姝g‘'
 			});
 			
+			
+			// bts闈㈡澘鍏呯數鐢垫祦缂栬緫
+			$('#ChargeCurrSetLabel .fa-edit').click(function() {
+				var battGroupId = $('#battgroupname').find('option:selected').attr('battgroupid');
+				//console.log(batt);
+				// 璁剧疆闈㈡澘
+				layer.open({
+					type: 1
+					,title: '璁剧疆鍏呯數鐢垫祦闃�鍊�'
+					, content: '<div style="width:300px; height: 50px;"><div style="margin-top: 20px;margin-left: 8px; margin-right: 8px;">'+
+								'<input type="text" style="width: 100%; height:32px; border: 1px solid #ccc;" id="setChargeCurrVal" value="">'+
+								'</div></div>'
+					,btn:['璁剧疆', '鍙栨秷']
+					,yes: function(index) {
+						var chargeCurrVal = $('#setChargeCurrVal').val();
+						var num = Number(chargeCurrVal);
+						if(isNaN(num) || num==0) {
+							layer.msg('璇疯緭鍏ユ暟瀛�');
+							return;
+						}
+						var tmp = {
+							charge_curr_max: num
+							,BattGroupId: battGroupId
+						}; 
+						var load;
+						// 璇锋眰璁剧疆鐢垫祦鐨勫悗鍙�
+						$.ajax({
+							type: 'post'
+							,async: true
+							,url: 'BattInfAction!update_charge'
+							,data: 'json='+JSON.stringify(tmp)
+							,dataType: 'json'
+							,beforeSend: function(){
+								load = layer.load(1);
+							}
+							,success: function(res) {
+								var rs = JSON.parse(res.result);
+								// 鍏抽棴绛夊緟妗�
+								layer.close(load);
+								//console.log(rs);
+								if(rs.code == 1) {
+									// 璁剧疆寮瑰嚭妗嗕俊鎭�
+									layer.msg('璁剧疆鎴愬姛锛�');
+									layer.close(index);
+									// 鍏呯數鐢垫祦
+									$('#ChargeCurrSet').testVal('option', 'allOpts', {
+										regVal: true
+										,update: true
+										,min: 0
+										,max: num
+										,msg: '鍙栧�艰寖鍥�0~'+num+'A'
+									});
+									
+									// 璁剧疆鏂囨湰鍊�
+									$('#ChargeCurrSetLabel .val-range').text('0~'+num);
+								}else {
+									layer.msg('璁剧疆澶辫触!璇烽噸鏂拌缃�');
+								}
+							}
+							
+						});
+					} 
+				});
+			});
+			
 			$('.popup.fbs9100').on('input propertychange', 'input[type=text]', function() {
 				$.checkTestInfor();
 			});
@@ -1187,7 +1265,7 @@
 						});
 						
 						// 璁剧疆鏂囨湰鍊�
-						$('#ChargeCurrSetLabel').text('鍏呯數鐢垫祦锛�0~'+list[0].binf.charge_curr_max+'A锛�');
+						$('#ChargeCurrSetLabel .val-range').text('0~'+list[0].binf.charge_curr_max);
 					}				
 				}
 			}
diff --git a/gx_tieta/WebRoot/js/dischargetest/bts.js b/gx_tieta/WebRoot/js/dischargetest/bts.js
index 4f3f62c..719bef8 100644
--- a/gx_tieta/WebRoot/js/dischargetest/bts.js
+++ b/gx_tieta/WebRoot/js/dischargetest/bts.js
@@ -241,14 +241,15 @@
 	
 	// 鍏呯數鐢垫祦
 	$('#ChargeCurrSet').testVal('option', 'allOpts', {
-		regVal: true,
-		min: 0,
-		max: list[0].binf.charge_curr_max,
-		msg: '鍙栧�艰寖鍥�0~'+list[0].binf.charge_curr_max+'A'
+		regVal: true
+		,update: true
+		,min: 0
+		,max: list[0].binf.charge_curr_max
+		,msg: '鍙栧�艰寖鍥�0~'+list[0].binf.charge_curr_max+'A'
 	});
 	
 	// 璁剧疆鏂囨湰鍊�
-	$('#ChargeCurrSetLabel').text('鍏呯數鐢垫祦锛�0~'+list[0].binf.charge_curr_max+'A锛�');
+	$('#ChargeCurrSetLabel .val-range').text('0~'+list[0].binf.charge_curr_max);
 }
 
 // 鏇存柊BTS璁惧娴嬭瘯淇℃伅
diff --git a/gx_tieta/WebRoot/js/whyc-jqueryui.js b/gx_tieta/WebRoot/js/whyc-jqueryui.js
index 040d77c..c02f58d 100644
--- a/gx_tieta/WebRoot/js/whyc-jqueryui.js
+++ b/gx_tieta/WebRoot/js/whyc-jqueryui.js
@@ -601,7 +601,7 @@
 			opts.event = "error";
 			opts.msg = '璇疯緭鍏ユ纭殑姝e垯琛ㄨ揪寮忔牸寮忥紒锛侊紒'
 		}
-		
+		//console.log(opts);
 		var testVal = new TestVal(this, opts);
 		this.data('testVal', testVal.opts);
 		

--
Gitblit v1.9.1