机构界面调整,分页实现后台国际化,列表数据为空显示提示
This commit is contained in:
@@ -11,11 +11,11 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import javax.servlet.http.Cookie;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.web.servlet.support.RequestContext;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.nis.util.Configurations;
|
import com.nis.util.Configurations;
|
||||||
@@ -60,12 +60,7 @@ public class Page<T> {
|
|||||||
|
|
||||||
private String message = ""; // 设置提示消息,显示在“共n条”之后
|
private String message = ""; // 设置提示消息,显示在“共n条”之后
|
||||||
|
|
||||||
private String prevPage="previousPage";
|
private RequestContext requestContext;
|
||||||
private String nextPage="nextPage";
|
|
||||||
private String currentPage="current";
|
|
||||||
private String TotalCount="Total";
|
|
||||||
private String pageEn="page";
|
|
||||||
private String countPage="count";
|
|
||||||
|
|
||||||
public Page() {
|
public Page() {
|
||||||
this.pageSize = -1;
|
this.pageSize = -1;
|
||||||
@@ -78,27 +73,26 @@ public class Page<T> {
|
|||||||
*/
|
*/
|
||||||
public Page(HttpServletRequest request, HttpServletResponse response){
|
public Page(HttpServletRequest request, HttpServletResponse response){
|
||||||
this(request, response, Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)));
|
this(request, response, Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)));
|
||||||
zhcnPageInfo(request);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public Page(HttpServletRequest request, HttpServletResponse response,String alias){
|
public Page(HttpServletRequest request, HttpServletResponse response,String alias){
|
||||||
|
|
||||||
this(request, response, Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)),alias);
|
this(request, response, Integer.valueOf(Configurations.getIntProperty("page.pageSize", 30)),alias);
|
||||||
zhcnPageInfo(request);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page(HttpServletRequest request, HttpServletResponse response, int defaultPageSize,String alias){
|
public Page(HttpServletRequest request, HttpServletResponse response, int defaultPageSize,String alias){
|
||||||
this.setAlias(alias);
|
this.setAlias(alias);
|
||||||
this.initPage(request, response, defaultPageSize);
|
this.initPage(request, response, defaultPageSize);
|
||||||
zhcnPageInfo(request);
|
|
||||||
}
|
}
|
||||||
public Page(HttpServletRequest request, HttpServletResponse response, int defaultPageSize){
|
public Page(HttpServletRequest request, HttpServletResponse response, int defaultPageSize){
|
||||||
this.initPage(request, response, defaultPageSize);
|
this.initPage(request, response, defaultPageSize);
|
||||||
zhcnPageInfo(request);
|
|
||||||
}
|
}
|
||||||
//更换中文提示
|
//更换中文提示
|
||||||
public void zhcnPageInfo(HttpServletRequest request){
|
public void zhcnPageInfo(HttpServletRequest request){
|
||||||
try {
|
|
||||||
|
|
||||||
|
/*try {
|
||||||
|
|
||||||
|
|
||||||
if(CookieUtil.getValue(request, "Language")!=null&&CookieUtil.getValue(request, "Language").equalsIgnoreCase("zh_cn")){
|
if(CookieUtil.getValue(request, "Language")!=null&&CookieUtil.getValue(request, "Language").equalsIgnoreCase("zh_cn")){
|
||||||
prevPage="上一页";
|
prevPage="上一页";
|
||||||
nextPage="下一页";
|
nextPage="下一页";
|
||||||
@@ -109,10 +103,13 @@ public class Page<T> {
|
|||||||
}
|
}
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
private void initPage(HttpServletRequest request, HttpServletResponse response, int defaultPageSize){
|
private void initPage(HttpServletRequest request, HttpServletResponse response, int defaultPageSize){
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
this.requestContext = new RequestContext(request);
|
||||||
|
|
||||||
// 设置页码参数(传递repage参数,来记住页码)
|
// 设置页码参数(传递repage参数,来记住页码)
|
||||||
String no = request.getParameter("pageNo");
|
String no = request.getParameter("pageNo");
|
||||||
if (StringUtils.isNotBlank(no)) {
|
if (StringUtils.isNotBlank(no)) {
|
||||||
@@ -337,13 +334,19 @@ public class Page<T> {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
||||||
|
|
||||||
|
if(list != null && list.isEmpty()) {
|
||||||
|
return "<div class=\"none-data\"><i class=\"fa fa-warning font-red-flamingo\"></i> "+requestContext.getMessage("noneData")+"</div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
if (pageNo == first) {// 如果是首页
|
if (pageNo == first) {// 如果是首页
|
||||||
sb.append("<li class=\"disabled\"><a href=\"javascript:\">« "+prevPage+"</a></li>\n");
|
sb.append("<li class=\"disabled\"><a href=\"javascript:\">« "+requestContext.getMessage("previousPage")+"</a></li>\n");
|
||||||
} else {
|
} else {
|
||||||
sb.append("<li><a href=\"javascript:\" onclick=\""+funcName+"("+prev+","+pageSize+",'"+funcParam+"');\">« "+prevPage+"</a></li>\n");
|
sb.append("<li><a href=\"javascript:\" onclick=\""+funcName+"("+prev+","+pageSize+",'"+funcParam+"');\">« "+requestContext.getMessage("previousPage")+"</a></li>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int begin = pageNo - (length / 2);
|
int begin = pageNo - (length / 2);
|
||||||
@@ -394,18 +397,18 @@ public class Page<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pageNo == last) {
|
if (pageNo == last) {
|
||||||
sb.append("<li class=\"disabled\"><a href=\"javascript:\">"+nextPage+" »</a></li>\n");
|
sb.append("<li class=\"disabled\"><a href=\"javascript:\">"+requestContext.getMessage("nextPage")+" »</a></li>\n");
|
||||||
} else {
|
} else {
|
||||||
sb.append("<li><a href=\"javascript:\" onclick=\""+funcName+"("+next+","+pageSize+",'"+funcParam+"');\">"
|
sb.append("<li><a href=\"javascript:\" onclick=\""+funcName+"("+next+","+pageSize+",'"+funcParam+"');\">"
|
||||||
+ ""+nextPage+" »</a></li>\n");
|
+ ""+requestContext.getMessage("nextPage")+" »</a></li>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append("<li class=\"disabled controls\"><a href=\"javascript:\">"+currentPage+" ");
|
sb.append("<li class=\"disabled controls\"><a href=\"javascript:\">"+requestContext.getMessage("current")+" ");
|
||||||
sb.append("<input type=\"text\" value=\""+pageNo+"\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)");
|
sb.append("<input type=\"text\" value=\""+pageNo+"\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)");
|
||||||
sb.append(funcName+"(this.value,"+pageSize+",'"+funcParam+"');\" onclick=\"this.select();\"/> / ");
|
sb.append(funcName+"(this.value,"+pageSize+",'"+funcParam+"');\" onclick=\"this.select();\"/> / ");
|
||||||
sb.append("<input type=\"text\" value=\""+last+"\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)");
|
sb.append("<input type=\"text\" value=\""+last+"\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)");
|
||||||
sb.append(funcName+"("+pageNo+",this.value,'"+funcParam+"');\" onclick=\"this.select();\"/> "+pageEn+",");
|
sb.append(funcName+"("+pageNo+",this.value,'"+funcParam+"');\" onclick=\"this.select();\"/> "+requestContext.getMessage("page")+",");
|
||||||
sb.append(""+TotalCount+" <span id='showTotalCount'>" + count + "</span> "+countPage+""+(message!=null?message:"")+"</a></li>\n");
|
sb.append(""+requestContext.getMessage("total")+" <span id='showTotalCount'>" + count + "</span> "+requestContext.getMessage("count")+""+(message!=null?message:"")+"</a></li>\n");
|
||||||
|
|
||||||
sb.insert(0,"<ul>\n").append("</ul>\n");
|
sb.insert(0,"<ul>\n").append("</ul>\n");
|
||||||
|
|
||||||
|
|||||||
@@ -261,6 +261,7 @@ sendind_org=sending organization
|
|||||||
no_node=Node can not be selected
|
no_node=Node can not be selected
|
||||||
select_icon=select icon
|
select_icon=select icon
|
||||||
nothing=nothing
|
nothing=nothing
|
||||||
|
noneData=Could not find any record that met the condition.
|
||||||
#==========message end=====================
|
#==========message end=====================
|
||||||
|
|
||||||
#==========yewuliexingguanli begin=====================
|
#==========yewuliexingguanli begin=====================
|
||||||
|
|||||||
@@ -220,6 +220,7 @@ maxlength_128=The maxlength is 128?
|
|||||||
maxlength_256=The maxlength is 256?
|
maxlength_256=The maxlength is 256?
|
||||||
maxlength_512=The maxlength is 512?
|
maxlength_512=The maxlength is 512?
|
||||||
maxlength_4000=The maxlength is 4000?
|
maxlength_4000=The maxlength is 4000?
|
||||||
|
noneData=Could not find any record that met the condition.
|
||||||
#==========message end=====================
|
#==========message end=====================
|
||||||
|
|
||||||
#==========yewuliexingguanli begin=====================
|
#==========yewuliexingguanli begin=====================
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ sendind_org=\u4e0b\u53d1\u5355\u4f4d
|
|||||||
no_node=\u4e0d\u80fd\u9009\u62e9\u8282\u70b9
|
no_node=\u4e0d\u80fd\u9009\u62e9\u8282\u70b9
|
||||||
select_icon=\u9009\u62e9\u56fe\u6807
|
select_icon=\u9009\u62e9\u56fe\u6807
|
||||||
nothing=\u65e0
|
nothing=\u65e0
|
||||||
|
noneData=\u6CA1\u6709\u67E5\u8BE2\u5230\u7B26\u5408\u6761\u4EF6\u7684\u8BB0\u5F55
|
||||||
#==========message end=====================
|
#==========message end=====================
|
||||||
|
|
||||||
#==========yewuliexingguanli begin=====================
|
#==========yewuliexingguanli begin=====================
|
||||||
|
|||||||
@@ -4,29 +4,20 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>机构管理</title>
|
<title>机构管理</title>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.ztree {overflow:auto;margin:0;_margin-top:10px;padding:10px 0 0 10px;}
|
#officeContent {
|
||||||
|
margin-left: 10px;
|
||||||
#left {
|
margin-top: -10px;
|
||||||
float:left;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#right,#openClose {
|
|
||||||
float:left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#openClose {width:6px;margin:0 1px;cursor:pointer;}
|
|
||||||
#openClose,#openClose.close {background:#efefef url("../global/img/openclose.png") no-repeat -29px center;}
|
|
||||||
#openClose.close {background-position:1px center;opacity:0.5;filter:alpha(opacity=50)}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<link href="${ctxStatic}/global/plugins/jquery-ztree/3.5.12/css/zTreeStyle/zTreeStyle.min.css" rel="stylesheet" type="text/css"/>
|
<link href="${ctxStatic}/global/plugins/jquery-ztree/3.5.12/css/zTreeStyle/zTreeStyle.min.css" rel="stylesheet" type="text/css"/>
|
||||||
<script src="${ctxStatic}/global/plugins/jquery-ztree/3.5.12/js/jquery.ztree.all-3.5.min.js" type="text/javascript"></script>
|
<script src="${ctxStatic}/global/plugins/jquery-ztree/3.5.12/js/jquery.ztree.all-3.5.min.js" type="text/javascript"></script>
|
||||||
<script src="${pageContext.request.contextPath}/global/scripts/mustache.min.js" type="text/javascript"></script>
|
<script src="${pageContext.request.contextPath}/global/scripts/mustache.min.js" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="page-content">
|
<div class="page-content-body">
|
||||||
<div class="theme-panel hidden-xs hidden-sm">
|
<div class="theme-panel hidden-xs hidden-sm">
|
||||||
<button type="button" class="btn btn-primary"
|
<button type="button" class="btn btn-primary"
|
||||||
onClick="javascript:window.location='${ctx}/sys/office/form?itType=${itType}'">
|
onClick="javascript:window.location='${ctx}/sys/office/form?itType=${itType}'">
|
||||||
<i class="fa fa-plus"></i>
|
<i class="fa fa-plus"></i>
|
||||||
@@ -37,22 +28,37 @@
|
|||||||
<spring:message code="officeManage"></spring:message>
|
<spring:message code="officeManage"></spring:message>
|
||||||
<small><spring:message code="date_list"/></small>
|
<small><spring:message code="date_list"/></small>
|
||||||
</h3>
|
</h3>
|
||||||
<h5 class="page-header"></h5>
|
|
||||||
|
<h5 class="page-header"></h5>
|
||||||
|
|
||||||
<sys:message content="${message}"/>
|
<sys:message content="${message}"/>
|
||||||
<div id="content" class="row-fluid">
|
|
||||||
<div id="left" class="accordion-group">
|
|
||||||
<div class="accordion-heading">
|
<div class="row">
|
||||||
<a class="accordion-toggle">组织机构<i class="icon-refresh pull-right" onclick="refreshTree();"></i></a>
|
<div class="col-md-2">
|
||||||
|
|
||||||
|
<div class="portlet light bordered">
|
||||||
|
<div class="portlet-title">
|
||||||
|
|
||||||
|
<div class="caption">
|
||||||
|
<i class="icon-list font-blue-sharp"></i>
|
||||||
|
<span class="caption-subject font-blue-sharp bold uppercase">组织机构</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
|
<a class="accordion-toggle"><i class="icon-refresh" onclick="refreshTree();"></i></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="ztree" class="ztree"></div>
|
|
||||||
</div>
|
<div id="ztree" class="ztree portlet-body"></div>
|
||||||
<div id="openClose" class="close"> </div>
|
</div>
|
||||||
<div id="right">
|
|
||||||
<iframe id="officeContent" src="${ctx}/sys/office/list?id=&parentIds=" frameborder="no" width="100%" height="91%"></iframe>
|
</div>
|
||||||
</div>
|
<div class="col-md-10">
|
||||||
</div>
|
<div id="officeContent"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
@@ -62,7 +68,28 @@
|
|||||||
var setting = {data:{simpleData:{enable:true,idKey:"id",pIdKey:"pId",rootPId:'0'}},
|
var setting = {data:{simpleData:{enable:true,idKey:"id",pIdKey:"pId",rootPId:'0'}},
|
||||||
callback:{onClick:function(event, treeId, treeNode){
|
callback:{onClick:function(event, treeId, treeNode){
|
||||||
var id = treeNode.pId ? treeNode.id : 1;
|
var id = treeNode.pId ? treeNode.id : 1;
|
||||||
$('#officeContent').attr("src","${ctx}/sys/office/list?id="+id+"&parentIds="+treeNode.pIds);
|
|
||||||
|
var pageContentBody = $('#officeContent');
|
||||||
|
var url = "${ctx}/sys/office/list?id="+id+"&parentIds="+treeNode.pIds;
|
||||||
|
|
||||||
|
App.startPageLoading({animate:true});
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
cache: false,
|
||||||
|
url: url,
|
||||||
|
dataType: "html",
|
||||||
|
success: function (res) {
|
||||||
|
App.stopPageLoading();
|
||||||
|
pageContentBody.html(res);
|
||||||
|
},
|
||||||
|
error: function (xhr, ajaxOptions, thrownError) {
|
||||||
|
pageContentBody.html('<h4>Could not load the requested content.</h4>');
|
||||||
|
App.stopPageLoading();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -81,20 +108,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var leftWidth = 180; // 左侧窗口大小
|
|
||||||
var htmlObj = $("html"), mainObj = $("#main");
|
|
||||||
var frameObj = $("#left, #openClose, #right, #right iframe");
|
|
||||||
function wSize(){
|
|
||||||
var strs = getWindowSize().toString().split(",");
|
|
||||||
htmlObj.css({"overflow-x":"hidden", "overflow-y":"hidden"});
|
|
||||||
mainObj.css("width","auto");
|
|
||||||
frameObj.height(strs[0] - 5);
|
|
||||||
var leftWidth = ($("#left").width() < 0 ? 0 : $("#left").width());
|
|
||||||
$("#right").width($("#content").width()- leftWidth - $("#openClose").width() -5);
|
|
||||||
$(".ztree").width(leftWidth - 10).height(frameObj.height() - 46);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/scripts/wsize.min.js" type="text/javascript"></script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21592,15 +21592,15 @@ Color library demo
|
|||||||
|
|
||||||
|
|
||||||
.none-data {
|
.none-data {
|
||||||
position: absolute;
|
|
||||||
display: block;
|
display: block;
|
||||||
padding: 20px 15px;
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-bottom: 1px solid #ddd;
|
border-bottom: 1px solid #ddd;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: -1px;
|
margin-top: -1px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
height: 100px;
|
||||||
|
line-height: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user