行政区划 jqgrid 树表支持一级数据列表分页
This commit is contained in:
@@ -6,6 +6,9 @@ package com.jeesite.modules.sys.web;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -20,6 +23,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
@@ -78,6 +82,22 @@ public class AreaController extends BaseController {
|
||||
return list;
|
||||
}
|
||||
|
||||
@RequiresPermissions("sys:area:view")
|
||||
@RequestMapping(value = "listPageData")
|
||||
@ResponseBody
|
||||
public Page<Area> listPageData(Area area, HttpServletRequest request, HttpServletResponse response) {
|
||||
if (StringUtils.isBlank(area.getParentCode())) {
|
||||
area.setParentCode(Area.ROOT_CODE);
|
||||
}
|
||||
if (StringUtils.isNotBlank(area.getAreaCode())
|
||||
|| StringUtils.isNotBlank(area.getAreaName())){
|
||||
area.setParentCode(null);
|
||||
}
|
||||
area.setPage(new Page<>(request, response, !area.getIsRoot() ? Page.PAGE_SIZE_NOT_PAGING : null));
|
||||
Page<Area> page = areaService.findPage(area);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑区域
|
||||
* @param area
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved. */%>
|
||||
<meta charset="utf-8"><meta content="webkit" name="renderer"/><meta http-equiv="X-UA-Compatible"
|
||||
content="IE=edge"><meta name="keywords" content="PoweredByJeeSiteV4.0"/><meta http-equiv="Cache-Control"
|
||||
content="no-cache, no-store, must-revalidate"/><meta name="description" content="PoweredByJeeSiteV4.0"/><meta
|
||||
content="no-cache" http-equiv="Pragma"/><meta http-equiv="Expires" content="0"/><meta
|
||||
content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
|
||||
<meta charset="utf-8"><meta content="webkit" name="renderer"/><meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="keywords" content="PoweredByJeeSiteV4.0"/><meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
|
||||
<meta name="description" content="PoweredByJeeSiteV4.0"/><meta content="no-cache" http-equiv="Pragma"/><meta http-equiv="Expires" content="0"/>
|
||||
<meta content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
|
||||
<title>${(isNotBlank(title!) ? title! + ' - ' : '') + @Global.getConfig('productName')}</title>
|
||||
<link rel="shortcut icon" href="${ctxStatic}/favicon.png" type="image/png">
|
||||
<script src="${ctxPath}/global.min.js?ctx=${ctx}"></script>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<#form:form id="searchForm" model="${area}" action="${ctx}/sys/area/listData" method="post" class="form-inline hide"
|
||||
<#form:form id="searchForm" model="${area}" action="${ctx}/sys/area/listPageData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">区域代码:</label>
|
||||
@@ -42,6 +42,7 @@
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
<div id="dataGridPage"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user