From b4fb42657a015cd6b3356f1f1eb15bfd86d726aa Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Thu, 18 Oct 2018 18:36:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/skyeye/authority/dao/RmTypeDao.java | 12 ++ .../authority/service/RmTypeService.java | 10 ++ .../service/impl/RmTypeServiceImpl.java | 43 +++++++ .../controller/RmTypeController.java | 33 +++++ .../main/resources/dbmapper/RmTypeMapper.xml | 21 ++++ .../src/main/resources/mapping/reqmapping.xml | 7 ++ .../src/main/webapp/js/rmtype/rmtypelist.js | 113 ++++++++++++++++++ .../main/webapp/tpl/rmtype/rmtypelist.html | 49 ++++++++ 8 files changed, 288 insertions(+) create mode 100644 skyeye-dao/src/main/java/com/skyeye/authority/dao/RmTypeDao.java create mode 100644 skyeye-service/src/main/java/com/skyeye/authority/service/RmTypeService.java create mode 100644 skyeye-service/src/main/java/com/skyeye/authority/service/impl/RmTypeServiceImpl.java create mode 100644 skyeye-web/src/main/java/com/skyeye/authority/controller/RmTypeController.java create mode 100644 skyeye-web/src/main/resources/dbmapper/RmTypeMapper.xml create mode 100644 skyeye-web/src/main/webapp/js/rmtype/rmtypelist.js create mode 100644 skyeye-web/src/main/webapp/tpl/rmtype/rmtypelist.html diff --git a/skyeye-dao/src/main/java/com/skyeye/authority/dao/RmTypeDao.java b/skyeye-dao/src/main/java/com/skyeye/authority/dao/RmTypeDao.java new file mode 100644 index 000000000..13d6e4123 --- /dev/null +++ b/skyeye-dao/src/main/java/com/skyeye/authority/dao/RmTypeDao.java @@ -0,0 +1,12 @@ +package com.skyeye.authority.dao; + +import java.util.List; +import java.util.Map; + +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; + +public interface RmTypeDao { + + public List> queryRmTypeList(Map map, PageBounds pageBounds) throws Exception; + +} diff --git a/skyeye-service/src/main/java/com/skyeye/authority/service/RmTypeService.java b/skyeye-service/src/main/java/com/skyeye/authority/service/RmTypeService.java new file mode 100644 index 000000000..7e9624e29 --- /dev/null +++ b/skyeye-service/src/main/java/com/skyeye/authority/service/RmTypeService.java @@ -0,0 +1,10 @@ +package com.skyeye.authority.service; + +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; + +public interface RmTypeService { + + public void queryRmTypeList(InputObject inputObject, OutputObject outputObject) throws Exception; + +} diff --git a/skyeye-service/src/main/java/com/skyeye/authority/service/impl/RmTypeServiceImpl.java b/skyeye-service/src/main/java/com/skyeye/authority/service/impl/RmTypeServiceImpl.java new file mode 100644 index 000000000..abca45732 --- /dev/null +++ b/skyeye-service/src/main/java/com/skyeye/authority/service/impl/RmTypeServiceImpl.java @@ -0,0 +1,43 @@ +package com.skyeye.authority.service.impl; + +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import com.github.miemiedev.mybatis.paginator.domain.PageList; +import com.skyeye.authority.dao.RmTypeDao; +import com.skyeye.authority.service.RmTypeService; +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; + +@Service +public class RmTypeServiceImpl implements RmTypeService{ + + @Autowired + private RmTypeDao rmTypeDao; + + /** + * + * @Title: querySysMenuList + * @Description: 获取小程序分类列表 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void queryRmTypeList(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + List> beans = rmTypeDao.queryRmTypeList(map, + new PageBounds(Integer.parseInt(map.get("page").toString()), Integer.parseInt(map.get("limit").toString()))); + PageList> beansPageList = (PageList>)beans; + int total = beansPageList.getPaginator().getTotalCount(); + outputObject.setBeans(beans); + outputObject.settotal(total); + } + + + +} diff --git a/skyeye-web/src/main/java/com/skyeye/authority/controller/RmTypeController.java b/skyeye-web/src/main/java/com/skyeye/authority/controller/RmTypeController.java new file mode 100644 index 000000000..5c8e72e57 --- /dev/null +++ b/skyeye-web/src/main/java/com/skyeye/authority/controller/RmTypeController.java @@ -0,0 +1,33 @@ +package com.skyeye.authority.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.skyeye.authority.service.RmTypeService; +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; + +@Controller +public class RmTypeController { + + @Autowired + private RmTypeService rmTypeService; + + /** + * + * @Title: querySysMenuList + * @Description: 获取小程序分类列表 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/RmTypeController/queryRmTypeList") + @ResponseBody + public void queryRmTypeList(InputObject inputObject, OutputObject outputObject) throws Exception{ + rmTypeService.queryRmTypeList(inputObject, outputObject); + } + +} diff --git a/skyeye-web/src/main/resources/dbmapper/RmTypeMapper.xml b/skyeye-web/src/main/resources/dbmapper/RmTypeMapper.xml new file mode 100644 index 000000000..2756c1385 --- /dev/null +++ b/skyeye-web/src/main/resources/dbmapper/RmTypeMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/skyeye-web/src/main/resources/mapping/reqmapping.xml b/skyeye-web/src/main/resources/mapping/reqmapping.xml index 3d4ccf44d..f139e2ddd 100644 --- a/skyeye-web/src/main/resources/mapping/reqmapping.xml +++ b/skyeye-web/src/main/resources/mapping/reqmapping.xml @@ -142,6 +142,13 @@ + + + + + + + \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/js/rmtype/rmtypelist.js b/skyeye-web/src/main/webapp/js/rmtype/rmtypelist.js new file mode 100644 index 000000000..f839db490 --- /dev/null +++ b/skyeye-web/src/main/webapp/js/rmtype/rmtypelist.js @@ -0,0 +1,113 @@ + +var rowId = ""; +layui.config({ + base: basePath, + version: skyeyeVersion +}).define(['table', 'jquery', 'winui', 'form'], function (exports) { + + winui.renderColor(); + + var $ = layui.$, + form = layui.form, + table = layui.table; + //表格渲染 + table.render({ + id: 'messageTable', + elem: '#messageTable', + method: 'post', + url: reqBasePath + 'rmxcx001', + where:{rmTypeName:$("#rmTypeName").val()}, + even:true, //隔行变色 + page: true, + limits: [8, 16, 24, 32, 40, 48, 56], + limit: 8, + cols: [[ + { title: '序号', type: 'numbers'}, + { field: 'rmTypeName', title: '分类名称', width: 120 }, + { field: 'groupNum', title: '组件数量', width: 520 }, + { field: 'createTime', title: '创建时间', width: 180 }, + { title: '操作', fixed: 'right', align: 'center', width: 120, toolbar: '#tableBar'} + ]] + }); + + table.on('tool(messageTable)', function (obj) { //注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值" + var data = obj.data; //获得当前行数据 + var layEvent = obj.event; //获得 lay-event 对应的值 + if (layEvent === 'del') { //删除 + del(data, obj); + }else if (layEvent === 'edit') { //编辑 + edit(data); + } + }); + + //搜索表单 + form.render(); + form.on('submit(formSearch)', function (data) { + //表单验证 + if (winui.verifyForm(data.elem)) { + loadTable(); + } + return false; + }); + + //删除 + function del(data, obj){ + var msg = obj ? '确认删除分类【' + obj.data.rmTypeName + '】吗?' : '确认删除选中数据吗?'; + layer.confirm(msg, { icon: 3, title: '删除分类' }, function (index) { + layer.close(index); + //向服务端发送删除指令 + AjaxPostUtil.request({url:reqBasePath + "sys018", params:{rowId: data.id}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + top.winui.window.msg("删除成功", {icon: 1,time: 2000}); + loadTable(); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + }); + } + + //编辑分类 + function edit(data){ + rowId = data.id; + _openNewWindows({ + url: "../../tpl/syseverole/syseveroleedit.html", + title: "编辑分类", + pageId: "syseveroleedit", + callBack: function(refreshCode){ + if (refreshCode == '0') { + top.winui.window.msg("操作成功", {icon: 1,time: 2000}); + loadTable(); + } else if (refreshCode == '-9999') { + top.winui.window.msg("操作失败", {icon: 2,time: 2000}); + } + }}); + } + + //刷新数据 + $("body").on("click", "#reloadTable", function(){ + loadTable(); + }); + + //新增分类 + $("body").on("click", "#addBean", function(){ + _openNewWindows({ + url: "../../tpl/syseverole/syseveroleadd.html", + title: "新增分类", + pageId: "syseveroleadd", + callBack: function(refreshCode){ + if (refreshCode == '0') { + top.winui.window.msg("操作成功", {icon: 1,time: 2000}); + loadTable(); + } else if (refreshCode == '-9999') { + top.winui.window.msg("操作失败", {icon: 2,time: 2000}); + } + }}); + }); + + function loadTable(){ + table.reload("messageTable", {where:{rmTypeName:$("#rmTypeName").val()}}); + } + + exports('syseverolelist', {}); +}); diff --git a/skyeye-web/src/main/webapp/tpl/rmtype/rmtypelist.html b/skyeye-web/src/main/webapp/tpl/rmtype/rmtypelist.html new file mode 100644 index 000000000..c548b5e5e --- /dev/null +++ b/skyeye-web/src/main/webapp/tpl/rmtype/rmtypelist.html @@ -0,0 +1,49 @@ + + + + + + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+ +
+ + + + + \ No newline at end of file -- GitLab