2024-08-14 15:17:51 +08:00

180 lines
6.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page contentType="text/html;charset=UTF-8"%>
<%@page import="com.blueland.bpm.engine.config.model.*" %>
<%@ 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"%>
<link rel="stylesheet" href="${ctx}/resource/js/plugins/codemirror/codemirror.css">
<link rel="stylesheet" href="${ctx}/resource/js/plugins/codemirror/eclipse.css">
<style>
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 180px;
}
</style>
<script src="${ctx}/resource/js/plugins/codemirror/codemirror.js"></script>
<script src="${ctx}/resource/js/plugins/codemirror/clike.js"></script>
<base href="<%=basePath%>">
<title>流程环节规则表新增</title>
<script>
var demo;
var ischeck = true;
var javaEditor;
$(document).ready(function() {
javaEditor = CodeMirror.fromTextArea(document.getElementById("ruleScript"), {
lineNumbers: true,
matchBrackets: true,
theme:"eclipse",
mode: "text/x-java"
});
$.Tipmsg.r=null;
$("#myForm").Validform({
tiptype:function(msg){
alert(msg);//验证提示信息
},
tipSweep:true,
btnSubmit:"#addButton",
callback:function(form){
var ruleScript = javaEditor.getValue();
if(""==ruleScript){
alert("验证脚本不能为空!");
return false;
}
document.getElementById("myForm").action="${ctx}/actInfo/activityRule/save.do";
return true;
}
});
});
function editActivityRule(ruleId){
var url="${ctx}/actInfo/activityRule/getActivityRule.do?ruleId="+ruleId;
$.post(url,function(result){
var jsonObject = eval(result);
$.each(jsonObject, function(name, value) {
if(name=="ruleScript"){
javaEditor.setValue(value);
}else{
var inputObj=$("#"+name);
if(inputObj.attr("type")!="hidden"||name=="ruleId"){
inputObj.val(value);
}
}
});
});
}
function update(){
if($("#ruleId").val()==""){
alert("该规则没有在数据库中,请点击规则列表后再进行更新!");
return;
}
var ruleName = $("#ruleName").val();
if(""==ruleName){
alert("请填写规则名称!");
return ;
}
var ruleScript = javaEditor.getValue();
if(""==ruleScript){
alert("验证脚本不能为空!");
return ;
}
document.getElementById("myForm").action="${ctx}/actInfo/activityRule/update.do";
document.getElementById("myForm").submit();
}
function validate(){
var ruleScript=javaEditor.getValue();;
if(ruleScript==""){
alert("规则脚本不允许为空,请您重新输入!");
return ;
}
var url="${ctx}/actInfo/activityRule/validate.do?ruleScript="+ruleScript;
showDiaLog(url,'验证规则脚本','600px','300px');
}
function describe(){
window.open("${ctx}/commons/bpm_script_info.html")
}
</script>
</head>
<body class="white-page">
<form id="myForm" action="${ctx}/actInfo/activityRule/save.do" method="post">
<div class="main-container" id="main-container">
<div class="panel panel-primary">
<div class="panel-body">
<div class="well well-sm">
<button id="addButton" name="submitButton" type="button" class="btn btn-xs btn-success">
新 增
<i class="ace-icon fa fa-plus bigger-110"></i>
</button>
<button id="updateButton" name="submitButton" type="button" onclick="update();" class="btn btn-xs btn-success">
更 新
<i class="ace-icon fa fa-pencil bigger-110"></i>
</button>
<button type="button" onclick="art.dialog.close();" class="btn btn-xs btn-danger">
关 闭
<i class="ace-icon fa fa-times bigger-110"></i>
</button>
</div>
<table class='table table-bordered form-table' border="0" cellspacing="0"
cellpadding="0" id="myTable">
<input type="hidden" name="ruleType" value="${activityRule.ruleType}" id="ruleType"/>
<input type="hidden" name="ruleId" value="${activityRule.ruleId}" id="ruleId"/>
<input type="hidden" name="procDefId" value="${activityRule.procDefId}" id="procDefId"/>
<input type="hidden" name="sourceActId" value="${activityRule.sourceActId}" id="sourceActId"/>
<input type="hidden" name="sourceActName" value="${activityRule.sourceActName}" id="sourceActName"/>
<input type="hidden" name="targetActId" value="${activityRule.targetActId}" id="targetActId"/>
<input type="hidden" name="targetActName" value="${activityRule.targetActName}" id="targetActName"/>
<!-- 存放表单的区域 -->
<tr>
<td>当前环节<font color="red">*</font></td>
<td>${activityRule.sourceActName}</td>
<td width="135px">目标环节<font color="red">*</font></td>
<td>${activityRule.targetActName}</td>
</tr>
<tr>
<td>规则名称<font color="red">*</font></td>
<td colspan="3"><input style="width: 250px" type="text" name="ruleName" value="${activityRule.ruleName}" id="ruleName"
nullmsg="请填写规则名称" datatype="*"/></td>
</tr>
<tr>
<td>规则脚本<font color="red">*</font></td>
<td colspan="3">
<!-- <a href="javascript:void(0);" onclick="">常用脚本</a>&nbsp;&nbsp;-->
<a href="javascript:void(0);" onclick="validate();">验证脚本</a>&nbsp;&nbsp;
<a href="javascript:void(0);" onclick="describe();">脚本说明</a>
<br/>
<textarea name="ruleScript" id="ruleScript" style="width: 700px;height: 50px">${activityRule.ruleScript}</textarea>
<br/>
环节跳转规则通过groovy脚本定义流程转向开发人员通过控制脚本返回一个布尔值返回值为true时流程将流向目标环节。
</td>
</tr>
<tr>
<td>规则描述:</td>
<td colspan="3"><textarea style="width: 700px;height: 50px" name="ruleRemark" id="ruleRemark">${activityRule.ruleRemark}</textarea></td>
</tr>
</table>
<IFRAME style="width:100%;height:180px;" scrolling="auto" src="${ctx}/actInfo/activityRule/list.do?procDefId=${activityRule.procDefId}&sourceActId=${activityRule.sourceActId}&targetActId=${activityRule.targetActId}" frameBorder="0" id="rightFrame" name="rightFrame" allowTransparency="true"></IFRAME>
</div>
</div>
</div>
</form>
</body>
</html>