<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
 	<%@include file="../../../frame/assets/header-all.jsp"%>
	<style>
	.form-line .text-content{
		width:145px;
	}
	label{margin-right: 20px;}
	[type="checkbox"]{margin-right:5px;vertical-align: middle;}
	.combo-panel{
		max-height:200px;
	}
	</style>
</head>
<body class="easyui-layout">
<form id="childform" class="easyui-form" data-options="novalidate:true">
	<input id="departmentid" type="hidden" />
	<div class="form-line clearfix" >
		<div class="fl">
			<span class="text-content"><em class="must">*</em>摄像机建设部门：</span> 
			<input id="builddepartment" class="easyui-textbox" data-options="required:true,validType:'length[0,500]'" missingMessage="摄像机建设部门必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must">*</em>所属行政区域编码：</span> 
			<input id="areacode" class="easyui-textbox" data-options="required:true,validType:'length[0,20]'" missingMessage="所属行政区域编码必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>保密属性：</span> 
			<input id="secreyattribute" class="easyui-textbox" data-options="required:false,validType:'length[0,5]'" missingMessage="保密属性必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>摄像机功能类型：</span> 
			<input id="videofunctiontype" class="easyui-textbox" data-options="required:false,validType:'length[0,5]'" missingMessage="摄像机功能类型必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must">*</em>所属辖区公安机关编码：</span> 
			<input id="areapolicecode" class="easyui-textbox" data-options="required:true,validType:'length[0,40]'" missingMessage="所属辖区公安机关编码必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>所属辖区公安机关名称：</span> 
			<input id="areapolicename" class="easyui-textbox" data-options="required:false,validType:'length[0,100]'" missingMessage="所属辖区公安机关名称必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must">*</em>摄像机所属警种：</span> 
			<input id="videopolicetype" class="easyui-textbox" data-options="required:true,validType:'length[0,5]'" missingMessage="摄像机所属警种必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must">*</em>监控点类型：</span> 
			<input id="videopointtype" class="easyui-textbox" data-options="required:true,validType:'length[0,5]'" missingMessage="监控点类型必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must">*</em>管理单位编码：</span> 
			<input id="manageunitcode" class="easyui-textbox" data-options="required:true,validType:'length[0,40]'" missingMessage="管理单位编码必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must"></em>管理单位名称：</span> 
			<input id="manageunitname" class="easyui-textbox" data-options="required:false,validType:'length[0,100]'" missingMessage="管理单位名称必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>管理单位联系人：</span> 
			<input id="manageunitaccount" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'" missingMessage="管理单位联系人必填项" > 
		</div>
		<div class="fl">
			<span class="text-content"><em class="must">*</em>管理单位联系电话：</span> 
			<input id="manageunitphone" class="easyui-textbox" data-options="required:true,validType:'length[0,40]'" missingMessage="管理单位联系电话必填项" > 
		</div> 		 
	</div>
	<!-- <div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must">*</em>使用属性：</span> 
			<input id="useattribute" class="easyui-textbox" data-options="required:true,validType:'length[0,40]'" missingMessage="使用属性必填项" > 
		</div> 
		
	</div> -->
	<div class="form-line clearfix">
		<span class="text-content" style="line-height: 1;height:40px">使用属性：</span>
		<label><input type="checkbox"  name="useattribute" value="1" >公安机关</label>
		<label><input type="checkbox"  name="useattribute" value="2" >环保部门</label>
		<label><input type="checkbox"  name="useattribute" value="3" >文博部门</label>
		<label><input type="checkbox"  name="useattribute" value="4" >医疗部门</label>
		<label><input type="checkbox"  name="useattribute"value="5" >旅游管理</label>
		<br/>
		<label><input type="checkbox"  name="useattribute"value="6" >新闻广电</label>
		<label><input type="checkbox"  name="useattribute"value="11" >金融部门</label>
		<label><input type="checkbox"  name="useattribute"value="12" >交通部门</label>
		<label><input type="checkbox"  name="useattribute" value="14" >水利部门</label>
		<label><input type="checkbox"  name="useattribute" value="15" >林业部门</label>
		<br/>
		<label><input type="checkbox"  name="useattribute"value="7" >食品医药监督管理部门</label>
		<label><input type="checkbox"  name="useattribute" value="13" >住房和城乡建设部门</label>	
		<label><input type="checkbox"  name="useattribute" value="16" >安全生产监督部门</label>
		<br/>			
		<label><input type="checkbox"  name="useattribute"value="8" >教育管理部门</label>
		<label><input type="checkbox"  name="useattribute"value="17" >市政市容委</label>
		<label><input type="checkbox"  name="useattribute"value="9" >检察院</label>
		<label><input type="checkbox"  name="useattribute"value="10" >法院</label>		
		<label><input type="checkbox"  name="useattribute"value="18" >国土局</label>
	</div>
	
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>备注：</span> 
			<textarea id="remarks"  style="width:441px;height:80px"></textarea>  			
		</div> 
	</div>

	<div class="form-line hidden">
		 
	</div>
</form>
</body>
</html>
<script type="text/javascript">
var winId	= $.getUrlParam("winId");
var records = top.$("#"+winId).panel("options").data;
$(function(){
	//加载下拉选项
	
	$('#builddepartment').combobox({  
		 data : $.obj2ary(CommonData.builddepartment),  
		 textField:1,  
		 valueField:0,
		 panelWidth:148,
		 value:"" 
	});
	$('#secreyattribute').combobox({  
		 data : $.obj2ary(CommonData.secreyattribute),  
		 textField:1,  
		 valueField:0,
		 panelWidth:148,
		 value:"" 
	});
	$('#videofunctiontype').combobox({  
		 data : $.obj2ary(CommonData.videofunctiontype),  
		 textField:1,  
		 valueField:0,
		 panelWidth:148,
		 value:"" 
	});
	$('#videopolicetype').combobox({  
		 data : $.obj2ary(CommonData.videopolicetype),  
		 textField:1,  
		 valueField:0,
		 panelWidth:148,
		 value:"" 
	});
	$('#videopointtype').combobox({  
		 data : $.obj2ary(CommonData.videopointtype),  
		 textField:1,  
		 valueField:0,
		 panelWidth:148,
		 value:"" 
	});
	
	setTimeout(loadValue,1000);
});
function loadValue(){
	
	if(records){
		$("#departmentid").val(records.departmentid);
		$("#areacode").textbox("setValue",records.areacode);
		$("#areapolicecode").textbox("setValue",records.areapolicecode);
		$("#areapolicename").textbox("setValue",records.areapolicename);
		$("#manageunitcode").textbox("setValue",records.manageunitcode);
		$("#manageunitname").textbox("setValue",records.manageunitname);
		$("#manageunitphone").textbox("setValue",records.manageunitphone);
		$("#manageunitaccount").textbox("setValue",records.manageunitaccount);
		
		$("#builddepartment").combobox("setValue",records.builddepartment);		
		$("#secreyattribute").combobox("setValue",records.secreyattribute);
		$("#videofunctiontype").combobox("setValue",records.videofunctiontype);		
		$("#videopolicetype").combobox("setValue",records.videopolicetype);
		$("#videopointtype").combobox("setValue",records.videopointtype);
		
		$("#remarks").val(records.remarks);
		
		var chosed = records.useattribute;
		var ck = $('input[name="useattribute"]');
		$.each(ck,function(){			
			var val = $(this).val();
			if(chosed.indexOf(val)!=-1){
				$(this).prop('checked',true)
			}	
		})

	}else{
		
	}
}

</script>
