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

菜单和icon关联

上级 7cf05919
......@@ -21,4 +21,6 @@ public interface SysEveIconDao {
public int editSysIconMationById(Map<String, Object> map) throws Exception;
public List<Map<String, Object>> querySysIconListToMenu(Map<String, Object> map, PageBounds pageBounds) throws Exception;
}
......@@ -15,5 +15,7 @@ public interface SysEveIconService {
public void editSysIconMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void querySysIconListToMenu(InputObject inputObject, OutputObject outputObject) throws Exception;
}
......@@ -120,6 +120,27 @@ public class SysEveIconServiceImpl implements SysEveIconService{
outputObject.setreturnMessage("该ICON属性已存在,不可进行二次保存");
}
}
/**
*
* @Title: querySysIconListToMenu
* @Description: 获取ICON列表供menu菜单使用
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public void querySysIconListToMenu(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
List<Map<String, Object>> beans = sysEveIconDao.querySysIconListToMenu(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);
}
......
......@@ -95,4 +95,20 @@ public class SysEveIconController {
sysEveIconService.editSysIconMationById(inputObject, outputObject);
}
/**
*
* @Title: querySysIconListToMenu
* @Description: 获取ICON列表供menu菜单使用
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/SysEveIconController/querySysIconListToMenu")
@ResponseBody
public void querySysIconListToMenu(InputObject inputObject, OutputObject outputObject) throws Exception{
sysEveIconService.querySysIconListToMenu(inputObject, outputObject);
}
}
......@@ -70,4 +70,12 @@
WHERE id = #{id}
</update>
<select id="querySysIconListToMenu" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id,
a.icon_class iconClass
FROM
sys_eve_icon a
</select>
</mapper>
\ No newline at end of file
......@@ -126,6 +126,10 @@
<property id="rowId" name="id" ref="required" var="icon属性id"/>
<property id="iconClass" name="iconClass" ref="required" var="icon属性"/>
</url>
<url id="icon006" path="/post/SysEveIconController/querySysIconListToMenu" val="获取ICON列表供menu菜单使用" allUse="1">
<property id="limit" name="limit" ref="required" var="分页参数,每页多少条数据" />
<property id="page" name="page" ref="required" var="分页参数,第几页"/>
</url>
<url id="database001" path="/post/SysDataBaseController/querySysDataBaseList" val="获取数据库信息" allUse="1">
<property id="limit" name="limit" ref="required" var="分页参数,每页多少条数据" />
......
......@@ -29,6 +29,12 @@ function _openNewWindows(mation){
s += "&" + param + "=" + mation.params[param];
mation.url = mation.url + "?" + s.slice(1);
}
if(isNull(mation.area)){
mation.area = [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'];
}
if(isNull(mation.offset)){
mation.offset = ['15vh', '20vw'];
}
var index = layer.load(1);
refreshCode = "";
layui.$.ajax({
......@@ -44,8 +50,8 @@ function _openNewWindows(mation){
type: 2,
title: mation.title,
content: mation.url,
area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'],
offset: ['15vh', '20vw'],
area: mation.area,
offset: mation.offset,
end: function(){
if(typeof(mation.callBack) == "function") {
mation.callBack(refreshCode);
......
......@@ -46,7 +46,7 @@ var getFileContent = function(url){
//判断内容是否为空
function isNull(str){
if(str == null || str == "" || str == '' || str == "null"){
if(str == null || str == "" || str == '' || str == "null" || str == "undefined"){
return true;
}else{
return false;
......
......@@ -2010,6 +2010,7 @@ body .layer-ext-winconfirm {
.item{
padding-top: 10px;
height: 140px;
}
.icon-item{
......@@ -2022,6 +2023,13 @@ body .layer-ext-winconfirm {
font-size: 50px;
}
.icon-class{
height: 30px;
}
.icon-item>span{
}
.icon-item>div{
text-align: center;
margin-top: 10px;
......
layui.config({
base: basePath,
version: skyeyeVersion
}).define(['table', 'jquery', 'winui', 'form'], function (exports) {
var index = parent.layer.getFrameIndex(window.name);
winui.renderColor();
var $ = layui.$;
//初始化数据
showGrid({
id: "showForm",
url: reqBasePath + "icon006",
params: {},
pagination: true,
pagesize: 18,
template: getFileContent('tpl/sysevemenu/icon-item.tpl'),
ajaxSendLoadBefore: function(hdb){
},
options: {'click .choose':function(i, row){
parent.childIcon = row.iconClass;
parent.layer.close(index);
parent.refreshCode = '0';
}
},
ajaxSendAfter:function(json){
}
});
$("body").on("click", "#reloadTable", function(){
});
exports('icon', {});
});
var childIcon = "";
layui.config({
base: basePath,
version: skyeyeVersion
......@@ -112,7 +115,7 @@ layui.config({
}});
}
//获取菜单级别
//获取菜单级别
function getMenuLevelName(level){
if(level == '0'){
return "创世菜单";
......@@ -121,6 +124,22 @@ layui.config({
}
}
//菜单图标选中事件
$("body").on("focus", "#menuIcon", function(e){
_openNewWindows({
url: "../../tpl/sysevemenu/icon.html",
title: "选择ICON图标",
pageId: "icon",
area: ['640px', '360px'],
callBack: function(refreshCode){
if (refreshCode == '0') {
$("#menuIcon").val(childIcon);
} else if (refreshCode == '-9999') {
top.winui.window.msg("操作失败", {icon: 2,time: 2000});
}
}});
});
//初始化加载隐藏创世菜单
$("#parentIdBox").addClass("layui-hide");
......
var childIcon = "";
layui.config({
base: basePath,
version: skyeyeVersion
......@@ -195,6 +198,22 @@ layui.config({
}});
}
//菜单图标选中事件
$("body").on("focus", "#menuIcon", function(e){
_openNewWindows({
url: "../../tpl/sysevemenu/icon.html",
title: "选择ICON图标",
pageId: "icon",
area: ['640px', '360px'],
callBack: function(refreshCode){
if (refreshCode == '0') {
$("#menuIcon").val(childIcon);
} else if (refreshCode == '-9999') {
top.winui.window.msg("操作失败", {icon: 2,time: 2000});
}
}});
});
//获取菜单级别
function getMenuLevelName(level){
if(level == '0'){
......
......@@ -74,6 +74,9 @@ layui.config({
{ title: '序号', type: 'numbers'},
{ field: 'menuName', title: '菜单名称', width: 120 },
{ field: 'menuIcon', title: '图标码', width: 120 },
{ field: 'menuIcon', title: '图标', width: 120, templet: function(d){
return '<i class="fa fa-fw ' + d.menuIcon + '"></i>';
}},
{ field: 'titleName', title: '标题名称', width: 120 },
{ field: 'menuLevel', title: '菜单级别', width: 180, templet: function(d){
if(d.parentId == '0'){
......
......@@ -4,7 +4,7 @@
<div class="layui-col-xs12 icon-item">
<i class="fa {{iconClass}} fa-fw"></i>
</div>
<div class="layui-col-xs12 icon-item">
<div class="layui-col-xs12 icon-item icon-class">
<span>{{iconClass}}</span>
</div>
<div class="layui-col-xs12 icon-item">
......
{{#each rows}}
<div class="layui-col-xs2 item">
<div class="layui-col-xs12 icon-item">
<i class="fa {{iconClass}} fa-fw"></i>
</div>
<div class="layui-col-xs12 icon-item icon-class">
<span>{{iconClass}}</span>
</div>
<div class="layui-col-xs12 icon-item">
<div>
<a class="layui-btn layui-btn-xs choose">选择</a>
</div>
</div>
</div>
{{/each}}
\ 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 style="width:600px;margin:0 auto;padding-top:20px;">
<div class="layui-col-xs12" id="showForm">
</div>
</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('icon');
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册