
<style>
div.detailConP{
	width: 920px;
	padding: 24px 0 40px 48px;
}
div.radioSet {
  margin-bottom: 20px;
  padding: 5px 0;
  width: 100%;
}
div.radioSet label.desA {
	display: inline-block;
	float: left;
	width: 70px;
	font-size: 13px;
	line-height: 30px;
	text-align: left;
	vertical-align: middle;
	color: #666;
}
div.radioSet ul.right {
	float: left;
	width: 610px;
	margin-left: 10px;
}
div.radioSet ul.right label.desH {
	margin-left: 8px;
}
ul.line label.desM{
	line-height: 30px;
	margin-left: 16px;
	font-size: 12px;
	color: #666;
}
#lowPowerProtectWrap{
	padding: 4px 0 17px;
}
ul.line li.itemLi{
	margin: 0;
}
ul.line li.descLi{
	width: 100%;
	line-height: 12px;
	font-size: 12px;
	padding: 0;
}
ul.line li.descLi label.desM{
	margin: 0 0 8px;
	line-height: 12px;
}
ul#lowPowerProtectWrap li.lineSub{
	padding-left: 68px;
	font-size: 13px;
	color: #666;
}
ul#lowPowerProtectWrap input.textB{
	margin-left: 4px;
	width: 50px;
}
ul#lowPowerProtectWrap label.desH {
	margin-left: 8px;
	font-size: 12px;
}
#tableWrap li.tableName{
	margin: 40px 0 0;
}
#lpModeTbl{
	/*table-layout: fixed;*/
    word-break: break-all;
    word-wrap: break-word;
	width: 920px;
	text-indent: 0px !important;
}
table#lpModeTbl td{
	padding: 8px 0 !important;
}
table#lpModeTbl tr.dataGrid_header_tr td{
	padding: 8px 0 !important;
	text-indent: 14px;
}
table#lpModeTbl label.tdLabel{
	display: inline-block;
	-o-text-overflow:ellipsis;
	text-overflow:ellipsis;
	overflow:hidden;
	white-space:pre-wrap;
	line-height: 18px;
	padding: 0 14px;
}
table#lpModeTbl label.tdLabel.tdLabelSub{
	margin-top: 4px;
	line-height: 13px;
	font-size: 12px;
	color: #666;
}
</style>
<div class="detailConP">
	<div class = "line radioSet">
		<label class="des desA">{%label.lowPowerMode%}</label>
		<ul class="line right">
			<li id="highPerfModeLi">
				<i name="lowPowerModeChk" id="highPerfMode" value="1" checked="true"></i>  <!-- 性能模式 -->
				<label for="highPerfMode" class="des desH">{%label.highPerfMode%}</label>
				<label class="des desM">{%label.highPerfModeDesc%}</label>
			</li>
			<li class="powerDownModeLi">
				<i name="lowPowerModeChk" id="powerDownMode" value="2" checked="false"></i>  <!-- 省电模式 -->
				<label for="powerDownMode" class="des desH">{%label.powerDownMode%}</label>
				<label class="des desM">{%label.powerDownModeDesc%}</label>
			</li>
			<li class="deepPowerDownModeLi">
				<i name="lowPowerModeChk" id="deepPowerDownMode" value="3" checked="false"></i>  <!-- 休眠模式 -->
				<label for="deepPowerDownMode" class="des desH">{%label.deepPowerDownMode%}</label>
				<label class="des desM">{%label.deepPowerDownModeDesc%}</label>
			</li>
			<li class="scheduleModeLi">
				<i name="lowPowerModeChk" id="scheduleMode" value="0" checked="false"></i>  <!-- 计划模式 -->
				<label for="scheduleMode" class="des desH">{%label.scheduleMode%}</label>
			</li>
		</ul>
	</div>
	<!-- 低电保护 -->
	<ul class="line clear" id="lowPowerProtectWrap">
		<li class="line lineE itemLi">
			<label class="des desA">{%label.lowPowerProtect%}</label>
			<div id="lowPowerProtect" class="switchCon">
				<i class="switchBg"></i>
				<i class="switchBall"></i>
			</div>
		</li>
		<li class="line descLi">
			<label class="des desM" id="lowProtectDes"></label>
		</li>
		<li class="line lineE lineSub">
			<label class="des desH">{%label.lowPowerThreshold%}</label>
			<input id="threshold" class="textInput text textB" maxlength="3"/><i class="tip"></i>
			<label class="des" id="thresholdRage"></label>
		</li>
	</ul>
	<div class="funcBtnCon">
		<input id="save" type="button" class="subBtn btnA" value="{%btn.save%}" />
	</div>

	<ul class="line" id="tableWrap">
		<li class="line lineE tableName">
			<label class="des desG">{%label.lowPowerModeInstr%}</label>
		</li>
		<div class="tableCon">
			<div class="tableBorderCon">
				<table id="lpModeTbl" class="dataGrid">
				</table>
			</div>
		</div>
		<li class="line descLi">
			<label class="des desM" id="batteryLifeDecs"></label>
		</li>
	</ul>
