sysUserParamEditByUserId.jsp 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <%@page import="com.hotent.platform.model.system.Dictionary"%>
  2. <%@page import="com.hotent.platform.service.system.DictionaryService"%>
  3. <%@page import="com.hotent.platform.model.system.SysUserParam"%>
  4. <%@page import="com.hotent.platform.service.system.SysParamService"%>
  5. <%@page import="com.hotent.core.util.StringUtil"%>
  6. <%@page import="java.util.*"%>
  7. <%@page import="net.sf.json.JSONObject"%>
  8. <%@ page language="java" contentType="text/html; charset=UTF-8"
  9. pageEncoding="UTF-8"%>
  10. <%@include file="/commons/include/html_doctype.html"%>
  11. <html>
  12. <head>
  13. <title>人员参数属性管理</title>
  14. <%@include file="/commons/include/form.jsp"%>
  15. <f:link href="tree/zTreeStyle.css"></f:link>
  16. <script type="text/javascript" src="${ctx }/js/hotent/displaytag.js"></script>
  17. <script type="text/javascript" src="${ctx}/js/tree/jquery.ztree.js"></script>
  18. <script type="text/javascript" src="${ctx}/js/lg/plugins/ligerComboBox.js"></script>
  19. <script type="text/javascript" src="${ctx}/js/lg/plugins/htCatCombo.js"></script>
  20. <script type="text/javascript" src="${ctx}/js/lg/plugins/htDicCombo.js"></script>
  21. <script type="text/javascript"
  22. src="${ctx}/servlet/ValidJs?form=sysUserParam"></script>
  23. <style type="text/css">
  24. .error {
  25. border-color: red;
  26. }
  27. .inputText{
  28. width: 20px;
  29. }
  30. .paramWidth{
  31. width: 200px;
  32. }
  33. </style>
  34. <script type="text/javascript">
  35. //验证值是否有效
  36. function validValue() {
  37. var yes = true;
  38. var $aryId = $("input[title='paramValue']");
  39. if ($aryId.length > 0) {
  40. $aryId
  41. .each(function(i, t) {
  42. var val = $(t).val();
  43. var tr = $(t).parents("tr");
  44. var option = $(tr).find(
  45. "div[name='paramselect'] ");
  46. var dataType = $(option).attr("title");
  47. var sourceType = $(option).attr("id");
  48. if (dataType == "Integer" && sourceType=='input') {
  49. if (isNaN(val)) {
  50. $(t).addClass("error");
  51. if ($(t).next().html() == null
  52. || $(t).next().html() == '')
  53. $(t).after(
  54. '<font color="red">请输入数字。</font>');
  55. yes = false;
  56. }
  57. } else if (dataType == "Date" && sourceType=='input') {
  58. var pattern = /^((\d{2}(([02468][048])|([13579][26]))[\-\/\s]?((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|([1-2][0-9])))))|(\d{2}(([02468][1235679])|([13579][01345789]))[\-\/\s]?((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\s(((0?[0-9])|([1-2][0-3]))\:([0-5]?[0-9])((\s)|(\:([0-5]?[0-9])))))?$/;
  59. if (!pattern.exec(val)) {
  60. $(t).addClass("error");
  61. if ($(t).next().html() == null
  62. || $(t).next().html() == '')
  63. $(t).after(
  64. '<font color="red">请输入日期。</font>');
  65. yes = false;
  66. }
  67. } else {
  68. if ($.isEmpty(val)) {
  69. $(t).addClass("error");
  70. if ($(t).next().html() == null
  71. || $(t).next().html() == '')
  72. $(t)
  73. .after(
  74. '<font color="red">请输入值。</font>');
  75. yes = false;
  76. }
  77. }
  78. });
  79. }
  80. if (yes) {
  81. $aryId.removeClass("error");
  82. if ($aryId.next().html() != null)
  83. $aryId.next().empty();
  84. }
  85. return yes;
  86. };
  87. $(function() {
  88. function showRequest(formData, jqForm, options) {
  89. }
  90. valid(showRequest, showResponse);
  91. $("a.save").click(function() {
  92. var serializeObj={};
  93. var array= $("form").serializeArray();
  94. $(array).each(function(){
  95. if(serializeObj[this.name]){
  96. if($.isArray(serializeObj[this.name])){
  97. serializeObj[this.name].push(this.value);
  98. }else{
  99. serializeObj[this.name]=[serializeObj[this.name],this.value];
  100. }
  101. }else{
  102. serializeObj[this.name]=this.value;
  103. }
  104. });
  105. var str = JSON.stringify(serializeObj);
  106. $("#jsonParamData").val(str);
  107. $('#sysUserParamForm').submit();
  108. });
  109. function showResponse(responseText, statusText) {
  110. var obj = new com.hotent.form.ResultMessage(responseText);
  111. if (obj.isSuccess()) {//成功
  112. $.ligerDialog.success(obj.getMessage(), '提示信息', function(rtn) {
  113. window.location.href=window.location.href;
  114. });
  115. } else {//失败
  116. $.ligerDialog.err('出错信息', "保存人员参数属性失败", obj.getMessage());
  117. }
  118. }
  119. $("a.add").click(function() {
  120. var url = window.location.href;
  121. var index = url.indexOf('&paramType');
  122. if(index >0)
  123. url = url.substring(0,index);
  124. var paramType = "";
  125. $("input[name='catName_']").each(function () {
  126. if(this.checked == true)
  127. paramType = paramType + this.value+",";
  128. });
  129. url =url + '&paramType='+paramType;
  130. window.location = url;
  131. });
  132. $("a.del").click(function() {
  133. var tbody = $("#sysParamItem").children()[1];
  134. var tr = $(tbody).children();
  135. tr.each(function(i){
  136. $(this).remove();
  137. });
  138. saveData();
  139. });
  140. });
  141. function delRow(obj) {
  142. var tr = $(obj).parents("tr");
  143. $(tr).remove();
  144. };
  145. </script>
  146. </head>
  147. <body>
  148. <div class="panel">
  149. <div class="panel-top">
  150. <div class="tbar-title">
  151. <span class="tbar-label">${user.fullname }-参数属性</span>
  152. </div>
  153. <div class="panel-toolbar">
  154. <div class="toolBar">
  155. <div class="group">
  156. <a class="link save"><span></span>保存</a>
  157. </div>
  158. <div class="l-bar-separator"></div>
  159. <div class="group">
  160. <a class="link back"
  161. href="${ctx }/platform/system/sysUser/list.ht"><span></span>返回</a>
  162. </div>
  163. <div class="l-bar-separator"></div>
  164. <a class="link del"><span></span>全部删除</a>
  165. <div class="l-bar-separator"></div>
  166. <div class="group">
  167. <input id="01" type="checkbox" value="all" name="catName_" <c:if test="${fn:contains(paramType,'all') }">checked="checked"</c:if>>
  168. <label for="01">全部</label>
  169. <c:forEach items="${categoryList}" var="catName" varStatus="index">
  170. <input id="${index}" type="checkbox" name="catName_" value="${catName}" <c:if test="${fn:contains(paramType,catName) }">checked="checked"</c:if>>
  171. <label for="${index}">${catName}</label>
  172. </c:forEach>
  173. <a class="link add"><span></span>按分类过滤添加</a>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. <div class="panel-body">
  179. <form id="sysUserParamForm" method="post"
  180. action="${ctx }/platform/system/sysUserParam/saveByUserId.ht">
  181. <input type="hidden" name="userId" value="${user.userId}">
  182. <input type="hidden" id="jsonParamData" name ="jsonParamData" value=""/>
  183. <table id="sysParamItem" cellpadding="1" cellspacing="1"
  184. class="table-grid">
  185. <thead>
  186. <th style="text-align: center;">参数名</th>
  187. <th style="text-align: center;">参数值</th>
  188. <th style="text-align: center;">参数描述</th>
  189. <th style="text-align: center;">管理</th>
  190. </thead>
  191. <jsp:include page="incToolBarParam.jsp"></jsp:include>
  192. </table>
  193. </form>
  194. </div>
  195. <!-- end of panel-body -->
  196. </div>
  197. <!-- end of panel -->
  198. </body>
  199. </html>