From c8f5077390ae10a8b78bafff192c80b533e5c180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Wed, 14 Apr 2021 14:53:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8F=9C=E5=8D=95=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=AB=98=E5=BA=A6=E9=99=90=E5=88=B6=EF=BC=8C=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=B8=BB=E9=A2=98=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/pear/css/module/menu.css | 8 ++++++++ component/pear/module/admin.js | 17 ++++++++--------- component/pear/module/menu.js | 11 ++++++----- config/pear.config.yml | 2 +- view/document/menu.html | 4 ++-- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/component/pear/css/module/menu.css b/component/pear/css/module/menu.css index 06ad2f3..38e9ea3 100644 --- a/component/pear/css/module/menu.css +++ b/component/pear/css/module/menu.css @@ -14,6 +14,14 @@ line-height: 48px; } +.pear-side-scroll::-webkit-scrollbar { + width: 0px; + height: 0px; +} +.pear-side-scroll{ + width: 230px; +} + .pear-nav-tree .layui-nav-child { padding-top: 5px; padding-bottom: 5px; diff --git a/component/pear/module/admin.js b/component/pear/module/admin.js index fa82897..f24d938 100644 --- a/component/pear/module/admin.js +++ b/component/pear/module/admin.js @@ -206,7 +206,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm localStorage.setItem("theme-color-context", currentColor.color); pearTheme.changeTheme(window, option.other.autoHead); var menu = localStorage.getItem("theme-menu"); - if (menu === "null") { + if (menu == null) { menu = option.theme.defaultMenu; } else { if (option.theme.allowCustom === false) { @@ -239,13 +239,12 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm this.jump = function(id, title, url) { if (config.tab.muiltTab) { bodyTab.addTabOnly({ - id: id, - title: title, - url: url, - icon: null, - close: true - }, - 300); + id: id, + title: title, + url: url, + icon: null, + close: true + }, 300); } else { sideMenu.selectItem(id); bodyFrame.changePage(url, title, true); @@ -366,7 +365,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm move: false, content: html + buildColorHtml() + buildLinkHtml() + bottomTool(), success: function(layero, index) { - + var color = localStorage.getItem("theme-color"); var menu = localStorage.getItem("theme-menu"); diff --git a/component/pear/module/menu.js b/component/pear/module/menu.js index d652179..2b8ac30 100644 --- a/component/pear/module/menu.js +++ b/component/pear/module/menu.js @@ -42,10 +42,11 @@ layui.define(['table', 'jquery', 'element'], function(exports) { } } else { //renderMenu中需要调用done事件,done事件中需要menu对象,但是此时还未返回menu对象,做个延时提前返回对象 - window.setTimeout(function() { - renderMenu(option); - }, 500); + window.setTimeout(function() { renderMenu(option);}, 500); } + + // 处理高度 + $("#"+opt.elem).height(option.height) return new pearMenu(opt); } @@ -194,7 +195,7 @@ layui.define(['table', 'jquery', 'element'], function(exports) { } function createMenu(option) { - var menuHtml = '"; // 将 菜 单 拼 接 到 初 始 化 容 器 中 $("#" + option.elem).html(menuHtml); } diff --git a/config/pear.config.yml b/config/pear.config.yml index 42c08c4..a05d008 100644 --- a/config/pear.config.yml +++ b/config/pear.config.yml @@ -39,7 +39,7 @@ theme: ## 默认主题色,对应 colors 配置中的 ID 标识 defaultColor: "2" ## 默认的菜单主题 dark-theme 黑 / light-theme 白 - defaultMenu: "dark-theme" + defaultMenu: "light-theme" ## 是否允许用户切换主题,false 时关闭自定义主题面板 allowCustom: true ## 供选择的主题色配置列表 diff --git a/view/document/menu.html b/view/document/menu.html index 3337979..3d26e7a 100644 --- a/view/document/menu.html +++ b/view/document/menu.html @@ -52,7 +52,7 @@ var sideMenu = menu.render({ elem: 'sideMenu', async: true, - theme: "dark-theme", + theme: "light-theme", height: '300px', control: false, defaultMenu: 0, @@ -91,7 +91,7 @@ var sideMenu = menu.render({ elem: 'sideMenu', async: true, - theme: "dark-theme", + theme: "light-theme", height: '300px', control: false, defaultMenu: 0,