  <%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%
	String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/meta.jsp"%>
<base href="<%=basePath%>">
<title>查看流程错误日志</title>
<link href="${ctx}/resource/js/plugins/loadmask/jquery.loadmask.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='${ctx}/resource/js/plugins/loadmask/jquery.loadmask.js'></script> 
 <link href="${ctx}/resource/js/plugins/jsonfommat/css/jquery-linedtextarea.css" type="text/css" rel="stylesheet">
 <link rel="stylesheet" href="${ctx}/resource/js/plugins/jsonfommat/css/css-classes.css" type="text/css" media="screen, projection">
 
 <script src="${ctx}/resource/js/plugins/jsonfommat/js/jquery-linedtextarea.js" type="text/javascript"></script>
 <script type="text/javascript" src="${ctx}/resource/js/plugins/jsonfommat/js/jsl.parser.js"></script>
 <script type="text/javascript" src="${ctx}/resource/js/plugins/jsonfommat/js/jsl.format.js"></script>
 <script type="text/javascript" src="${ctx}/resource/js/plugins/jsonfommat/js/jsl.interactions.js"></script>

<script type="text/javascript">
$(document).ready(function() {
	$("#submitButton").click(function() {
		setMask("main-container");
		  //用jquery中的ajax方法，向服务器提交请求 
		    jQuery.ajax({ 
		     type: "POST", 
		     url: "${ctx}/processErrorLog/retry.do", 
		     data: $('#myform').serialize(),
		     success: function(resp)
				{
		    	 	if(resp=="ERROR"){
		    	 		$("#main-container").unmask();
		    	 		alert("重发失败！");
		    	 		window.location.reload();
		    	 	}else{
		    	 		$("#main-container").unmask();
		    	 		alert("重发成功！");
		    	 		window.location.reload();
		    	 	}
				}
		   });
		 });
	
		/*var javaEditor;
		 javaEditor = CodeMirror.fromTextArea(document.getElementById("scriptContent"), {
			matchBrackets: true,
	        autoCloseBrackets: true,
	        mode: "application/ld+json",
	        lineWrapping: true
		});*/
		//javaEditor.setValue('');
});
</script>
</head>
<body>
	<form action="${ctx}/processErrorLog/update.do" method="post" id="myform">
	<div class="main-container" id="main-container">
			<div class="panel panel-primary">
				<div class="panel-heading">
				重发错误消息
				</div>
				<div class="panel-body" style="background: #fff;margin: 15px;width: calc(100% - 30px)">
					<table class='table table-bordered form-table' border="0" cellspacing="0"
						cellpadding="0" id="myTable">
							<!-- 存放隐藏域的区域 -->
							<input type="hidden" id="pelogId"
								name="pelogId"
								value="${processErrorLog.pelogId}" />
							<!-- 存放表单的区域 -->
 							
							  							<tr>
								<td>流程标题<font
									color="red">*</font>：
								</td>
								<td>${processErrorLog.processTitle}</td>
							</tr>
							  	
							  							<tr>
								<td>流程操作类型<font
									color="red">*</font>：
								</td>
								<td>${processErrorLog.actionType}</td>
							</tr>
							  							<tr>
								<td>流程消息内容<font
									color="red">*</font>：
								</td>
								<td>
									<textarea id="json_input" name="processMsg" 
									class="json_input" rows="30" cols="100" 
									spellcheck="false" 
									 wrap="off" style="resize: both; width: 889px; max-width: 883px;max-height: 500px">${processErrorLog.processMsg}</textarea>
									
									<!-- <button name="validate" id="validate" value="Validate" 
									class="button left bold">校验</button>
								<textarea id="scriptContent" name="processMsg">${processErrorLog.processMsg}</textarea>
								-->
								</td>
							</tr>
							
						</table>
					<div class="col-md-offset-1 col-md-9" style="text-align: center;margin-bottom: 15px;margin-top: 15px">
						<button id="submitButton" name="submitButton" class="btn btn-sm btn-primary" type="button">
							<span class="icon_save">保存</span>
							<i class="ace-icon fa fa-save bigger-110"></i>
						</button>
						<button type="button" class="btn btn-sm btn-primary" onclick="window.history.go(-1);">
							<span class="icon_back">返回</span>
							<i class="ace-icon fa fa-undo icon-on-right bigger-110"></i>
						</button>
					</div>
				</div>
			</div>
		</div>
	</form>
	</div>

</body>
</html>
