From ae9d47607e30e92981c8d3a27053ba7f84f9d9e0 Mon Sep 17 00:00:00 2001
From: didiyu <1293722656@qq.com>
Date: 星期一, 10 十二月 2018 10:54:37 +0800
Subject: [PATCH] 改

---
 gx_tieta/WebRoot/mobil/batt-infor-conf-temp.html |  131 ++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 120 insertions(+), 11 deletions(-)

diff --git a/gx_tieta/WebRoot/mobil/batt-infor-conf-temp.html b/gx_tieta/WebRoot/mobil/batt-infor-conf-temp.html
index 45e7224..33f0d10 100644
--- a/gx_tieta/WebRoot/mobil/batt-infor-conf-temp.html
+++ b/gx_tieta/WebRoot/mobil/batt-infor-conf-temp.html
@@ -11,6 +11,40 @@
 	<link href="mobilCss/mobiscroll.animation-2.5.2.css" rel="stylesheet" type="text/css" />
 	<link rel="stylesheet" type="text/css" href="css/tbl.css">
 	<script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script>
+	<script type="text/javascript">
+	function creatAllView(num){
+        var allString=''
+           ,i=0;
+       if(num>4){return false}
+       for(i=0;i<num;i++){
+         allString+=creatBattView(i);
+       }
+      $("#battdata").html(allString);   
+  } 
+	
+	
+  function creatBattView(index){
+        var battTitle='<div>'+'<h1 class="hbg">'+'鐢垫睜缁�'+index+'</h1>'+
+             '<table class="layout-set">'+'<tbody>'+'<tr>'+'<td>'+'璁惧绱㈠紩'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" data-type="horizontal">'+'<select>'
+            ,allOption=selectedIndex(index)+'</select>'+'</fieldset>'+'</td>'+'</tr>' 
+            ,battName='<tr>'+'<td>'+'鐢垫睜缁勫悕绉�'+'</td>'+'<td>'+'<input type="text" '+'id='+'battname'+index+' data-mini="true"'+'value='+'鐢垫睜缁�'+index +' />'+'</td>'+'</tr>'+'</tbody>'+'</table>'+'</div>';
+        return battTitle+allOption+battName; 
+               
+  }	
+ 
+  function selectedIndex(index){
+       var selected='',
+           i=0;
+       for(i=0;i<4;i++){  
+          if(i==index){selected+='<option '+'value='+i+' selected'+'>'+i+'</option>';continue;}
+          selected+='<option value='+i+'>'+i+'</option>';
+          
+       }
+       
+       return selected; 
+  }	
+   $(function(){creatAllView(4)});
+	</script>
 	<script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
 	<style type="text/css">     
        
@@ -29,6 +63,18 @@
 		    background-color: #dddddd38!important;
             color: #bdbdbdc4!important;
 		}
+		.ui-btn-icon-right {
+            padding-right: 8.5em;
+        }
+        .hbg{
+            background-color:#ddd9;
+        }
+        #battdata {
+            background-color:#dddddd54
+        }
+        .ui-select .ui-btn select{
+            width:77%;
+        }
 	</style>
 	<link rel="stylesheet" href="css/fgpanel.css">
 </head>
@@ -37,7 +83,7 @@
 		
 		<!-- 澶撮儴鍐呭 -->
 		<div data-role="header" data-position="fixed">
-			<a href="ele-param.html" target="_top" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;">杩斿洖</a>
+			<a href="ele-param1.html" target="_top" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;">杩斿洖</a>
 			<h1>鐢垫睜缁勪俊鎭厤缃ā鏉�</h1>
 			
 		</div>
@@ -247,6 +293,34 @@
 									</tbody>
 								</table>
 							<!-- </div> -->
+							    <div id="battdata">
+							         <!-- <div>
+							        <h1 class="hbg">鐢垫睜缁�1</h1>
+							          <table class="layout-set">   
+										<tbody>
+											<tr>
+											    <td>璁惧绱㈠紩</td>
+											    <td>
+											         <fieldset data-role="controlgroup" data-type="horizontal">  
+												            <select>
+												              <option value="">0</option>
+												              <option value="mon">1</option>
+												              <option value="mon">2</option>
+												              <option value="mon">3</option>
+												              
+												            </select>
+												      </fieldset>      
+											    </td>    
+											</tr>
+											<tr>
+											     <td>鐢垫睜缁勫悕绉�</td>
+											     <td><input type="text" id="" data-mini="true" /></td>
+											</tr>
+										</tbody>
+									</table>
+								   </div>	  -->
+							    </div> 
+							  
 			
 		</div>
 		
@@ -277,15 +351,20 @@
 		//setTimes($("#startTestrecord"),'2000-01-01');
 		//setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd'));
 		
+		
 	});
 	var temp = getCookie("eleparm");
 	//console.info(temp);
 	temp=JSON.parse(temp);
 	console.info(temp);
 	console.info(temp[30]);
+	console.info(temp[33]);
 	installstartdata(temp);
-
-	getUpdateArr();
+	if(temp[33]&&temp[33]=="new"){
+		
+	}else{
+		
+	}	
 	function installstartdata(temp){
 		//$("#StationId").value=temp[0];
 		//var t=document.getElementById("station_name1");
@@ -378,13 +457,17 @@
    $(function(){
     $(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck");
     $("#sure").click(function(){
-    	editParm();
-    	function backpage(){window.location.href="ele-param.html";}
-      		setTimeout(backpage,3000); 
-   		});
-    $("#cancel").click(function(){
-     window.location.href="ele-param.html";
-    });
+	    if(temp[33]&&temp[33]=="new"){
+			addBatt();
+		}else{
+			editParm();
+		}  	
+	   	function backpage(){window.location.href="ele-param1.html";}
+	     		setTimeout(backpage,500); 
+	  		});
+	    $("#cancel").click(function(){
+	     window.location.href="ele-param1.html";
+	    });
    });
    function editParm(){
    		var parm = getUpdateArr();	
@@ -409,7 +492,33 @@
 	        	}
  		});
    }
-   
+   function addBatt(){
+		var parm = getUpdateArr();	
+		$.ajax({
+			type: "post", 				
+	        url: "BattInfAction!add",				
+	        async:true,				
+	        dataType:'text',
+	        data:"json="+JSON.stringify(parm),	
+	        success: function(data){							        	
+				data = eval('('+data+')');
+				var model = eval('('+data.result+')');
+				//console.info(model);
+				if(model.code ==1){
+					alert("娣诲姞鐢垫睜缁勬垚鍔�!");
+				}else{
+					alert("娣诲姞鐢垫睜缁勫け璐�!");
+				}		
+        	},
+        	error:function(){
+        		alert("娣诲姞鐢垫睜缁勫彂鐢熼敊璇�!");
+        	}
+        });
+	}
+  
+ 	
+	
+  
         /* 鎿嶄綔鎴愬姛 
    $('#changeSuc').popup('open');
        鎿嶄綔澶辫触

--
Gitblit v1.9.1