回退代码

develop
就眠仪式 2020-12-18 00:24:44 +08:00
parent 2702389967
commit 1a37e5aab5
4 changed files with 33 additions and 57 deletions

View File

@ -17,23 +17,13 @@
border-bottom: 1px solid whitesmoke;
}
/**适应移动端小型设备调整begin*/
.pear-admin .layui-header .layui-nav {
padding: 0px;
}
.pear-admin .layui-header .layui-nav .layui-nav-item a {
padding: 0 10px;
}
/*end*/
.pear-admin .layui-header .layui-nav-img {
width: 30px;
height: 30px;
}
.pear-admin .layui-layout-control {
left: 80px;
left: 120px;
position: absolute;
}
@ -170,7 +160,6 @@
.collaspe {
display: none !important;
}
.pear-collasped-pe {
display: inline-block !important;
}

View File

@ -290,7 +290,7 @@ layui.define(['table', 'jquery', 'element', 'yaml','form', 'tab', 'menu', 'frame
layer.open({
type: 1,
offset: 'r',
area: screen() < 2 ? ['93%', '100%'] : ['340px', '100%'],
area: ['340px', '100%'],
title: false,
shade: 0.1,
closeBtn: 0,
@ -431,19 +431,5 @@ layui.define(['table', 'jquery', 'element', 'yaml','form', 'tab', 'menu', 'frame
});
}
//获取当前窗口的宽度
function screen() {
var width = $(window).width();
if (width > 1200) {
return 3; //大屏幕
} else if (width > 992) {
return 2; //中屏幕
} else if (width > 768) {
return 1; //小屏幕
} else {
return 0; //超小屏幕
}
}
exports('admin', pearAdmin);
})

View File

@ -358,41 +358,42 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
/** 二 级 悬 浮 菜 单*/
function isHoverMenu(b, option) {
if (b) {
$("#" + option.elem + ".pear-nav-mini .layui-nav-item,#" + option.elem + ".pear-nav-mini dd").hover(function() {
$(this).children(".layui-nav-child").addClass("layui-nav-hover");
var top = $(this).offset().top + 5;
var y = window.document.body.clientHeight;
$("#" + option.elem + ".pear-nav-mini .layui-nav-item,#" + option.elem + ".pear-nav-mini dd").hover(function(e) {
e.stopPropagation();
var _this = $(this);
_this.siblings().find(".layui-nav-child")
.removeClass("layui-nav-hover").css({
left: 0,
top: 0
});
_this.children(".layui-nav-child").addClass("layui-nav-hover");
_this.closest('.layui-nav-item').data('time') && clearTimeout(_this.closest('.layui-nav-item').data('time'));
var height = $(window).height();
var topLength = $(this).offset().top;
var thisHeight = $(this).children(".layui-nav-child").height();
var topLength = _this.offset().top;
var thisHeight = _this.children(".layui-nav-child").height();
if ((thisHeight + topLength) > height) {
topLength = height - thisHeight - 10;
}
if (!$(this).is(".layui-nav-item")) {
var left = $(this).offset().left + $(this).width() + 3;
$(this).children(".layui-nav-child").offset({
left: left
});
} else {
var left = $(this).offset().left + 63;
$(this).children(".layui-nav-child").offset({
left: left
});
var left = _this.offset().left + 60;
if (!_this.hasClass("layui-nav-item")) {
left = _this.offset().left + _this.width();
}
$(this).children(".layui-nav-child").offset({
top: topLength
_this.children(".layui-nav-child").offset({
top: topLength,
left: left + 3
});
}, function() {
var that = $(this);
setTimeout(function() {
that.children(".layui-nav-child").removeClass("layui-nav-hover");
that.children(".layui-nav-child").css({
left: '0px'
});
that.children(".layui-nav-child").css({
top: '0px'
});
}, 10);
}, function(e) {
e.stopPropagation();
var _this = $(this);
_this.closest('.layui-nav-item').data('time', setTimeout(function() {
_this.closest('.layui-nav-item')
.find(".layui-nav-child")
.removeClass("layui-nav-hover")
.css({
left: 0,
top: 0
});
}, 50));
})
} else {
$("#" + option.elem + " .layui-nav-item").off('mouseenter').unbind('mouseleave');

View File

@ -12,7 +12,7 @@ menu:
## 是否同时只打开一个菜单目录
accordion: true
## 是否开启多系统菜单模式
control: false
control: true
## 默认选中的菜单项
select: "10"
## 是否开启异步菜单false 时 data 属性设置为菜单数据false 时为 json 文件或后端接口