<%@ 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:120px;
	}
	</style>
</head>
<body class="easyui-layout">
<form id="childform" class="easyui-form" data-options="novalidate:true">
	<div class="form-line clearfix" >
		<div class="fl">
			<span class="text-content"><em class="must">*</em>告警编号：</span> 
			<input id="gjbh" class="easyui-textbox" data-options="required:true" missingMessage="告警编号必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must">*</em>告警名称：</span> 
			<input id="gjmc" class="easyui-textbox" data-options="required:true" missingMessage="告警名称必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must">*</em>报警分类：</span> 
			<input id="bjfl" class="easyui-combobox" data-options="required:false" missingMessage="报警分类必填项" > 
		</div> 
		<div class="fl">
			<span class="text-content"><em class="must">*</em>告警来源：</span> 
			<input id="gjsbdy" class="easyui-combobox" data-options="required:false" missingMessage="告警设备定义必填项" > 
		</div> 
	</div>
	<div class="form-line clearfix">
		<div class="fl">
			<span class="text-content"><em class="must"></em>描述：</span> 
			<textarea id="bz"  style="width:441px;"></textarea>  
			
		</div> 
	</div>
	<div id="xh" type="hidden"></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(){
	$('#bjfl').combobox({
		 url:'xtclAction!query_Xtcl.do?csdl=alarmKind&start=0&limit=999999',
		 textField:"csmc",  
		 valueField:"csdm",
		 panelWidth:148,
		 value:"请选择" 
	});
	$('#gjsbdy').combobox({
		 url:'xtclAction!query_Xtcl.do?csdl=alarmDeviceDefine&start=0&limit=999999',
		 textField:"csmc",  
		 valueField:"csdm",
		 panelWidth:148,
		 value:"请选择" ,
		 loadFilter:function(data){
			 for(var i = 0;i < data.length;i++){
				 if(data[i].csmc == "全部"){
					 data.splice(i,1);
				 }
			 }
			 return data;
		 }
	});
	setTimeout(loadValue,500);
});
function loadValue(){
	if(records){
		$("#xh").val(records.xh);
		$("#gjbh").textbox("setValue",records.gjbh);
		$("#gjmc").textbox("setValue",records.gjmc);
		$("#bjfl").combobox("setValue",records.bjfl);
		$("#gjsbdy").combobox("setValue",records.gjsbdy);
		$("#bz").val(records.bz);
	}else{
		//var datenow = new Date();
		//$("#sj").val(datenow.format("yyyy-MM-dd hh:mi:ss"));
	}
}
</script>
