提交 410aaa2d 编写于 作者: Skyeye云's avatar Skyeye云

添加二级菜单展示30%

上级 c1e00acf
...@@ -398,6 +398,52 @@ public class ToolUtil { ...@@ -398,6 +398,52 @@ public class ToolUtil {
return treeNode; return treeNode;
} }
/**
* 使用递归建树
* @param deskTops
* @return
*/
public static List<Map<String, Object>> deskTopsTree(List<Map<String, Object>> deskTops){
List<Map<String, Object>> resultList = new ArrayList<>();
for(Map<String, Object> bean : deskTops){
if ("0".equals(bean.get("parentId").toString())) {
resultList.add(findChildren(bean, deskTops, 0));
}
}
for(Map<String, Object> bean : deskTops){
if(!findChildren(resultList, bean.get("id").toString())){
resultList.add(bean);
}
}
return resultList;
}
/**
* 递归判断id是否在集合中存在
* @param treeNode
* @param id
* @return
*/
@SuppressWarnings("unchecked")
public static boolean findChildren(List<Map<String, Object>> treeNode, String id){
List<Map<String, Object>> child = null;
for(Map<String, Object> bean : treeNode){
if(id.equals(bean.get("id").toString())){
return true;
}else{
child = (List<Map<String, Object>>) bean.get("childs");
if(child != null){
boolean in = findChildren(child, id);
if(in){
return in;
}
}
}
}
return false;
}
/** /**
* 获取ip.properties路径 * 获取ip.properties路径
* @return * @return
......
...@@ -155,6 +155,7 @@ public class SysEveUserServiceImpl implements SysEveUserService{ ...@@ -155,6 +155,7 @@ public class SysEveUserServiceImpl implements SysEveUserService{
List<Map<String, Object>> deskTops = sysEveUserDao.queryDeskTopsMenuByUserId(userMation);//桌面菜单列表 List<Map<String, Object>> deskTops = sysEveUserDao.queryDeskTopsMenuByUserId(userMation);//桌面菜单列表
List<Map<String, Object>> allMenu = sysEveUserDao.queryAllMenuByUserId(userMation); List<Map<String, Object>> allMenu = sysEveUserDao.queryAllMenuByUserId(userMation);
allMenu = ToolUtil.allMenuToTree(allMenu); allMenu = ToolUtil.allMenuToTree(allMenu);
deskTops = ToolUtil.deskTopsTree(deskTops);
jedisClient.set("userMation:" + userMation.get("id").toString(), JSON.toJSONString(userMation)); jedisClient.set("userMation:" + userMation.get("id").toString(), JSON.toJSONString(userMation));
jedisClient.expire("userMation:" + userMation.get("id").toString(), 1800);//时间为30分钟 jedisClient.expire("userMation:" + userMation.get("id").toString(), 1800);//时间为30分钟
jedisClient.set("deskTopsMation:" + userMation.get("id").toString(), JSON.toJSONString(deskTops)); jedisClient.set("deskTopsMation:" + userMation.get("id").toString(), JSON.toJSONString(deskTops));
......
...@@ -128,7 +128,9 @@ ...@@ -128,7 +128,9 @@
c.open_type openType, c.open_type openType,
'-1' maxOpen, '-1' maxOpen,
'false' extend, 'false' extend,
'' childs null childs,
c.menu_parent_id parentId,
c.menu_level menuLevel
FROM FROM
sys_eve_user a, sys_eve_user a,
sys_eve_role_menu b, sys_eve_role_menu b,
......
...@@ -312,12 +312,12 @@ button{ ...@@ -312,12 +312,12 @@ button{
height: 40px; height: 40px;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
z-index: 201704011157; z-index: 9998;
} }
.winui-taskbar > * { .winui-taskbar > * {
display: inline-block; display: inline-block;
} }
/*开始按钮*/ /*开始按钮*/
...@@ -330,20 +330,20 @@ button{ ...@@ -330,20 +330,20 @@ button{
position: absolute; position: absolute;
} }
.winui-taskbar-start:hover { .winui-taskbar-start:hover {
color: #1E91EA; color: #1E91EA;
} }
/*开始按钮选中*/ /*开始按钮选中*/
.winui-taskbar-start.winui-this { .winui-taskbar-start.winui-this {
/*background: #004275;*/ /*background: #004275;*/
} }
.winui-taskbar-start i { .winui-taskbar-start i {
font-size: 18px; font-size: 18px;
} }
/*任务栏任务*/ /*任务栏任务*/
...@@ -2424,6 +2424,28 @@ body .layer-ext-winconfirm { ...@@ -2424,6 +2424,28 @@ body .layer-ext-winconfirm {
cursor: pointer; cursor: pointer;
} }
.icon-drawer {
width: 35px;
height: 35px;
margin: 0px auto;
border: 1px solid rgba(255, 255, 255, 0.5);
overflow: hidden;
padding: 4px;
position: relative;
background-color: rgba(255, 255, 255, 0.19);
}
.icon-drawer-icon{
width: 50%;
height: 50%;
float: left;
margin-top: 2px;
}
.icon-child{
display: none;
}
/*** 小程序页面管理start ***/ /*** 小程序页面管理start ***/
.smpro{ .smpro{
height: calc(100vh - 45px); height: calc(100vh - 45px);
......
...@@ -28,12 +28,47 @@ layui.define(['jquery', 'layer', 'winui'], function (exports) { ...@@ -28,12 +28,47 @@ layui.define(['jquery', 'layer', 'winui'], function (exports) {
//icon的算法存在纰漏,但出现错误几率较小 //icon的算法存在纰漏,但出现错误几率较小
isFaIcon = (item.icon.indexOf('fa-') != -1 && item.icon.indexOf('.') == -1), isFaIcon = (item.icon.indexOf('fa-') != -1 && item.icon.indexOf('.') == -1),
icon = isFaIcon ? '<i class="fa ' + item.icon + ' fa-fw"></i>' : '<img src="' + item.icon + '" />'; icon = isFaIcon ? '<i class="fa ' + item.icon + ' fa-fw"></i>' : '<img src="' + item.icon + '" />';
if(isNull(item.childs)){
html += '<div class="winui-desktop-item" ' + id + ' ' + url + ' ' + title + ' ' + opentype + ' ' + maxOpen + '>'; html += '<div class="winui-desktop-item" ' + id + ' ' + url + ' ' + title + ' ' + opentype + ' ' + maxOpen + '>';
html += '<div class="winui-icon ' + (isFaIcon ? 'winui-icon-font' : 'winui-icon-img') + '">'; html += '<div class="winui-icon ' + (isFaIcon ? 'winui-icon-font' : 'winui-icon-img') + '">';
html += icon; html += icon;
html += '</div>'; html += '</div>';
html += '<p>' + item.name + '</p>'; html += '<p>' + item.name + '</p>';
html += '</div>'; html += '</div>';
}else{
html += '<div class="winui-desktop-item" ' + id + ' ' + url + ' ' + title + ' ' + opentype + ' ' + maxOpen + '>';
html += '<div class="winui-icon ' + (isFaIcon ? 'winui-icon-font' : 'winui-icon-img') + '">';
html += '<div class="icon-drawer">';
var childsIconContent = '';
var childsHtml = '';
$(item.childs).each(function (index, bean) {
var childsid = (bean.id == '' || bean.id == undefined) ? '' : 'win-id="' + bean.id + '"',
childsurl = (bean.pageURL == '' || bean.pageURL == undefined) ? '' : 'win-url="' + bean.pageURL + '"',
childstitle = (bean.title == '' || bean.title == undefined) ? '' : 'win-title="' + bean.title + '"',
childsopentype = (bean.openType == '' || bean.openType == undefined) ? '' : 'win-opentype="' + bean.openType + '"',
childsmaxOpen = (bean.maxOpen == '' || bean.maxOpen == undefined) ? '' : 'win-maxOpen="' + bean.maxOpen + '"',
//icon的算法存在纰漏,但出现错误几率较小
childsisFaIcon = (bean.icon.indexOf('fa-') != -1 && bean.icon.indexOf('.') == -1),
childsicon = childsisFaIcon ? '<i class="fa ' + bean.icon + ' fa-fw"></i>' : '<img src="' + bean.icon + '" />',
childsiconsmall = childsisFaIcon ? '<i class="fa ' + bean.icon + ' fa-fw icon-drawer-icon"></i>' : '<img src="' + bean.icon + '" />';
childsIconContent += childsiconsmall;
childsHtml += '<div class="winui-desktop-item" ' + childsid + ' ' + childsurl + ' ' + childstitle + ' ' + childsopentype + ' ' + childsmaxOpen + '>';
childsHtml += '<div class="winui-icon ' + (childsisFaIcon ? 'winui-icon-font' : 'winui-icon-img') + '">';
childsHtml += childsicon;
childsHtml += '</div>';
childsHtml += '<p>' + bean.name + '</p>';
childsHtml += '</div>';
});
html += childsIconContent;
html += '</div>';
html += '<div class="icon-child">';
html += childsHtml;
html += '</div>';
html += '</div>';
html += '<p>' + item.name + '</p>';
html += '</div>';
}
}); });
$('.winui-desktop').html(html); $('.winui-desktop').html(html);
//定位应用 //定位应用
......
...@@ -45,6 +45,19 @@ layui.define(['layer', 'winui'], function (exports) { ...@@ -45,6 +45,19 @@ layui.define(['layer', 'winui'], function (exports) {
if (!winui.taskAuto()) { if (!winui.taskAuto()) {
return; return;
} }
if(isNull(options.shadeClose)){
options.shadeClose = false;
}
if(isNull(options.skin)){
options.skin = 'winui-window';
}
if(isNull(options.closeBtn) && options.closeBtn != 0){
options.closeBtn = '1';
}
if(isNull(options.maxmin) && options.maxmin != false){
options.maxmin = true;
}
//打开窗口 //打开窗口
var windowIndex = layer.open({ var windowIndex = layer.open({
id: options.id || winui.guid(), id: options.id || winui.guid(),
...@@ -56,10 +69,13 @@ layui.define(['layer', 'winui'], function (exports) { ...@@ -56,10 +69,13 @@ layui.define(['layer', 'winui'], function (exports) {
anim: options.anim || this.settings.anim, anim: options.anim || this.settings.anim,
move: MOVE, move: MOVE,
shade: options.shade || 0, shade: options.shade || 0,
maxmin: true, //允许最大最小化 maxmin: options.maxmin, //允许最大最小化
moveOut: true, //允许拖出窗外 moveOut: true, //允许拖出窗外
skin: 'winui-window', //窗口皮肤 skin: options.skin, //窗口皮肤
zIndex: layer.zIndex, zIndex: layer.zIndex,
shadeClose: options.shadeClose, //点击空白处关闭
scrollbar: false,
closeBtn: options.closeBtn,
//销毁回调 //销毁回调
end: options.end || function () { end: options.end || function () {
...@@ -127,9 +143,9 @@ layui.define(['layer', 'winui'], function (exports) { ...@@ -127,9 +143,9 @@ layui.define(['layer', 'winui'], function (exports) {
common.setWindowBody(window); common.setWindowBody(window);
} }
}); });
//重新获取window
var windowDom = common.getWindow(options.id); var windowDom = common.getWindow(options.id);
if(!isNull(windowDom)){
//重新获取window
if (((options.type || this.settings.type) == 2) && (options.refresh === undefined ? this.settings.refresh : options.refresh)) { if (((options.type || this.settings.type) == 2) && (options.refresh === undefined ? this.settings.refresh : options.refresh)) {
$(windowDom).find('.layui-layer-setwin').prepend('<a class="layui-layer-ico layui-layer-refresh"><i class="layui-icon" style="font-size:14px;left:17px;font-weight:600;">&#x1002;<i></a>'); $(windowDom).find('.layui-layer-setwin').prepend('<a class="layui-layer-ico layui-layer-refresh"><i class="layui-icon" style="font-size:14px;left:17px;font-weight:600;">&#x1002;<i></a>');
$(windowDom).find('.layui-layer-refresh').on('click', function (e) { $(windowDom).find('.layui-layer-refresh').on('click', function (e) {
...@@ -212,6 +228,8 @@ layui.define(['layer', 'winui'], function (exports) { ...@@ -212,6 +228,8 @@ layui.define(['layer', 'winui'], function (exports) {
var taskItem = common.getTaskItemByWindowDom(this); var taskItem = common.getTaskItemByWindowDom(this);
common.selectDom(taskItem); common.selectDom(taskItem);
}); });
}
//隐藏开始菜单 //隐藏开始菜单
$('.winui-start').addClass('layui-hide'); $('.winui-start').addClass('layui-hide');
//移除开始按钮的选中样式 //移除开始按钮的选中样式
......
...@@ -57,7 +57,12 @@ ...@@ -57,7 +57,12 @@
}, //可以为{} 默认 请求 json/desktopmenu.json }, //可以为{} 默认 请求 json/desktopmenu.json
done: function (desktopApp) { done: function (desktopApp) {
desktopApp.ondblclick(function (id, elem) { desktopApp.ondblclick(function (id, elem) {
var item = $(elem);
if(item.find(".icon-drawer").length > 0){
showBigWin(elem);
}else{
OpenWindow(elem); OpenWindow(elem);
}
}); });
desktopApp.contextmenu({ desktopApp.contextmenu({
item: ["打开", "删除", '右键菜单可自定义'], item: ["打开", "删除", '右键菜单可自定义'],
...@@ -187,13 +192,13 @@ ...@@ -187,13 +192,13 @@
id: id, id: id,
type: type, type: type,
title: title, title: title,
content: content content: content,
//,area: ['70vw','80vh'] //,area: ['70vw','80vh']
//,offset: ['10vh', '15vw'] //,offset: ['10vh', '15vw']
, maxOpen: maxOpen maxOpen: maxOpen,
//, max: false //, max: false
//, min: false //, min: false
, refresh:true refresh:true
}); });
}else{ }else{
location.href = "login.html"; location.href = "login.html";
...@@ -201,6 +206,27 @@ ...@@ -201,6 +206,27 @@
}}); }});
} }
function showBigWin(menuItem){
var menu = $(menuItem);
winui.window.config({
anim: 0,
miniAnim: 0,
maxOpen: -1
}).open({
id: '1',
type: 1,
title: false,
closeBtn: 0,
content: '1111',
area: ['30vw', '40vh'],
shadeClose: true,
skin: 'demo-class',
scrollbar: false,
shade: 0.5,
maxmin: false
});
}
//注销登录 //注销登录
$('.logout').on('click', function () { $('.logout').on('click', function () {
winui.hideStartMenu(); winui.hideStartMenu();
......
...@@ -17,7 +17,9 @@ getProperties(); 读取.properties 结尾的配置文件用,getP, getPara ...@@ -17,7 +17,9 @@ getProperties(); 读取.properties 结尾的配置文件用,getP, getPara
getSurFaceId(); 获取ID getSurFaceId(); 获取ID
MD5(); 加密 MD5(); 加密
allMenuToTree(); 使用递归方法建树 allMenuToTree(); 使用递归方法建树
findChildren(); 递归查找子节点 findChildren(Map<String, Object> treeNode, List<Map<String, Object>> treeNodes, int level); 递归查找子节点
deskTopsTree(); 使用递归建树
findChildren(List<Map<String, Object>> treeNode, String id); 递归判断id是否在集合中存在
getIPPropertiesPath(); 获取ip.properties路径 getIPPropertiesPath(); 获取ip.properties路径
deleteFile(); 删除单个文件 deleteFile(); 删除单个文件
card(); 随机不重复的6-8位 card(); 随机不重复的6-8位
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册