| | |
| | | function creatBattView(index){
|
| | | var count=index+1
|
| | | ,battTitle='<div>'+'<h1 class="hbg">'+'电池组'+count+'</h1>'+
|
| | | '<table class="layout-set">'+'<tbody>'+'<tr>'+'<td>'+'电池品牌'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" data-type="horizontal">'+'<select id="battproducer'+index+'>'
|
| | | '<table class="layout-set">'+'<tbody>'+'<tr>'+'<td>'+'电池品牌'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" data-type="horizontal">'+'<select id="battproducer"'+index+'>'
|
| | | ,battBrand=selectedIndex(index)+'</select>'+'</fieldset>'+'</td>'+'</tr>'
|
| | | ,battType='<tr>'+'<td>'+'电池型号'+'</td>'+'<td>'+'<input type="text" '+'id='+'batttype'+index+' data-mini="true"'+'value='+'电池型号'+count+' />'+'</td>'+'</tr>'
|
| | | ,battNum='<tr>'+'<td>'+'*单体数量'+'</td>'+
|
| | | '<td>'+ '<fieldset data-role="controlgroup" data-type="horizontal">'+'<label for="four">4 个</label>'+'<input type="radio" '+'name='+'battnum'+index+' value="4">'+ |
| | | '<label for="twentyfour">24个</label>'+'<input type="radio" '+'name='+'battnum'+index+' value="24">'+'</fieldset>' +'</td>'+'</tr>' |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ,battNum='<tr>'+'<td>'+'*单体数量'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" data-type="horizontal">'+'<select '+ 'id='+'MonCount'+index+'>'
|
| | | ,battNumOpt=selectedNum(index)+'</select>'+'</fieldset>'+'</td>'+'</tr>' |
| | | |
| | | |
| | | |
| | | |
| | | ,MonVolStd='<tr>'+'<td>'+'*标称单体电压(V)'+'</td>'+'<td>'+'<input type="text" '+'id='+'MonVolStd'+index+' data-mini="true"'+' class="unable" '+'/>'+'</td>'+'</tr>'
|
| | | ,nomCap='<tr>'+'<td>'+'*标称容量(AH)'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" >'+'<select '+'id='+'MonCapStd'+index+' data-mini="true"'+'>'+'</select>'
|
| | | +'</fieldset>'+'</td>'+'</tr>'
|
| | | ,battIndex='<tr>'+'<input type="hidden" '+'id='+'battindex'+index+' data-mini="true"'+'value='+count+' />'+'</tr>'
|
| | | ,battName='<tr>'+'<input type="hidden" '+'id='+'battname'+index+' data-mini="true"'+'value='+'电池组'+count+' />'+'</tr>'+'</tbody>'+'</table>'+'</div>';
|
| | | return battTitle+battBrand+battType+battNum+MonVolStd+nomCap+battIndex+battName; |
| | | return battTitle+battBrand+battType+battNum+battNumOpt+MonVolStd+nomCap+battIndex+battName; |
| | |
|
| | | } |
| | | |
| | | |
| | | function selectedNum(index){
|
| | | var selected='';
|
| | | return selected='<option '+'value='+4+' selected=selected' +'>'+'4 个'+'</option>'+'<option '+'value='+24 +'>'+'24个'+'</option>';
|
| | | }
|
| | |
|
| | | function selectedIndex(index){
|
| | |
| | | }
|
| | |
|
| | |
|
| | | function battnumClick(batn,monv){
|
| | | var inp='input:radio[name="'+batn+'"]';
|
| | | // 'input:radio[name="battnum"]'
|
| | |
|
| | | $(inp).click(function(){
|
| | | var $this=$(this)
|
| | | , $mon=$(monv);
|
| | | if ($this.attr("checked")) { |
| | | if($this.val()==4){
|
| | | $mon.val("12");
|
| | | |
| | | };
|
| | | if($this.val()==24){$mon.val("2");} |
| | | }
|
| | | });
|
| | | |
| | | }
|
| | |
|
| | |
|
| | |
|
| | | function creatMonCapOpt(suoyin){
|
| | | |
| | | for(var u=0;u<suoyin;u++){
|
| | | for(var i=1;i<11;i++){
|
| | | var k,optionStr='',allString,id='';
|
| | | |
| | | for(var i=1;i<11;i++){
|
| | | |
| | | k=i*50;
|
| | | id='MonCapStd'+u;
|
| | | id='#MonCapStd'+u;
|
| | | //optionStr+='<option'+' value='+k+'>'+k+'</option>';
|
| | | optionStr+='<option'+' value='+k+'>'+k+'</option>';
|
| | | allString=optionStr+'<option'+' value='+1000+'>'+1000+'</option>'
|
| | | allString=optionStr+'<option'+' selected=selected '+' value='+1000+'>'+1000+'</option>'
|
| | |
|
| | |
|
| | | }
|
| | | |
| | | $(id).html(allString).trigger('create');
|
| | |
|
| | | }
|
| | |
| | | return $(str).attr('checked','true');
|
| | | }
|
| | |
|
| | | function setMonVolStd(suoyin){
|
| | | for(var u=0;u<suoyin;u++){ |
| | | var id=''; |
| | | id='#MonCount'+u; |
| | | (function(u){
|
| | | var vol='#MonVolStd'+u;
|
| | | $(document).on("change", id, function () {
|
| | | if($(this).find("option:selected").val()==4){$(vol).val(12);}
|
| | | if($(this).find("option:selected").val()==24){$(vol).val(2);} |
| | | })
|
| | | })(u)
|
| | | |
| | | } |
| | | }
|
| | | setMonVolStd(suoyin);
|
| | | |
| | | /* 操作成功
|
| | | $('#changeSuc').popup('open');
|
| | | 操作失败
|