dictionary_list.jsp 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <title>数据字典</title>
  9. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  10. <link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css" />
  11. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  12. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  13. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  14. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
  15. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerTab.js" type="text/javascript"></script>
  16. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
  17. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  18. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  19. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
  20. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
  21. <script type="text/javascript" src="/shares/js/constant.js"></script>
  22. <script type="text/javascript" src="/shares/js/common.js"></script>
  23. <style type="text/css">
  24. .default_search li input[type='text']{height:28px; line-height:28px}
  25. </style>
  26. <script type="text/javascript">
  27. $(function(){
  28. searchlist();
  29. });
  30. function addSub(){
  31. var parentId=$("#parent_type").val();
  32. if(parentId==null || parentId==""){
  33. alert("请选择父类型");
  34. return ;
  35. }
  36. addTab("${pageContext.request.contextPath }/pmDictionary.do?task=to_add&parentId="+parentId, "新增子类", "${pageContext.request.contextPath }/pmDictionary.do?task=to_add&parentId="+parentId+ "&tabid=" + getCurrentTabId(), true);
  37. }
  38. function data_edit(universalid,pid){
  39. addTab("${pageContext.request.contextPath }/pmDictionary.do?task=to_edit&", "编辑数据字典", "${pageContext.request.contextPath }/pmDictionary.do?task=to_edit&id="+universalid+"&parentId="+pid+ "&tabid=" + getCurrentTabId(), true);
  40. }
  41. function data_view(universalid){
  42. addTab("${pageContext.request.contextPath }/pmDictionary.do?task=dictionary_view&id="+universalid, "查看数据字典", "${pageContext.request.contextPath }/pmDictionary.do?task=dictionary_view&id="+universalid, true);
  43. }
  44. function data_del(universalid){
  45. $.ajax({
  46. url:"pmDictionary.do?task=dictionary_del&id="+universalid+"&time="+new Date().getTime(),
  47. type:"post",
  48. dataType:"json",
  49. success:function(data){
  50. if(data.i>0){
  51. addInfo("操作成功!");
  52. searchlist();
  53. }else{
  54. addInfo("操作失败!");
  55. }
  56. }
  57. });
  58. }
  59. function reflesh(){
  60. $.ajax({
  61. url:"pmDictionary.do?task=dictionary_clear&time="+new Date().getTime(),
  62. type:"post",
  63. dataType:"json",
  64. success:function(data){
  65. addInfo("操作成功!");
  66. }
  67. });
  68. }
  69. var manager;
  70. function searchlist(){
  71. var s = "";
  72. var parentId=$("#parent_type").val();
  73. if(parentId !="" && parentId !=null){
  74. s="&parentId="+parentId;
  75. }
  76. if(manager==undefined){
  77. manager1=$("#creditgrid").ligerGrid({
  78. columns:[
  79. { display: '父类名称', name: 'p_dname', width: 220, align: 'center'},
  80. { display: '子类名称', name: 'dname', width: 220, align: 'center'},
  81. { display: '子类值', name: 'dvalue', width: 150, align: 'center'},
  82. { display: '操作', isSort: false, width: 340,align: 'left',render : function(rowdata, rowindex, value)
  83. {
  84. var html="";
  85. html+="&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:data_view("+rowdata.universalid+")'>查看</a>";
  86. html+="&nbsp;|&nbsp;<a href='javascript:data_edit("+rowdata.universalid+","+rowdata.pid+")'>编辑</a>";
  87. html+="&nbsp;|&nbsp;<a href='javascript:data_del("+rowdata.universalid+")'>删除</a>";
  88. return html;
  89. }
  90. }
  91. ],pageSize:20,
  92. url:"pmDictionary.do?task=dictionary_pagelist&time="+ new Date().getTime()+s,
  93. pageParmName: 'p', //页索引参数名,(提交给服务器)
  94. pagesizeParmName: 'pSize', //页记录数参数名,(提交给服务器)
  95. width : '100%',
  96. height : '99.3%',
  97. rownumbers:true
  98. });
  99. }else{
  100. manager._setParms(josnobj);
  101. manager.loadData();
  102. }
  103. }
  104. </script>
  105. </head>
  106. <body>
  107. <div id="title" class="form-button">
  108. <input type="button" value="关闭" class="l-button" onclick="javascript:closeWindow();">
  109. </div>
  110. <div class="container-layout">
  111. <div class="default_search" style="margin-bottom: 0px;">
  112. <ul class="list_search" style="width: 300px;">
  113. <li class="title" >父类型:</li>
  114. <li class="text" >
  115. <select style="width:150px; height:25px;" name="parent_type" id="parent_type" onchange="searchlist()">
  116. <option value=""></option>
  117. <c:forEach items="${list}" var="obj" >
  118. <option value="${obj.universalid }" >${obj.dname }</option>
  119. </c:forEach>
  120. </select>
  121. </li>
  122. </ul>
  123. <ul class="list_search" style="width: 100px;">
  124. <li class="search-button" style="width: 100px;">
  125. <input type="button" class='l-button' name="search" onclick="addSub();" value="新增子类" />
  126. </li>
  127. </ul>
  128. <ul class="list_search" style="width: 100px;">
  129. <li class="search-button" style="width: 100px;">
  130. <input type="button" class='l-button' name="search" onclick="reflesh();" value="刷新缓存" />
  131. </li>
  132. </ul>
  133. </div>
  134. <div style="clear: both;margin-right: 2px;margin-bottom:0px;margin-left:0px;margin-top:0px; padding: 0">
  135. <div id="creditgrid" style=" margin:0;padding: 0"></div>
  136. </div>
  137. </div>
  138. </body>
  139. </html>