From c5b2b8d5ca471f40d6cf7e39deb3196504dcfd62 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 4 Jun 2018 18:22:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ruoyi/RuoYiApplication.java | 1 + .../project/tool/swagger/TestController.java | 8 +++---- .../resources/static/ruoyi/js/ry-table.js | 21 +++++-------------- .../static/ruoyi/system/role/role.js | 2 +- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/ruoyi/RuoYiApplication.java b/src/main/java/com/ruoyi/RuoYiApplication.java index 991c3c41e..dd0f8b1ca 100644 --- a/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/src/main/java/com/ruoyi/RuoYiApplication.java @@ -17,6 +17,7 @@ public class RuoYiApplication { public static void main(String[] args) { + // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + " .-------. ____ __ \n" + diff --git a/src/main/java/com/ruoyi/project/tool/swagger/TestController.java b/src/main/java/com/ruoyi/project/tool/swagger/TestController.java index 217c5e68c..ea5b03745 100644 --- a/src/main/java/com/ruoyi/project/tool/swagger/TestController.java +++ b/src/main/java/com/ruoyi/project/tool/swagger/TestController.java @@ -38,17 +38,17 @@ public class TestController @ApiOperation("新增用户") @PostMapping("save") - public Message save(Test Test) + public Message save(Test test) { - return testList.add(Test) ? Message.success() : Message.error(); + return testList.add(test) ? Message.success() : Message.error(); } @ApiOperation("更新用户") @ApiImplicitParam(name = "Test", value = "单个用户信息", dataType = "Test") @PutMapping("update") - public Message update(Test Test) + public Message update(Test test) { - return testList.remove(Test) && testList.add(Test) ? Message.success() : Message.error(); + return testList.remove(test) && testList.add(test) ? Message.success() : Message.error(); } @ApiOperation("删除用户") diff --git a/src/main/resources/static/ruoyi/js/ry-table.js b/src/main/resources/static/ruoyi/js/ry-table.js index 5a51a6305..1846e7fc8 100644 --- a/src/main/resources/static/ruoyi/js/ry-table.js +++ b/src/main/resources/static/ruoyi/js/ry-table.js @@ -4,12 +4,12 @@ */ (function($) { $.extend({ - ryTable: { + table: { _option: {}, _params: {}, init: function(options) { - $.ryTable._option = options; - $.ryTable._params = options.queryParams == null ? $.ryTable.queryParams : options.queryParams; + $.table._option = options; + $.table._params = options.queryParams == null ? $.table.queryParams : options.queryParams; $('.bootstrap-table').bootstrapTable({ url: options.url, // 请求后台的URL(*) contentType: "application/x-www-form-urlencoded", // 编码类型 @@ -24,7 +24,7 @@ pageNumber: 1, // 初始化加载第一页,默认第一页 pageSize: 10, // 每页的记录行数(*) pageList: [10, 25, 50], // 可供选择的每页的行数(*) - queryParams: $.ryTable._params, // 传递参数(*) + queryParams: $.table._params, // 传递参数(*) columns: options.columns // 显示列信息(*) }); }, @@ -40,20 +40,9 @@ }, refresh: function() { $(".bootstrap-table").bootstrapTable('refresh', { - url: $.ryTable._option.url + url: $.table._option.url }); } } }); })(jQuery); - -function default_params(params) { - return { - // 传递参数查询参数 - pageSize: params.limit, - pageNum: params.offset / params.limit + 1, - searchValue: params.search, - orderByColumn: params.sort, - isAsc: params.order - }; -} \ No newline at end of file diff --git a/src/main/resources/static/ruoyi/system/role/role.js b/src/main/resources/static/ruoyi/system/role/role.js index 986d130bc..dd235d9a2 100644 --- a/src/main/resources/static/ruoyi/system/role/role.js +++ b/src/main/resources/static/ruoyi/system/role/role.js @@ -50,7 +50,7 @@ $(function() { } }] }; - $.ryTable.init(options); + $.table.init(options); }); /*角色管理-搜索*/