提交 c563bdfe 编写于 作者: doc_wei's avatar doc_wei

修改错误页面路径,添加菜单列表页面

上级 45e7b3fc
package com.skyeye.authority.dao;
import java.util.List;
import java.util.Map;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
public interface SysEveMenuDao {
public List<Map<String, Object>> querySysMenuList(Map<String, Object> map, PageBounds pageBounds) throws Exception;
}
package com.skyeye.authority.service;
import com.skyeye.common.object.InputObject;
import com.skyeye.common.object.OutputObject;
public interface SysEveMenuService {
public void querySysMenuList(InputObject inputObject, OutputObject outputObject) throws Exception;
}
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.SysEveMenuDao;
import com.skyeye.authority.service.SysEveMenuService;
import com.skyeye.common.object.InputObject;
import com.skyeye.common.object.OutputObject;
@Service
public class SysEveMenuServiceImpl implements SysEveMenuService{
@Autowired
private SysEveMenuDao sysEveMenuDao;
/**
*
* @Title: querySysMenuList
* @Description: 获取菜单列表
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public void querySysMenuList(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
List<Map<String, Object>> beans = sysEveMenuDao.querySysMenuList(map,
new PageBounds(Integer.parseInt(map.get("page").toString()), Integer.parseInt(map.get("limit").toString())));
PageList<Map<String, Object>> beansPageList = (PageList<Map<String, Object>>)beans;
int total = beansPageList.getPaginator().getTotalCount();
outputObject.setBeans(beans);
outputObject.settotal(total);
}
}
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.SysEveMenuService;
import com.skyeye.common.object.InputObject;
import com.skyeye.common.object.OutputObject;
@Controller
public class SysEveMenuController {
@Autowired
private SysEveMenuService sysEveMenuService;
/**
*
* @Title: querySysMenuList
* @Description: 获取菜单列表
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/SysEveMenuController/querySysMenuList")
@ResponseBody
public void querySysMenuList(InputObject inputObject, OutputObject outputObject) throws Exception{
sysEveMenuService.querySysMenuList(inputObject, outputObject);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.skyeye.authority.dao.SysEveMenuDao">
<select id="querySysMenuList" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id,
a.menu_name menuName,
a.menu_icon menuIcon,
a.title_name titleName,
a.menu_level menuLevel,
a.menu_type menuType,
a.menu_sys_type menuSysType,
a.menu_parent_id parentId,
a.menu_url menuUrl,
CONVERT(a.create_time, char) createTime
FROM
sys_eve_menu a
LEFT JOIN sys_eve_user b ON a.creater = a.id
WHERE 1=1
<if test="menuName != '' and menuName != null">
a.menu_name like '%${menuName}%'
</if>
ORDER BY a.create_time DESC
</select>
</mapper>
\ No newline at end of file
......@@ -22,5 +22,10 @@
<property id="userName" name="userName" ref="required" var="用户名" />
<property id="userPhoto" name="userPhoto" ref="required" var="头像" />
</url>
<url id="sys006" path="/post/SysEveMenuController/querySysMenuList" val="获取菜单列表">
<property id="limit" name="limit" ref="required" var="分页参数,每页多少条数据" />
<property id="page" name="page" ref="required" var="分页参数,第几页"/>
<property id="menuName" name="menuName" ref="" var="菜单名称"/>
</url>
</controller>
\ No newline at end of file
......@@ -34,7 +34,7 @@
},
{
"title": "更新日志",
"pageURL": "../../systemlog/index",
"pageURL": "../../systemlog/index.html",
"name": "更新日志",
"icon": "fa-clock-o",
"openType": 1,
......
......@@ -48,7 +48,7 @@
},
{
"title": "系统菜单",
"pageURL": "../../menu/list_iframe.html",
"pageURL": "../../tpl/sysevemenu/sysevemenulist.html",
"name": "系统菜单",
"icon": "fa-navicon",
"openType": 2,
......@@ -70,7 +70,7 @@
},
{
"title": "更新日志",
"pageURL": "../../systemlog/index",
"pageURL": "../../systemlog/index.html",
"name": "更新日志",
"icon": "fa-clock-o",
"openType": 1,
......
......@@ -155,7 +155,7 @@
}
$.ajax({
type: 'get',
url: 'error/' + page,
url: reqBasePath + 'tpl/sysmessage/' + page,
async: false,
success: function (data) {
content = data;
......
layui.config({
base: basePath,
version: skyeyeVersion
}).define(['table', 'jquery', 'winui'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
var $ = layui.$;
form.render();
form.on('submit(formAddMenu)', function (data) {
//表单验证
if (winui.verifyForm(data.elem)) {
//执行上传操作
$("#showForm").find('.fileUploadContent').each(function(i, dom) {
var id = $(dom).attr('id');
if(id != undefined && id == 'userPhoto') {
var opt = uploadTools.getOpt(id);
if(uploadTools.getFileNumber(opt) > 0) {
uploadTools.uploadFile(opt);
}
}
});
var params = {
rowId: parent.rowId,
userName: $("#userName").val(),
userIdCard: $("#userIdCard").val(),
userSex: $("input[name='userSex']:checked").val(),
userPhoto: "11"
};
AjaxPostUtil.request({url:reqBasePath + "sys005", params:params, type:'json', callback:function(json){
if(json.returnCode == 0){
parent.layer.close(index);
parent.refreshCode = '0';
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
}});
}
return false;
});
$("body").on("click", "#cancle", function(){
parent.layer.close(index);
});
});
});
\ No newline at end of file
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).define(['table', 'jquery', 'winui'], function (exports) {
winui.renderColor();
var $ = layui.$,
table = layui.table;
//表格渲染
table.render({
id: 'messageTable',
elem: '#messageTable',
url: reqBasePath + 'sys006',
where:{menuName:""},
even:true, //隔行变色
page: true,
limits: [8, 16, 24, 32, 40, 48, 56],
limit: 8,
cols: [[
{ field: 'id', type: 'checkbox' },
{ field: 'menuName', title: '菜单名称', width: 120 },
{ field: 'menuIcon', title: '图标码', width: 120 },
{ field: 'titleName', title: '标题名称', width: 120 },
{ field: 'menuLevel', title: '菜单级别', width: 120},
{ field: 'menuType', title: '菜单链接类型', width: 160 },
{ field: 'menuUrl', title: '系统菜单', width: 60 },
{ field: 'menuSysType', title: '系统菜单', width: 60, templet: function(d){
if(d.menuSysType == 2){
return '';
}else if(d.menuSysType == 1){
return '';
}else{
return '参数错误';
}
}},
{ 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);
}else if (layEvent === 'edit') { //编辑
edit(data);
}
});
//删除
function del(data){
}
//编辑
function edit(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/syseveuser/syseveuseredit.html",
title: "编辑用户",
pageId: "syseveuseredit",
callBack: function(refreshCode){
if (refreshCode == '0') {
top.winui.window.msg("操作成功", {icon: 1,time: 2000});
table.reload("messageTable", {userName:""});
} else if (refreshCode == '-9999') {
top.winui.window.msg("操作失败", {icon: 2,time: 2000});
}
}});
}
//刷新数据
$("body").on("click", "#reloadTable", function(){
table.reload("messageTable", {menuName:""});
});
//新增菜单
$("body").on("click", "#addBean", function(){
_openNewWindows({
url: "../../tpl/sysevemenu/sysevemenuadd.html",
title: "新增菜单",
pageId: "sysevemenuadd",
callBack: function(refreshCode){
if (refreshCode == '0') {
top.winui.window.msg("操作成功", {icon: 1,time: 2000});
table.reload("messageTable", {menuName:""});
} else if (refreshCode == '-9999') {
top.winui.window.msg("操作失败", {icon: 2,time: 2000});
}
}});
});
exports('sysevemenulist', {});
});
......@@ -62,7 +62,7 @@ layui.config({
}
});
form.render();
form.on('submit(formEditMenu)', function (data) {
form.on('submit(formEditUser)', function (data) {
// console.log(data.elem);
//表单验证
if (winui.verifyForm(data.elem)) {
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/font-awesome-4.7.0/css/font-awesome.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="width:600px;margin:0 auto;padding-top:20px;">
<form class="layui-form" action="" id="showForm">
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/sysevemenu/'}).use('sysevemenuadd');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/font-awesome-4.7.0/css/font-awesome.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i>刷新数据</button>
<button id="addBean" class="winui-toolbtn"><i class="fa fa-plus" aria-hidden="true"></i>新增菜单</button>
<button id="deleteBeans" class="winui-toolbtn"><i class="fa fa-trash" aria-hidden="true"></i>删除选中</button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/sysevemenu/'}).use('sysevemenulist');
</script>
</body>
</html>
\ No newline at end of file
......@@ -33,7 +33,7 @@
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="winui-btn" lay-submit lay-filter="formEditMenu">保存</button>
<button class="winui-btn" lay-submit lay-filter="formEditUser">保存</button>
<button class="winui-btn" id="cancle">取消</button>
</div>
</div>
......
<style>
/* 提示页 */
.layadmin-tips {
margin-top: 30px;
text-align: center;
}
.layadmin-tips .layui-icon[face] {
display: inline-block;
font-size: 300px;
color: #393D49;
}
.layadmin-tips .layui-text {
width: 500px;
margin: 30px auto;
padding-top: 20px;
border-top: 5px solid #009688;
font-size: 16px;
}
.layadmin-tips h1 {
font-size: 100px;
line-height: 100px;
color: #009688;
}
.layadmin-tips .layui-text .layui-anim {
display: inline-block;
}
</style>
<div class="layui-fluid">
<div class="layadmin-tips">
<i class="layui-icon" face=""></i>
<div class="layui-text">
<h1>
<span class="layui-anim layui-anim-loop layui-anim-">4</span>
<span class="layui-anim layui-anim-loop layui-anim-rotate">0</span>
<span class="layui-anim layui-anim-loop layui-anim-">4</span>
</h1>
</div>
</div>
</div>
\ No newline at end of file
<style>
/* 提示页 */
.layadmin-tips {
margin-top: 30px;
text-align: center;
}
.layadmin-tips .layui-icon[face] {
display: inline-block;
font-size: 300px;
color: #393D49;
}
.layadmin-tips .layui-text {
width: 500px;
margin: 30px auto;
padding-top: 20px;
border-top: 5px solid #009688;
font-size: 16px;
}
.layadmin-tips h1 {
font-size: 100px;
line-height: 100px;
color: #009688;
}
.layadmin-tips .layui-text .layui-anim {
display: inline-block;
}
</style>
<div class="layui-fluid">
<div class="layadmin-tips">
<i class="layui-icon" face=""></i>
<div class="layui-text">
<h1>
<span class="layui-anim layui-anim-loop layui-anim-">5</span>
<span class="layui-anim layui-anim-loop layui-anim">0</span>
<span class="layui-anim layui-anim-loop layui-anim-">0</span>
</h1>
</div>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册