bpmNodeSetFlowScope.jsp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <%--
  2. time:2011-12-14 08:41:55
  3. --%>
  4. <%@page language="java" pageEncoding="UTF-8"%>
  5. <%@include file="/commons/include/html_doctype.html"%>
  6. <html>
  7. <head>
  8. <title>人员部门选择器设置</title>
  9. <%@include file="/commons/include/form.jsp" %>
  10. <script type="text/javascript" src="${ctx}/js/conf/orgUserConf.js"></script>
  11. <script type="text/javascript" src="${ctx}/js/javacode/codemirror.js"></script>
  12. <script type="text/javascript" src="${ctx}/js/javacode/InitMirror.js"></script>
  13. <script type="text/javascript" src="${ctx}/js/hotent/platform/system/ScriptDialog.js" ></script>
  14. <script type="text/javascript">
  15. /*KILLDIALOG*/
  16. var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
  17. $(function(){
  18. handOrgUser();
  19. $("a.save").click(function(){
  20. InitMirror.save();
  21. var opt=$("select#fromType").find('option:selected');
  22. var type = opt.attr("type");
  23. var typeVal = null;
  24. if(type == 'script'){
  25. typeVal = $("#fromScript").val();
  26. }else{
  27. typeVal = opt.val();
  28. }
  29. var scope ={};
  30. scope.type = type;
  31. scope.value = typeVal;
  32. $("#scope").val(JSON2.stringify(scope).replaceAll("\"","#@"));
  33. $("#bpmNodeSetForm").ajaxForm({success:showResponse });
  34. if($("#bpmNodeSetForm").valid()){
  35. $("#bpmNodeSetForm").submit();
  36. }
  37. });
  38. init();
  39. })
  40. function showResponse(responseText) {
  41. var obj = new com.hotent.form.ResultMessage(responseText);
  42. if (obj.isSuccess()) {
  43. $.ligerDialog.success( obj.getMessage(),$lang.tip.confirm, function(rtn) {
  44. if(rtn){
  45. dialog.close();
  46. }
  47. });
  48. } else {
  49. $.ligerDialog.error("人员部门选择器设置保存失败!","提示信息");
  50. }
  51. }
  52. //初始化
  53. function init(){
  54. var scope = $("#scope").val();
  55. scope=scope.replaceAll("#@","\"");
  56. if(scope ){
  57. var JsonObj = JSON2.parse(scope);
  58. var type = JsonObj.type;
  59. var typeVal=JsonObj.value;
  60. if(type == 'script'){
  61. $("#fromType").val("");
  62. $("#fromTypeScriptTr").show();
  63. $("#fromScript").val(typeVal);
  64. }else{
  65. if(typeVal){
  66. $("#fromType").val(typeVal);
  67. }
  68. }
  69. }
  70. }
  71. function changeValue(conf){
  72. var me = $(conf);
  73. var opt = me.find('option:selected');
  74. var type = opt.attr("type");
  75. if(type =='script'){
  76. var fromTypeScriptTr = $("#fromTypeScriptTr").show();
  77. }else{
  78. var fromTypeScriptTr = $("#fromTypeScriptTr").hide();
  79. }
  80. }
  81. function handOrgUser(){
  82. var selectObj = $("#fromType");
  83. for(var i=0 ; i<orgUserFlowJson.length;i++){
  84. var json = orgUserFlowJson[i];
  85. if(json){
  86. var opt = $("<option>").val(json.value).text(json.title);
  87. opt.attr("type",json.type);
  88. selectObj.append(opt);
  89. }
  90. }
  91. }
  92. function selectScript() {
  93. ScriptDialog({
  94. callback: function(script) {
  95. InitMirror.editor.insertCode(script);
  96. }
  97. });
  98. }
  99. //关闭页面
  100. function closeDialog(){
  101. dialog.close();
  102. };
  103. </script>
  104. </head>
  105. <body>
  106. <div class="panel">
  107. <div class="panel-top">
  108. <div class="tbar-title">
  109. <span class="tbar-label">人员部门选择器设置</span>
  110. </div>
  111. <div class="panel-toolbar">
  112. <div class="toolBar">
  113. <div class="group"><a class="link save" href="#"><span></span>保存</a></div>
  114. <div class="l-bar-separator"></div>
  115. <div class="group"><a class="link close" onclick="closeDialog();" href="#"><span></span>返回</a></div>
  116. </div>
  117. </div>
  118. </div>
  119. <div class="panel-body">
  120. <div class="panel-detail">
  121. <form id="bpmNodeSetForm" method="post" action="savaScope.ht">
  122. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  123. <tr id="fromTypeTr" >
  124. <th width=120>
  125. 人员选择范围:
  126. </th>
  127. <td colspan="3">
  128. <select id="fromType" name="fromType" onchange="changeValue(this)">
  129. </select>
  130. </th>
  131. </tr>
  132. <tr id="fromTypeScriptTr" style="display:none;">
  133. <th width=120>
  134. 脚本:
  135. </th>
  136. <td colspan="3">
  137. <a href="javascript:;" onclick="selectScript()" id="btnScript" class="link var" title="常用脚本">常用脚本</a>
  138. <br/>脚本中要使用到其他字段参与运算, 请使用“[字段名]”方式引用。返回一个组织ID<br />
  139. <textarea id="fromScript" codemirror="true" name="fromScript" rows="6" cols="70"></textarea>
  140. </th>
  141. <input type="hidden" id="setId" name="setId" value="${bpmNodeSet.setId}" />
  142. <input type="hidden" id="scope" name="scope" value='${bpmNodeSet.scope}' />
  143. </tr>
  144. </table>
  145. </form>
  146. </div>
  147. </div>
  148. </div>
  149. </body>
  150. </html>