sysParamEdit.jsp 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <%--
  2. time:2012-02-23 17:43:35
  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. <title>编辑 组织或人员参数属性</title>
  10. <%@include file="/commons/include/form.jsp" %>
  11. <f:link href="tree/zTreeStyle.css"></f:link>
  12. <script type="text/javascript" src="${ctx}/js/tree/jquery.ztree.js"></script>
  13. <script type="text/javascript" src="${ctx}/servlet/ValidJs?form=sysParam"></script>
  14. <script type="text/javascript" src="${ctx}/js/hotent/platform/system/Share.js"></script>
  15. <script type="text/javascript" src="${ctx}/js/lg/plugins/ligerComboBox.js"></script>
  16. <script type="text/javascript" src="${ctx}/js/lg/plugins/htCatCombo.js"></script>
  17. <script type="text/javascript">
  18. $(function() {
  19. var paramId = $("[name='paramId']").val();
  20. if(paramId == null || paramId == ""){
  21. $("#paramName").blur(function(){
  22. var obj=$(this);
  23. autoPingin(obj);
  24. });
  25. }else{
  26. $("#paramKey").attr("disabled","disabled");
  27. }
  28. function showRequest(formData, jqForm, options) {
  29. return true;
  30. }
  31. if(paramId == ""){
  32. valid(showRequest,showResponse,1);
  33. }else{
  34. valid(showRequest,showResponse);
  35. }
  36. $("a.save").click(function() {
  37. var temp = $("[name='sourceKey']").val();
  38. $("[name='sourceKey']").val($("[name='dictType']").val());
  39. $('#sysParamForm').submit();
  40. $("[name='sourceKey']").val(temp);
  41. });
  42. if(${sysParam.effect == 2}){
  43. $('#selDem').show();
  44. }
  45. if(${isAdd==false}){
  46. initData();
  47. }
  48. });
  49. function autoPingin(obj){
  50. var value=obj.val();
  51. Share.getPingyin({
  52. input:value,
  53. postCallback:function(data){
  54. $("#paramKey").val(data.output);
  55. }
  56. });
  57. }
  58. function initData(){
  59. if(${sysParam.sourceType =='input'} ){
  60. $("#xuanzexiang").hide();
  61. }else if(${sysParam.sourceType =='dict'} ){
  62. $("#xuanzexiang").show();
  63. $("#dictionary").show();
  64. $("#selectItems").hide();
  65. }else{
  66. $("#xuanzexiang").show();
  67. $("#dictionary").hide();
  68. $("#selectItems").show();
  69. obj='${sysParam.sourceKey}';
  70. var json = eval('(' + obj+ ')');
  71. $.each(json,function(key,value){
  72. initSelect(key,value);
  73. });
  74. }
  75. }
  76. function initSelect(key,value){
  77. var aryTr=[
  78. '<tr type="subdata" >',
  79. '<td style="text-align: left;">',
  80. '选项:<input class="inputText" type="text" value="'+key+'" name="key" validate="{required:true,maxlength:120}" style="width: 50%;" >',
  81. '</td>',
  82. '<td style="text-align: left;">',
  83. '值:<input class="inputText" type="text" value="'+value+'" name="value" style="width: 50%;" >',
  84. '</td>',
  85. '<td style="text-align:center;">',
  86. '<a href="#" class="btn btn-info fa-delete " onclick="singleDell(this);">删除</a>',
  87. '</td>',
  88. '</tr>'];
  89. $("#selectItem").append(aryTr.join(""));
  90. }
  91. function showDem(){
  92. if($('option:selected').val()=='1'){
  93. $('#selDem').hide();
  94. }else{
  95. $('#selDem').show();
  96. }
  97. }
  98. function changeSelectFromType(){
  99. var type = $("#sourceType").val();
  100. if(type == 'input' || type == ''){
  101. $("#xuanzexiang").hide();
  102. }else if(type == 'dict'){
  103. $("#xuanzexiang").show();
  104. $("#selectItems").hide();
  105. $("#dictionary").show();
  106. }else{
  107. $("#xuanzexiang").show();
  108. $("#dictionary").hide();
  109. $("#selectItems").show();
  110. }
  111. }
  112. function add(){
  113. var aryTr=[
  114. '<tr type="subdata" >',
  115. '<td style="text-align: left;">',
  116. '选项:<input class="inputText" type="text" name="key" validate="{required:true,maxlength:120}" style="width: 50%;" >',
  117. '</td>',
  118. '<td style="text-align: left;">',
  119. '值:<input class="inputText" type="text" name="value" style="width: 50%;" >',
  120. '</td>',
  121. '<td style="text-align:center;">',
  122. '<a href="#" class="btn btn-info fa-delete " onclick="singleDell(this);">删除</a>',
  123. '</td>',
  124. '</tr>'];
  125. $("#selectItem").append(aryTr.join(""));
  126. }
  127. function singleDell(obj){
  128. $(obj).closest('tr').remove();
  129. };
  130. function selectCategory(obj) {
  131. var selObj = $(obj);
  132. $("#category").val(selObj.val());
  133. }
  134. </script>
  135. </head>
  136. <body>
  137. <div class="panel">
  138. <div class="panel-top">
  139. <div class="tbar-title">
  140. <c:choose>
  141. <c:when test="${sysParam.paramId !=null}">
  142. <span class="tbar-label">编辑组织或人员参数属性</span>
  143. </c:when>
  144. <c:otherwise>
  145. <span class="tbar-label">添加组织或人员参数属性</span>
  146. </c:otherwise>
  147. </c:choose>
  148. </div>
  149. <div class="panel-toolbar">
  150. <div class="toolBar">
  151. <div class="group"><a class="link save" id="dataFormSave" href="javascript:;"><span></span>保存</a></div>
  152. <div class="l-bar-separator"></div>
  153. <div class="group"><a class="link back" href="list.ht"><span></span>返回</a></div>
  154. </div>
  155. </div>
  156. </div>
  157. <div class="panel-body">
  158. <form id="sysParamForm" method="post" action="save.ht">
  159. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  160. <tr>
  161. <th width="20%">参数名: </th>
  162. <td><input type="text" id="paramName" name="paramName" value="${sysParam.paramName}" class="inputText"/></td>
  163. </tr>
  164. <tr>
  165. <th width="20%">参数Key: </th>
  166. <td><input type="text" id="paramKey" name="paramKey" value="${sysParam.paramKey}" class="inputText"/></td>
  167. </tr>
  168. <tr>
  169. <th width="20%">参数类型: </th>
  170. <td>
  171. <select id="effect" name="effect" onchange="showDem()">
  172. <option value="1" <c:if test="${sysParam.effect==1}">selected="selected"</c:if>>用户参数</option>
  173. <option value="2" <c:if test="${sysParam.effect==2}">selected="selected"</c:if>>组织参数</option>
  174. </select>
  175. <span id="selDem" hidden="true">
  176. &ensp; 所属维度:
  177. <select name="belongDem" class="inputText">
  178. <c:forEach items="${demList}" var="d">
  179. <option value="${d.demId}" <c:if test="${sysParam.belongDem==d.demId}">selected="selected"</c:if>>${d.demName}</option>
  180. </c:forEach>
  181. </select>
  182. </span>
  183. </td>
  184. </tr>
  185. <tr>
  186. <th><span>参数分类:</span></th>
  187. <td>
  188. <input id="category" name="category" value="${sysParam.category}" class="inputText"/>
  189. <select onchange="selectCategory(this)" class="inputText">
  190. <option value="">请选择</option>
  191. <c:forEach items="${categoryList}" var="catName">
  192. <option value="${catName}">${catName}</option>
  193. </c:forEach>
  194. </select>
  195. </td>
  196. </tr>
  197. <tr>
  198. <th>
  199. <span class="required">*</span><span>数据来源:</span>
  200. </th>
  201. <td colspan="3">
  202. <select class="inputText" id="sourceType" name="sourceType" onchange="changeSelectFromType()" name="fromType">
  203. <option value="input" <c:if test="${sysParam.sourceType=='input'}">selected="selected"</c:if>>手动录入</option>
  204. <option value="dict" <c:if test="${sysParam.sourceType=='dict'}">selected="selected"</c:if>>数据字典</option>
  205. <option value="select" <c:if test="${sysParam.sourceType=='select'}">selected="selected"</c:if>>下拉框</option>
  206. <option value="checkbox" <c:if test="${sysParam.sourceType=='checkbox'}">selected="selected"</c:if>>复选框</option>
  207. <option value="radio" <c:if test="${sysParam.sourceType=='radio'}">selected="selected"</c:if>>单选按钮</option>
  208. </select>
  209. </td>
  210. </tr>
  211. <tr id="xuanzexiang" hidden="true">
  212. <th><span>自定义选择项:</span></th>
  213. <td colspan="4">
  214. <div id="dictionary">
  215. <input value="${sysParam.sourceKey}" catValue="${sysParam.sourceKey}" id="dictTypeName" class="catComBo" catKey="DIC" valueField="dictType" isNodeKey="true" name="sourceKey" height="150" width="200"/>
  216. </div>
  217. <div id="selectItems">
  218. <table class="" type="sub" id="selectItem">
  219. <thead>
  220. <tr>
  221. <th colspan="3" class="add" style="width: 10%; text-align: left;">
  222. <a href="#" onclick="add()">添加项</a>
  223. </th>
  224. </tr>
  225. </thead>
  226. </table>
  227. </div>
  228. </td>
  229. </tr>
  230. <tr>
  231. <th width="20%">数据类型: </th>
  232. <td>
  233. <select id="dataType" name="dataType" >
  234. <c:forEach items="${dataTypeMap}" var="t">
  235. <option value="${t.key }" <c:if test="${sysParam.dataType==t.key}">selected="selected"</c:if>>${t.value }</option>
  236. </c:forEach>
  237. </select>
  238. </td>
  239. </tr>
  240. <th width="20%">参数描述:</th>
  241. <td>
  242. <textarea cols="10" rows="3" id="description" name="description" class="inputText">${sysParam.description}</textarea>
  243. </td>
  244. </tr>
  245. <tr>
  246. <th width="20%">状态:</th>
  247. <td>
  248. <select id="status_" name="status_">
  249. <option value="1"<c:if test="${sysParam.status_==1}">selected="selected"</c:if>>启用</option>
  250. <option value="2"<c:if test="${sysParam.status_==2}">selected="selected"</c:if>>禁用</option>
  251. </select>
  252. </td>
  253. </tr>
  254. </table>
  255. <input type="hidden" name="paramId" value="${sysParam.paramId}" />
  256. </form>
  257. </div>
  258. </div>
  259. </body>
  260. </html>