didiyu
2018-12-10 ae9d47607e30e92981c8d3a27053ba7f84f9d9e0
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');
       操作失败