


<div class="detailCon">
	<ul class="line">
		<li class="line lineD">
			<label id="exSwitchDes" class="des desF">{%menuStr.eventPicture%}</label>
			<div id="exSwitch" class="switchCon">
				<i class="switchBg"></i>
				<i class="switchBall"></i>
			</div>
			<label class="des desH">ON</label>
		</li>
	</ul>
	<div style="position:relative;*z-index:1;">
		<div id="hidebg"></div>
	</div>
	<ul class="line">
		<li class="line lineD">
			<label class="des desF">{%label.pictureInterval%}</label>
			<input class="text textA" id="pictureInterval" maxlength="5" />
			<span class="selCon">
				<span id="intervalType" class="select">
					<span class="value hsValueB"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
	</ul>

	<ul class="line">
		<li class="line lineF2 lineD">
			<label class="des desF">{%label.pictureNumber%}</label>
			<input class="text textA" id="pictureNumber" maxlength="2" />
		</li>
	</ul>

	<!-- 功能按钮 -->
	<div class="funcBtnCon">
		<input id="cancel" type="button" value="{%btn.gridCancel%}" class="subBtnB btnA"/>
		<input id="save" type="button" value="{%btn.save%}" class="subBtn btnA"/>
	</div>
</div>
<script type="text/javascript">function init(){function n(a){var d="";switch(parseInt(a)){case ENONE:return!0;case IPCUBUSCONNFAIL:d=errStr.ipcUbusConnFail;break;case IPCUBUSCALLERR:d=errStr.ipcUbusCallErr;break;case EINVARG:d=errStr.IPCParamInvalid;break;case IPCENERR:d=errStr.IPCParamInvalid;break;case IPCUMGUESTNAUTH:showStr=errStr.invPermissionDenied;break;case IPCCPINTERVALERR:showStr=errStr.picIntervalErr;break;case IPCCPNUMERR:showStr=errStr.picNumErr;break;default:d=errStr.unknown}closeToast();showAlert(d);return!1}function t(a){l.value=
Math.ceil(l.value*h/a);h=a}function u(a){var d=id(a),c=d.value*h,b=!0;if(!checkNum(d.value))showNote(a,errStr.inputNumFormatErr),b=!1;else if(65535<c||1E3>c){switch(h){case p:d=errStr.picParaRangeSec;break;case f:d=errStr.picParaRangeMSec;break;default:d=errStr.picParaOutOfRange}showNote(a,d);b=!1}return b}function v(a){var d=id(a),c=d.value,b=!0;if(!checkNum(d.value))showNote(a,errStr.inputNumFormatErr),b=!1;else if(10<c||1>c)showNote(a,errStr.picParaRangeNumber),b=!1;return b}function x(){c={};
c[b]={};c[b][NAME]=[e];$.query(c,function(a){!0==n(a[ERR_CODE])&&("on"==a[b][e][q]?(g.setState(1),m(1)):(g.setState(0),m(0)),selectInit("intervalType",[{str:label.milliSecond,value:f},{str:label.second,value:p}],f,t),l.value=Math.ceil(a[b][e][r]/f),h=f,id("pictureNumber").value=a[b][e][s])})}function m(a){var b=document.getElementById("hidebg");0==a?(b.style.display="block",b.style.height=getoffset(id("save")).top-getoffset(id("pictureInterval")).top+"px"):b.style.display="none"}function w(){u("pictureInterval");
v("pictureNumber")}var b=uciPicturePlan.fileName,e=uciPicturePlan.secName.eventConfig,q=uciPicturePlan.optName.enabled,r=uciPicturePlan.optName.captureInterval,s=uciPicturePlan.optName.captureNumber,c,h,f=1,p=1E3,g=null,k=0,l=id("pictureInterval");(function(){g=new Switch("exSwitch",0,m);c={};c[b]={};c[b][NAME]=[e];$.query(c,function(a){!0==n(a[ERR_CODE])&&("on"==a[b][e][q]?(g.setState(1),m(1),k=1):(g.setState(0),m(0),k=0),selectInit("intervalType",[{str:label.milliSecond,value:f},{str:label.second,
value:p}],f,t),l.value=Math.ceil(a[b][e][r]/f),h=f,id("pictureNumber").value=a[b][e][s]);showDetailCon()});id("pictureInterval").onblur=w;id("pictureNumber").onblur=w;id("pictureInterval").onfocus=closeNoteAll;id("pictureNumber").onfocus=closeNoteAll})();initCheckInput("showInfo",null);id("cancel").onclick=function(){x()};id("save").onclick=function(){c={};c[b]={};c[b][e]={};c[b][e][q]=g.state?uciPicturePlan.optValue.on:uciPicturePlan.optValue.off;!1!=v("pictureNumber")&&(c[b][e][s]=id("pictureNumber").value,
!1!=u("pictureInterval")&&(c[b][e][r]=l.value*h,0==g.state&&k?showConfirmIpc(label.confirmCaptureOffTip,function(a){!0==a&&(showToast(),$.modify(c,function(a){!0==n(a[ERR_CODE])&&(k=0,showToast("success"))}))}):(showToast(),$.modify(c,function(a){!0==n(a[ERR_CODE])&&(1==g.state?k=1:0==g.state&&(k=0),showToast("success"))}))))}}init();
</script><style type="text/css">div.lineCon{background:url(../../web-static/images/line.png) repeat-x 0 15px;clear:both;padding-top:30px;font-size:0}div.peCon{position:absolute;box-shadow:0 0 12px rgba(0,0,0,0.3);width:661px;height:210px;border-radius:14px;background-color:#252525;z-index:2;left:48px;top:100px}div.peCon div.peConTips{display:none}div.peCon div.peConDetail{display:none}input.textTime{border:1px solid #2e2e2e;height:24px;line-height:24px;margin-right:12px;width:40px}span.selCon{margin-left:10px}input.textA{width:98px}</style>