</div>
<script type="text/javascript">function init(){function w(a,h){switch(parseInt(a)){case ENONE:return!0;case IPCSTRLENINV:showStr=errStr.deviceAliasNameSizeErr;break;case IPCUMGUESTNAUTH:showStr=errStr.invPermissionDenied;break;case IPCENERR:case IPCLOWPOWERMODEERR:str=errStr.IPCParamInvalid;break;default:showStr=errStr.invRequestFail}closeToast();showAlert(showStr,h);return!1}function I(){if(x()){var a={};a[f]={};a[f][k]={};a[f][k][l.userMode]=m;0<y&&(a[f][z]={});t&&(a[f][k][l.protectionEnabled]=1==u.state?"on":"off",a[UciBattery.fileName]=
{},a[UciBattery.fileName][UciBattery.secName.setting]={},a[UciBattery.fileName][UciBattery.secName.setting][UciBattery.optName.lowPercent]=id("threshold").value);showToast();$.modify(a,function(a){!0==w(a[ERR_CODE])&&showToast("success")})}}function x(){closeNoteAll();var a=id("threshold").value;if(!checkNum(a))return showNote("threshold",errStr.inputNumFormatErr),!1;a=parseInt(a);return a<n||a>p?(showNote("threshold",errStr.inputNumFormatErr+"（"+n.toString()+"-"+p.toString()+"）"),!1):!0}function J(){m=
getRadioChs("lowPowerModeChk")}function K(){for(var a=UciLowPowerCapability.optName.powerModeList+"_",h=0;h<$.lowPowerModeList.length;h++){for(var e=$.lowPowerModeList[h][a+(h+1).toString()],g=parseInt(e[UciLowPowerCapability.optName.batteryLife]),b=[],c=0;c<v.length;c++)v[c].status&&-1==$.inArray(c,e[UciLowPowerCapability.optName.unsupportedDetection])&&b.push(v[c].str);b=0<b.length?b.join(", "):label.lpSdDpdMode;"1"==e[UciLowPowerCapability.optName.type]&&(q=!0,A=g,B=b);"2"==e[UciLowPowerCapability.optName.type]&&
(r=!0,C=g,D=b);"3"==e[UciLowPowerCapability.optName.type]&&(s=!0,E=g,F=b)}}function L(){var a=[{field:label.lowPowerMode,width:118}],h=[{name:"itemName",type:"htmlStr"}],e={};e.itemName="<label class='tdLabel'>"+label.lpBatteryLife+"</label>";var g={};g.itemName="<label class='tdLabel'>"+label.lpRecord+"</label>";var b={};b.itemName="<label class='tdLabel'>"+label.lpSmartDet+"</label>";var c={};c.itemName="<label class='tdLabel'>"+label.lpFixedScene+"</label>";var f=[e,g,b,c],d=0,d=q?d+1:d,d=r?d+
1:d,d=s?d+1:d;0!=d&&(d=790/d,q&&(a.push({field:label.highPerfMode,width:d}),h.push({name:"HpMode",type:"htmlStr"}),e.HpMode="<label class='tdLabel'>"+A.toString()+label.lHour+"</label>",g.HpMode="<label class='tdLabel'>"+label.lpRcdHpMode+"</label>",b.HpMode="<label class='tdLabel'>"+B+"</label>",c.HpMode="<label class='tdLabel'>"+label.lpFsHpMode1+"<br>"+label.lpFsHpMode2+"<br>"+label.lpFsHpMode3+"</label>"),r&&(a.push({field:label.powerDownMode,width:d}),h.push({name:"PdMode",type:"htmlStr"}),e.PdMode=
"<label class='tdLabel'>"+(C/24).toString()+label.dayT+"<br>"+label.lpBlPdMode+"</label>",g.PdMode="<label class='tdLabel'>"+label.lpRcdPdMode1+"</label><label class='tdLabel tdLabelSub'>"+label.lpRcdPdMode2+"</label>",b.PdMode="<label class='tdLabel'>"+D+"</label><label class='tdLabel tdLabelSub'>"+label.lpSdPdMode+"</label>",c.PdMode="<label class='tdLabel'>"+label.lpFsPdMode1+"<br>"+label.lpFsPdMode2+"</label>"),s&&(a.push({field:label.deepPowerDownMode,width:d}),h.push({name:"DpdMode",type:"htmlStr"}),
e.DpdMode="<label class='tdLabel'>"+label.lpBlDpdMode+E.toString()+label.lHour+"</label>",g.DpdMode="<label class='tdLabel'>"+label.lpRcdDpdMode+"</label>",b.DpdMode="<label class='tdLabel'>"+F+"</label>",c.DpdMode="<label class='tdLabel'>"+label.lpFsDpdMode1+"<br>"+label.lpFsDpdMode2+"</label>"),M.init({id:"lpModeTbl",data:f,hasID:!1,edit:!1,hasSelBox:!1,paging:{num:N},head:a,list:h,pageTurnFunc:function(a){}}))}function O(){if($.batteryCapability){var a=$.batteryCapability[UciBatteryCapability.optName.lowPercentRange];
n=a[0];p=a[1];G=$.batteryCapability[UciBatteryCapability.optName.low2NormalPercent]}id("thresholdRage").innerText=label.percent+" （"+n.toString()+"-"+p.toString()+"）";id("lowProtectDes").innerText=label.lowPowerProtectDesc1+G+label.lowPowerProtectDesc2}var f=UciLowPower.fileName,k=UciLowPower.secName.powerMode,z=UciLowPower.secName.powerModePlan,l=UciLowPower.optName,t=1==parseInt($.lowPowerCapability[UciLowPowerCapability.optName.protectionSupported])?!0:!1,n=5,p=50,G=15,y=$.lowPowerCapability[UciLowPowerCapability.optName.powerModePlanMaxNum]?
parseInt($.lowPowerCapability[UciLowPowerCapability.optName.powerModePlanMaxNum]):0,q=!1,r=!1,s=!1,A,C,E,B,D,F,v=[{status:!1,str:""},{status:!0,str:menuStr.motionDetection},{status:!0,str:menuStr.tamperDetection},{status:1==parseInt($.smartDetection.linecrossing_detection),str:menuStr.lineCrossingDetection},{status:1==parseInt($.smartDetection.intrusion_detection),str:menuStr.intrusionDetection},{status:1==parseInt($.smartDetection.regionentrance_detection),str:menuStr.regionEntranceDetection},{status:1==
parseInt($.smartDetection.regionexiting_detection),str:menuStr.regionExitingDetection},{status:1==parseInt($.smartDetection.loitering_detection),str:menuStr.loiteringDetection},{status:1==parseInt($.smartDetection.gathering_detection),str:menuStr.gatheringDetection},{status:1==parseInt($.smartDetection.fastmoving_detection),str:menuStr.fastMovingDetection},{status:1==parseInt($.smartDetection.parking_detection),str:menuStr.parkingDetection},{status:1==parseInt($.smartDetection.unattendedbaggage_detection),
str:menuStr.unattendedBaggageDetection},{status:1==parseInt($.smartDetection.objectremove_detection),str:menuStr.objectRemoveDetection},{status:1==parseInt($.smartDetection.abandonandtaken_detection),str:menuStr.abandonandTakenDetection},{status:1==parseInt($.smartDetection.audioexception_detection),str:menuStr.audioAbnormal},{status:1==parseInt($.smartDetection.defocus_detection),str:menuStr.defocusDetection},{status:1==parseInt($.smartDetection.scenechange_detection),str:menuStr.sceneChangeDetection},
{status:1==parseInt($.smartDetection.face_detection),str:menuStr.faceDetection},{status:1==parseInt($.smartDetection.overline_detection),str:menuStr.overlineCount},{status:1==parseInt($.smartDetection.people_detection),str:menuStr.peopleDetection},{status:1==parseInt($.smartDetection.vehicle_detection),str:menuStr.vehicleDetection},{status:1==parseInt($.smartDetection.ebike_detection),str:menuStr.ebikeDetectionEnhance},{status:1==parseInt($.smartDetection.nonvehicle_detection),str:menuStr.nonVehicleDetection},
{status:1==parseInt($.moduleSpec.greeter),str:menuStr.greeter},{status:!1,str:menuStr.faceComparison},{status:!1,str:label.faceAlbum},{status:!1,str:menuStr.passengerFlow},{status:1==parseInt($.smartDetection.peoplevisit_detection),str:menuStr.peopleVisitDetection},{status:!1,str:menuStr.parkingOccupy},{status:1==parseInt($.smartDetection.cry_detection),str:menuStr.cryDetection},{status:!1,str:menuStr.peopleGallery},{status:!1,str:menuStr.emergencyCall},{status:1==parseInt($.moduleSpec.license_plate_recognition),
str:menuStr.licensePlateRecognition},{status:1==parseInt($.smartDetection.linger_detection),str:menuStr.lingerDetection},{status:1==parseInt($.smartDetection.pir_detection),str:menuStr.pirDetection},{status:1==parseInt($.smartDetection.disassemble_detection),str:menuStr.disassembleDetection},{status:1==parseInt($.smartDetection.fallingobject_detection),str:menuStr.FallingobjectDetection},{status:1==parseInt($.smartDetection.temperature_measure),str:menuStr.temperatureMeasure},{status:1==parseInt($.smartDetection.mask_detection),
str:menuStr.maskDetection},{status:!1,str:menuStr.heatMap},{status:1==parseInt($.moduleSpec.target_track),str:menuStr.targetTrack},{status:!1,str:label.smartTargetTrack},{status:!1,str:label.overExpPeopleSup},{status:1==parseInt($.moduleSpec.picture_in_picture_capability),str:menuStr.pictureInPicture},{status:!1,str:menuStr.faceSnapShot},{status:!1,str:menuStr.smartData},{status:1==parseInt($.smartDetection.pet_detection),str:menuStr.petDetection}];parseInt($.lowPowerCapability[UciLowPowerCapability.optName.exceptionHandleSupported]);
var H=["scheduleMode","highPerfMode","powerDownMode","deepPowerDownMode"],m,u,M=new DataGrid,N=4;(function(){K();L();var a={};a[f]={};a[f][NAME]=[k];$.batteryCapability&&(a[UciBattery.fileName]={},a[UciBattery.fileName][NAME]=[UciBattery.secName.setting,UciBattery.secName.batteryInfo]);q||$(".highPerfModeLi").hide();r||$(".powerDownModeLi").hide();s||$(".deepPowerDownModeLi").hide();0<y?a[f][NAME].push(z):$(".scheduleModeLi").hide();t?(O(),u=new Switch("lowPowerProtect",0),id("threshold").onblur=
x,id("threshold").onfocus=closeNoteAll):$("#lowPowerProtectWrap").hide();$.query(a,function(a){if(!0==w(a[ERR_CODE])){m=a[f][k][l.userMode];initRadioInput("lowPowerModeChk",J);0<getRadioChs("lowPowerModeChk").length&&changeRadioInput(H[getRadioChs("lowPowerModeChk")],!1);changeRadioInput(H[parseInt(m)],!0);t&&(u.setState("on"==a[f][k][l.protectionEnabled]?1:0),id("threshold").value=a[UciBattery.fileName][UciBattery.secName.setting][UciBattery.optName.lowPercent]);if($.batteryCapability){a=1==parseInt($.batteryCapability.model)?
a[UciBattery.fileName][UciBattery.secName.batteryInfo][UciBattery.optName.model]:"";for(var e=[label.NiMhBattery,label.LiFeBattery,label.alkalineBattery,label.LiBattery,label.solarBattery],g=$.batteryCapability[UciBatteryCapability.optName.batteryType],b="",c=g.length-1;0<=c;c--)1==parseInt(g.charAt(c))&&(b=e[c]);id("batteryLifeDecs").innerText=label.lpBatteryLifeDecs1+b+a+label.lpBatteryLifeDecs2}showDetailCon()}});id("save").onclick=I})()}init();
</script>