回退代码

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; 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 { .pear-admin .layui-header .layui-nav-img {
width: 30px; width: 30px;
height: 30px; height: 30px;
} }
.pear-admin .layui-layout-control { .pear-admin .layui-layout-control {
left: 80px; left: 120px;
position: absolute; position: absolute;
} }
@ -170,7 +160,6 @@
.collaspe { .collaspe {
display: none !important; display: none !important;
} }
.pear-collasped-pe { .pear-collasped-pe {
display: inline-block !important; display: inline-block !important;
} }

View File

@ -290,7 +290,7 @@ layui.define(['table', 'jquery', 'element', 'yaml','form', 'tab', 'menu', 'frame
layer.open({ layer.open({
type: 1, type: 1,
offset: 'r', offset: 'r',
area: screen() < 2 ? ['93%', '100%'] : ['340px', '100%'], area: ['340px', '100%'],
title: false, title: false,
shade: 0.1, shade: 0.1,
closeBtn: 0, 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); exports('admin', pearAdmin);
}) })

View File

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

View File

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