From 85cca6de4d00b1ec93ea23139846fc315690f4e7 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Sat, 13 Jul 2019 22:48:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=8C=E6=94=BF=E5=8C=BA=E5=88=92=20jqgrid?= =?UTF-8?q?=20=E6=A0=91=E8=A1=A8=E6=94=AF=E6=8C=81=E4=B8=80=E7=BA=A7?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=E8=A1=A8=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/sys/web/AreaController.java | 20 +++++++++++++++++++ .../main/resources/views/include/head.html | 9 ++++----- .../resources/views/modules/sys/areaList.html | 3 ++- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/AreaController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/AreaController.java index 273bd432..b119806b 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/AreaController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/AreaController.java @@ -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 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 page = areaService.findPage(area); + return page; + } + /** * 查看编辑区域 * @param area diff --git a/modules/core/src/main/resources/views/include/head.html b/modules/core/src/main/resources/views/include/head.html index 8d9a368b..b7ae035e 100644 --- a/modules/core/src/main/resources/views/include/head.html +++ b/modules/core/src/main/resources/views/include/head.html @@ -1,9 +1,8 @@ <%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved. */%> - + + + + ${(isNotBlank(title!) ? title! + ' - ' : '') + @Global.getConfig('productName')} diff --git a/modules/core/src/main/resources/views/modules/sys/areaList.html b/modules/core/src/main/resources/views/modules/sys/areaList.html index 95a4e58b..528134b0 100644 --- a/modules/core/src/main/resources/views/modules/sys/areaList.html +++ b/modules/core/src/main/resources/views/modules/sys/areaList.html @@ -16,7 +16,7 @@
- <#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}">
@@ -42,6 +42,7 @@
+