sysOfficeTemplateEditRight.jsp 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <%--
  2. time:2012-08-29 11:26:00
  3. desc:edit the 电子印章
  4. --%>
  5. <%@page language="java" pageEncoding="UTF-8"%>
  6. <%@include file="/commons/include/html_doctype.html"%>
  7. <html>
  8. <head>
  9. <%@include file="/commons/include/form.jsp"%>
  10. <%@include file="/js/msg.jsp"%>
  11. <title>office模板权限设置</title>
  12. <script type="text/javascript" src="${ctx}/js/hotent/platform/system/SysDialog.js"></script>
  13. <script type="text/javascript">
  14. $(function(){
  15. var options={};
  16. if(showResponse){
  17. options.success=showResponse;
  18. }
  19. //初始化选择显示区域
  20. initSelect($('#rightType').attr('value'));
  21. $("a.save").click(function() {
  22. var url="saveRight.ht";
  23. var form = $("#sealForm");
  24. form.ajaxForm(options);
  25. form.submit();
  26. });
  27. });
  28. function showResponse(responseText) {
  29. var obj = new com.hotent.form.ResultMessage(responseText);
  30. if (obj.isSuccess()) {
  31. $.ligerDialog.confirm( obj.getMessage()+',继续操作吗?', '提示', function(rtn) {
  32. if(rtn){
  33. }else{
  34. window.returnValue=true;
  35. this.close();
  36. }
  37. if(!rtn){
  38. window.returnValue=true;
  39. location.href='list.ht';
  40. }
  41. else{
  42. location.reload();
  43. }
  44. });
  45. } else {
  46. $.ligerDialog.err('提示','office模板权限设置失败',obj.getMessage());
  47. }
  48. }
  49. //选择器
  50. function selectRightDlg(){
  51. var flag = $('#rightType').attr('value');
  52. var ids = $('#rightIds').attr('value');
  53. var names = $('#rightNames').attr('value');
  54. if(flag=="user"){
  55. UserDialog({
  56. selectUserIds:ids,
  57. selectUserNames:names,
  58. callback:function(userIds,userNames){
  59. $('#rightNames').attr('value',userNames);
  60. $('#rightIds').attr('value',userIds);
  61. $('#rightNameArea').attr('value',userNames);
  62. }
  63. });
  64. }else if(flag=="role"){
  65. RoleDialog({
  66. ids:ids,
  67. names:names,
  68. callback:function(userIds,userNames){
  69. $('#rightNames').attr('value',userNames);
  70. $('#rightIds').attr('value',userIds);
  71. $('#rightNameArea').attr('value',userNames);
  72. }
  73. });
  74. }else if(flag=="org"){ //flag == org
  75. OrgDialog({
  76. ids:ids,
  77. names:names,
  78. callback:function(userIds,userNames){
  79. $('#rightNames').attr('value',userNames);
  80. $('#rightIds').attr('value',userIds);
  81. $('#rightNameArea').attr('value',userNames);
  82. }
  83. });
  84. }
  85. }
  86. // 判断选择组织或用户
  87. function changeRight(obj){
  88. var newType = obj.value;
  89. var oldType = $('#rightTypeHidden').attr('value');
  90. if(newType==oldType){
  91. var userIds = $('#rightIdsHidden').attr('value');
  92. var userNames = $('#rightNamesHidden').attr('value');
  93. $('#rightNames').attr('value',userNames);
  94. $('#rightIds').attr('value',userIds);
  95. $('#rightNameArea').attr('value',userNames);
  96. }else{
  97. $('#rightIds').attr('value','');
  98. $('#rightNameArea').attr('value','');
  99. $('#rightNames').attr('value','');
  100. }
  101. initSelect(newType);
  102. }
  103. // 判断选择显示初始化
  104. function initSelect(newType){
  105. if(newType=='all'){
  106. $('#rightNameArea').show(); //选择显示区域
  107. $('#selectRightDlg').hide(); //选择按钮隐藏
  108. $('#rightNameArea').attr('value','所有');
  109. $('#rightNames').attr('value','所有');
  110. }else if(newType=='not'){
  111. $('#selectRightDlg').hide(); //选择按钮隐藏
  112. $('#rightNameArea').hide(); //选择显示区域隐藏
  113. }else{
  114. $('#rightNameArea').show(); //选择显示区域
  115. $('#selectRightDlg').show(); //选择按钮显示
  116. }
  117. }
  118. </script>
  119. </head>
  120. <body>
  121. <div class="panel">
  122. <div class="panel-top">
  123. <div class="tbar-title">
  124. <span class="tbar-label">office模板权限设置</span>
  125. </div>
  126. <div class="panel-toolbar">
  127. <div class="toolBar">
  128. <div class="group">
  129. <a class="link save" id="dataFormSave" href="javascript:;"><span></span>保存</a>
  130. </div>
  131. <div class="l-bar-separator"></div>
  132. <div class="group">
  133. <a class="link back" href="list.ht"><span></span>返回</a>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="panel-body">
  139. <form id="sealForm" method="post" action="saveRight.ht">
  140. <table class="table-detail" cellpadding="0" cellspacing="0"
  141. border="0">
  142. <input type="hidden" name="templateId" id="templateId" value="${templateId}"/>
  143. <tr>
  144. <th width="20%">主题:</th>
  145. <td>${templateSubject}</td>
  146. </tr>
  147. <tr>
  148. <th width="20%">分配类型:</th>
  149. <td><select id="rightType" name="rightType"
  150. style="width: 60px;" onchange="changeRight(this)">
  151. <c:forEach var="typeItem" items="${typeList}">
  152. <c:choose>
  153. <c:when test="${typeItem.id==sealRightMap.rightType}">
  154. <option value="${typeItem.id}" selected="selected">${typeItem.name}</option>
  155. </c:when>
  156. <c:otherwise>
  157. <option value="${typeItem.id}">${typeItem.name}</option>
  158. </c:otherwise>
  159. </c:choose>
  160. </c:forEach>
  161. </select></td>
  162. </tr>
  163. <tr>
  164. <th width="20%">分配对象:</th>
  165. <td>
  166. <ul>
  167. <li style="float: left;">
  168. <textarea rows="5" cols="150" id="rightNameArea" name="rightNameArea" readonly="readonly"
  169. class="inputText">${sealRightMap.rightNames}</textarea>
  170. <input type="hidden" id="rightNames" name="rightNames" value="${sealRightMap.rightNames}" />
  171. <input type="hidden" id="rightIds" name="rightIds" value="${sealRightMap.rightIds}" /></li>
  172. <!-- 原始的数据 -->
  173. <input type="hidden" id="rightTypeHidden" name="rightTypeHidden"
  174. value="${sealRightMap.rightType}" />
  175. <input type="hidden" id="rightNamesHidden"
  176. name="rightNamesHidden" value="${sealRightMap.rightNames}" />
  177. <input type="hidden" id="rightIdsHidden" name="rightIdsHidden"
  178. value="${sealRightMap.rightIds}" />
  179. </li>
  180. <li style="float: left;">&nbsp;</li>
  181. <li style="float: left;"><a id='selectRightDlg' href='#'
  182. class='button' onclick="selectRightDlg();"><span>...</span></a></li>
  183. </ul>
  184. </td>
  185. </tr>
  186. </table>
  187. </form>
  188. </div>
  189. </div>
  190. </body>
  191. </html>