bpmDefVarEdit.jsp 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <%--
  2. time:2011-12-01 16:50:08
  3. desc:edit the 流程变量定义
  4. --%>
  5. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  6. <%@include file="/commons/include/html_doctype.html" %>
  7. <html>
  8. <head>
  9. <title>流程变量</title>
  10. <%@include file="/commons/include/form.jsp" %>
  11. <script type="text/javascript" src="${ctx}/servlet/ValidJs?form=bpmDefVar"></script>
  12. <script type="text/javascript">
  13. /*KILLDIALOG*/
  14. var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
  15. var defId="${defId}";
  16. var actDeployId="${actDeployId}";
  17. var actDefId="${actDefId}";
  18. function showRequest(formData, jqForm, options) {
  19. return true;
  20. }
  21. $(function() {
  22. valid(showRequest,function(){});
  23. change();
  24. $("a.save").click(save);
  25. });
  26. function change(){
  27. var s= $("#varScope").val();
  28. $("#n").each(function(i,o){
  29. if(s=='task'){
  30. $(".sub").eq(i).show();
  31. }else{
  32. $(".sub").hide();
  33. }
  34. });
  35. }
  36. function save(){
  37. var rtn=$("#bpmDefVarForm").valid();
  38. if(!rtn) return;
  39. var url=__ctx+ "/platform/bpm/bpmDefVar/save.ht";
  40. var para=$('#bpmDefVarForm').serialize();
  41. $.post(url,para,showResult);
  42. }
  43. function showResult(responseText)
  44. {
  45. var obj=new com.hotent.form.ResultMessage(responseText);
  46. if(!obj.isSuccess()){
  47. $.ligerDialog.err('出错信息',"保存流程变量失败",obj.getMessage());
  48. return;
  49. }else{
  50. $.ligerDialog.confirm(obj.getMessage()+',是否继续操作?','提示信息',function(rtn){
  51. if(!rtn){
  52. dialog.get('sucCall')();
  53. dialog.close();
  54. }
  55. else{
  56. valid.resetForm();
  57. }
  58. });
  59. }
  60. }
  61. </script>
  62. <style type="text/css">
  63. .sub{display:none;}
  64. </style>
  65. </head>
  66. <body>
  67. <div class="panel">
  68. <div class="panel-top">
  69. <div class="tbar-title">
  70. <span class="tbar-label">
  71. <c:if test="${bpmDefVar.varId==null }">添加流程变量</c:if>
  72. <c:if test="${bpmDefVar.varId!=null }">编辑流程变量</c:if>
  73. </span>
  74. </div>
  75. <div class="panel-toolbar">
  76. <div class="toolBar">
  77. <div class="group"><a class="link save" id="btnSearch"><span></span>保存</a></div>
  78. <div class="l-bar-separator"></div>
  79. <div class="group"><a class="link del" onclick="dialog.get('sucCall')();dialog.close()"><span></span>关闭</a></div>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="panel-body">
  84. <form id="bpmDefVarForm" method="post" action="save.ht">
  85. <div class="panel-detail">
  86. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  87. <tr>
  88. <th width="20%">变量名称:</th>
  89. <td><input type="text" id="varName" name="varName" value="${bpmDefVar.varName}" class="inputText"/>
  90. </td>
  91. </tr>
  92. <tr>
  93. <th width="20%">变量Key: </th>
  94. <td><input type="text" id="varKey" name="varKey" value="${bpmDefVar.varKey}" class="inputText"/></td>
  95. </tr>
  96. <tr>
  97. <th width="20%">数据类型: </th>
  98. <td>
  99. <select name="varDataType" >
  100. <option value="varchar" <c:if test="${bpmDefVar.varDataType eq 'varchar'}">selected='selected'</c:if>>字符串(varchar)</option>
  101. <%-- <option value="short" <c:if test="${bpmDefVar.varDataType eq 'short'}">selected='selected'</c:if>>短整形(short)</option>
  102. <option value="int" <c:if test="${bpmDefVar.varDataType eq 'int'}">selected='selected'</c:if>>整形(integer)</option>
  103. <option value="long" <c:if test="${bpmDefVar.varDataType eq 'long'}">selected='selected'</c:if>>长整型(long)</option>
  104. <option value="double" <c:if test="${bpmDefVar.varDataType eq 'double'}">selected='selected'</c:if>>浮点数(double)</option> --%>
  105. <option value="number" <c:if test="${bpmDefVar.varDataType eq 'number'}">selected='selected'</c:if>>数字(number)</option>
  106. <option value="date" <c:if test="${bpmDefVar.varDataType eq 'date'}">selected='selected'</c:if>>日期(date)</option>
  107. </select>
  108. </td>
  109. </tr>
  110. <%-- <tr>
  111. <th width="20%">作用域: </th>
  112. <td>
  113. <select name="varScope" id="varScope" onchange="change()" style="width:40%;">
  114. <option value="global">--请选择--</option>
  115. <option value="global" <c:if test="${bpmDefVar.varScope eq 'global'}">selected='selected'</c:if>>全局</option>
  116. <option value="task" <c:if test="${bpmDefVar.varScope eq 'task'}">selected='selected'</c:if>>局部</option>
  117. </select></td>
  118. </tr> --%>
  119. <tr class="sub" id="n">
  120. <th width="20%" >节点名称: </th>
  121. <td>
  122. <select id="nodeId" name="nodeId" style="width:40%;">
  123. <c:forEach items="${nodeMap}" var="node">
  124. <option value="${node.key},${node.value}" <c:if test="${node.value==bpmDefVar.nodeName}">selected='selected'</c:if>>${node.value}</option>
  125. </c:forEach>
  126. </select>
  127. </td>
  128. </tr>
  129. </table>
  130. <input type="hidden" name="varId" id="varId" value="${bpmDefVar.varId}" />
  131. <input type="hidden" id="actDeployId" name="actDeployId" value="${actDeployId}"/>
  132. <input type="hidden" id="defId" name="defId" value="${defId}" />
  133. </div>
  134. </form>
  135. </div>
  136. </div>
  137. </body>
  138. </html>