shuzheng 9 лет назад
Родитель
Сommit
17c6e3b826

+ 12 - 6
zheng-upms/zheng-upms-server/src/main/java/com/zheng/upms/server/controller/manage/UpmsOrganizationController.java

@@ -16,7 +16,9 @@ import org.springframework.ui.ModelMap;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 组织controller
@@ -49,14 +51,18 @@ public class UpmsOrganizationController extends BaseController {
             @RequestParam(required = false, value = "sort") String sort,
             @RequestParam(required = false, value = "order") String order) {
         // 数据列表
-        UpmsOrganizationExample upmsupmsOrganizationExample = new UpmsOrganizationExample();
-        upmsupmsOrganizationExample.setOffset(offset);
-        upmsupmsOrganizationExample.setLimit(limit);
+        UpmsOrganizationExample upmsOrganizationExample = new UpmsOrganizationExample();
+        upmsOrganizationExample.setOffset(offset);
+        upmsOrganizationExample.setLimit(limit);
         if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
-            upmsupmsOrganizationExample.setOrderByClause(sort + " " + order);
+            upmsOrganizationExample.setOrderByClause(sort + " " + order);
         }
-        List<UpmsOrganization> organizations = upmsOrganizationService.selectByExample(upmsupmsOrganizationExample);
-        return organizations;
+        List<UpmsOrganization> rows = upmsOrganizationService.selectByExample(upmsOrganizationExample);
+        long total = upmsOrganizationService.countByExample(upmsOrganizationExample);
+        Map<String, Object> result = new HashMap<>();
+        result.put("rows", rows);
+        result.put("total", total);
+        return result;
     }
 
     @ApiOperation(value = "新增组织")

+ 8 - 2
zheng-upms/zheng-upms-server/src/main/java/com/zheng/upms/server/controller/manage/UpmsPermissionController.java

@@ -15,7 +15,9 @@ import org.springframework.ui.ModelMap;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 权限controller
@@ -73,8 +75,12 @@ public class UpmsPermissionController extends BaseController {
         if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
             upmsPermissionExample.setOrderByClause(sort + " " + order);
         }
-        List<UpmsPermission> permissions = upmsPermissionService.selectByExample(upmsPermissionExample);
-        return permissions;
+        List<UpmsPermission> rows = upmsPermissionService.selectByExample(upmsPermissionExample);
+        long total = upmsPermissionService.countByExample(upmsPermissionExample);
+        Map<String, Object> result = new HashMap<>();
+        result.put("rows", rows);
+        result.put("total", total);
+        return result;
     }
 
     @ApiOperation(value = "新增权限")

+ 8 - 2
zheng-upms/zheng-upms-server/src/main/java/com/zheng/upms/server/controller/manage/UpmsRoleController.java

@@ -15,7 +15,9 @@ import org.springframework.ui.ModelMap;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 角色controller
@@ -54,8 +56,12 @@ public class UpmsRoleController extends BaseController {
         if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
             upmsRoleExample.setOrderByClause(sort + " " + order);
         }
-        List<UpmsRole> roles = upmsRoleService.selectByExample(upmsRoleExample);
-        return roles;
+        List<UpmsRole> rows = upmsRoleService.selectByExample(upmsRoleExample);
+        long total = upmsRoleService.countByExample(upmsRoleExample);
+        Map<String, Object> result = new HashMap<>();
+        result.put("rows", rows);
+        result.put("total", total);
+        return result;
     }
 
     @ApiOperation(value = "新增角色")

+ 11 - 3
zheng-upms/zheng-upms-server/src/main/java/com/zheng/upms/server/controller/manage/UpmsSystemController.java

@@ -15,7 +15,9 @@ import org.springframework.ui.ModelMap;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 系统controller
@@ -51,9 +53,15 @@ public class UpmsSystemController extends BaseController {
 		UpmsSystemExample upmsSystemExample = new UpmsSystemExample();
 		upmsSystemExample.setOffset(offset);
 		upmsSystemExample.setLimit(limit);
-		List<UpmsSystem> systems = upmsSystemService.selectByExample(upmsSystemExample);
-//		long total = upmsSystemService.countByExample(upmsSystemExample);
-		return systems;
+		if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
+			upmsSystemExample.setOrderByClause(sort + " " + order);
+		}
+		List<UpmsSystem> rows = upmsSystemService.selectByExample(upmsSystemExample);
+		long total = upmsSystemService.countByExample(upmsSystemExample);
+		Map<String, Object> result = new HashMap<>();
+		result.put("rows", rows);
+		result.put("total", total);
+		return result;
 	}
 
 	@ApiOperation(value = "新增系统")

+ 8 - 2
zheng-upms/zheng-upms-server/src/main/java/com/zheng/upms/server/controller/manage/UpmsUserController.java

@@ -15,7 +15,9 @@ import org.springframework.ui.ModelMap;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 用户controller
@@ -54,8 +56,12 @@ public class UpmsUserController extends BaseController {
         if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
             upmsUserExample.setOrderByClause(sort + " " + order);
         }
-        List<UpmsUser> users = upmsUserService.selectByExample(upmsUserExample);
-        return users;
+        List<UpmsUser> rows = upmsUserService.selectByExample(upmsUserExample);
+        long total = upmsUserService.countByExample(upmsUserExample);
+        Map<String, Object> result = new HashMap<>();
+        result.put("rows", rows);
+        result.put("total", total);
+        return result;
     }
 
     @ApiOperation(value = "新增用户")

+ 9 - 1
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/index.jsp

