diff --git a/admin/css/admin.css b/admin/css/admin.css index 60703fed157680f6fb3bfe9240eb26dde29da5be..5e13a5a7d12e78b1995f7787d6173c8d1355206c 100644 --- a/admin/css/admin.css +++ b/admin/css/admin.css @@ -172,6 +172,15 @@ body, display: none; } +@media screen and (max-width: 768px) { + .pear-admin.banner-layout .layui-header .layui-logo { + display: none; + } + .pear-admin.banner-layout .layui-header .layui-layout-left { + left: 0px; + } +} + /** 收缩布局 */ .pear-mini .layui-side .layui-logo .title { display: none; @@ -465,7 +474,13 @@ body, -webkit-transition: all .3s; opacity: 0; } - +@media screen and (max-width: 450px) { + .pearone-color .layui-form-item .layui-input-inline { + float: left !important; + width: 190px !important; + margin: 0 10px 0 0!important; + } +} .select-color { margin-bottom: 30px; } diff --git a/component/pear/module/menu.js b/component/pear/module/menu.js index 33cde7f4a024eb328d44ee98c8a633b33b786b27..44f6432a73ec3961b56b495b86404e1a418e222c 100644 --- a/component/pear/module/menu.js +++ b/component/pear/module/menu.js @@ -88,6 +88,7 @@ layui.define(['table', 'jquery', 'element'], function (exports) { pearMenu.prototype.click = function (clickEvent) { var _this = this; + //左侧子菜单点击事件 $("body").on("click", "#" + _this.option.elem + " .site-demo-active", function () { var dom = $(this); var data = { @@ -129,6 +130,33 @@ layui.define(['table', 'jquery', 'element'], function (exports) { } clickEvent(dom, data); }) + //顶部菜单点击事件 + $("body").on("click","#" + _this.option.control + " .pear-nav-control [pear-id]", function () { + var dom = $(this); + var href = $(this).attr("pear-href"); + if (href == "javascript:;") { + $("#" + _this.option.elem).find(".pear-nav-tree").css({ + display: 'none' + }); + $("#" + _this.option.elem).find(".pear-nav-tree[pear-id='" + $(this).attr("pear-id") + "']").css({ + display: 'block' + }); + $("#" + _this.option.control).find(".pe-title").html($(this).attr("pear-title")); + $("#" + _this.option.control).find("") + _this.option.change($(this).attr("pear-id"), $(this).attr("pear-title"), $(this).attr("pear-href")) + }else if(href){ + var data = { + menuId: dom.attr("pear-id"), + menuTitle: dom.attr("pear-title"), + menuPath: dom.attr("pear-title"), + menuIcon: dom.attr("pear-icon"), + menuUrl: dom.attr("pear-href"), + openType: dom.attr("pear-type") + }; + clickEvent(dom, data); + + } + }) } function hash(dom) { @@ -157,9 +185,13 @@ layui.define(['table', 'jquery', 'element'], function (exports) { display: "block" }); var controlId = $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents("ul").attr("pear-id"); + + $("#" + this.option.control).find(".layui-this").removeClass("layui-this"); if (controlId != undefined) { - $("#" + this.option.control).find(".layui-this").removeClass("layui-this"); $("#" + this.option.control).find("[pear-id='" + controlId + "']").addClass("layui-this"); + }else{ + //顶级菜单获取焦点 + $("#" + this.option.control).find("[pear-id='" + pearId + "']").addClass("layui-this"); } } @@ -330,11 +362,21 @@ layui.define(['table', 'jquery', 'element'], function (exports) { var index = 0; var controlItemPe = '