@@ -49,13 +49,21 @@ $(function() {
 		detailView: true,
 		detailFormatter: 'detailFormatter',
 		pagination: true,
+		paginationLoop: false,
+		sidePagination: 'server',
+		silentSort: false,
+		smartDisplay: false,
+		escape: true,
+		searchOnEnterKey: true,
+		idField: 'organizationId',
+		maintainSelected: true,
 		toolbar: '#toolbar',
 		columns: [
 			{field: 'state', checkbox: true},
 			{field: 'organizationId', title: '编号', sortable: true, align: 'center'},
 			{field: 'name', title: '组织名称'},
             {field: 'description', title: '组织描述'},
-			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
+			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
 		]
 	}).on('all.bs.table', function (e, name, args) {
 		$('[data-toggle="tooltip"]').tooltip();

+ 9 - 1
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/permission/button.jsp

@@ -49,6 +49,14 @@ $(function() {
 		detailView: true,
 		detailFormatter: 'detailFormatter',
 		pagination: true,
+		paginationLoop: false,
+		sidePagination: 'server',
+		silentSort: false,
+		smartDisplay: false,
+		escape: true,
+		searchOnEnterKey: true,
+		idField: 'permissionId',
+		maintainSelected: true,
 		toolbar: '#toolbar',
 		columns: [
 			{field: 'state', checkbox: true},
@@ -61,7 +69,7 @@ $(function() {
 			{field: 'uri', title: '路径'},
 			{field: 'icon', title: '图标', align: 'center', formatter: 'iconFormatter'},
 			{field: 'status', title: '状态', sortable: true, align: 'center', formatter: 'statusFormatter'},
-			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
+			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
 		]
 	}).on('all.bs.table', function (e, name, args) {
 		$('[data-toggle="tooltip"]').tooltip();

+ 9 - 1
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/permission/index.jsp

@@ -49,6 +49,14 @@ $(function() {
 		detailView: true,
 		detailFormatter: 'detailFormatter',
 		pagination: true,
+		paginationLoop: false,
+		sidePagination: 'server',
+		silentSort: false,
+		smartDisplay: false,
+		escape: true,
+		searchOnEnterKey: true,
+		idField: 'permissionId',
+		maintainSelected: true,
 		toolbar: '#toolbar',
 		columns: [
 			{field: 'state', checkbox: true},
@@ -61,7 +69,7 @@ $(function() {
 			{field: 'uri', title: '路径'},
 			{field: 'icon', title: '图标', align: 'center', formatter: 'iconFormatter'},
 			{field: 'status', title: '状态', sortable: true, align: 'center', formatter: 'statusFormatter'},
-			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
+			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
 		]
 	}).on('all.bs.table', function (e, name, args) {
 		$('[data-toggle="tooltip"]').tooltip();

+ 9 - 1
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/permission/menu.jsp

@@ -49,6 +49,14 @@ $(function() {
 		detailView: true,
 		detailFormatter: 'detailFormatter',
 		pagination: true,
+		paginationLoop: false,
+		sidePagination: 'server',
+		silentSort: false,
+		smartDisplay: false,
+		escape: true,
+		searchOnEnterKey: true,
+		idField: 'permissionId',
+		maintainSelected: true,
 		toolbar: '#toolbar',
 		columns: [
 			{field: 'state', checkbox: true},
@@ -61,7 +69,7 @@ $(function() {
 			{field: 'uri', title: '路径'},
 			{field: 'icon', title: '图标', align: 'center', formatter: 'iconFormatter'},
 			{field: 'status', title: '状态', sortable: true, align: 'center', formatter: 'statusFormatter'},
-			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
+			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
 		]
 	}).on('all.bs.table', function (e, name, args) {
 		$('[data-toggle="tooltip"]').tooltip();

+ 9 - 1
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/role/index.jsp

@@ -49,13 +49,21 @@ $(function() {
 		detailView: true,
 		detailFormatter: 'detailFormatter',
 		pagination: true,
+		paginationLoop: false,
+		sidePagination: 'server',
+		silentSort: false,
+		smartDisplay: false,
+		escape: true,
+		searchOnEnterKey: true,
+		idField: 'roleId',
+		maintainSelected: true,
 		toolbar: '#toolbar',
 		columns: [
 			{field: 'state', checkbox: true},
 			{field: 'roleId', title: '编号', sortable: true, align: 'center'},
 			{field: 'name', title: '角色名称'},
             {field: 'description', title: '角色描述'},
-			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
+			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
 		]
 	}).on('all.bs.table', function (e, name, args) {
 		$('[data-toggle="tooltip"]').tooltip();

+ 2 - 2
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/system/index.jsp

@@ -50,8 +50,8 @@ $(function() {
 		detailFormatter: 'detailFormatter',
 		pagination: true,
 		paginationLoop: false,
-//		sidePagination: 'server',
-//		silentSort: false,
+		sidePagination: 'server',
+		silentSort: false,
 		smartDisplay: false,
 		escape: true,
 		searchOnEnterKey: true,

+ 9 - 1
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/user/index.jsp

@@ -49,6 +49,14 @@ $(function() {
 		detailView: true,
 		detailFormatter: 'detailFormatter',
 		pagination: true,
+		paginationLoop: false,
+		sidePagination: 'server',
+		silentSort: false,
+		smartDisplay: false,
+		escape: true,
+		searchOnEnterKey: true,
+		idField: 'userId',
+		maintainSelected: true,
 		toolbar: '#toolbar',
 		columns: [
 			{field: 'state', checkbox: true},
@@ -60,7 +68,7 @@ $(function() {
 			{field: 'email', title: '邮箱'},
 			{field: 'sex', title: '性别', formatter: 'sexFormatter'},
 			{field: 'locked', title: '状态', sortable: true, align: 'center', formatter: 'statusFormatter'},
-			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents'}
+			{field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
 		]
 	}).on('all.bs.table', function (e, name, args) {
 		$('[data-toggle="tooltip"]').tooltip();