diff --git a/admin/css/admin.css b/admin/css/admin.css index ae7b031..2980f3c 100644 --- a/admin/css/admin.css +++ b/admin/css/admin.css @@ -341,7 +341,7 @@ left: 50%; width: 1px; height: 0; - border: 1px solid #F2F2F2; + border: 2px solid #F2F2F2; transition: all .3s; -webkit-transition: all .3s; opacity: 0; diff --git a/component/pear/modules/admin.js b/component/pear/modules/admin.js index 0e6dc2b..f0aa63e 100644 --- a/component/pear/modules/admin.js +++ b/component/pear/modules/admin.js @@ -18,11 +18,17 @@ layui.define(['table', 'jquery', 'element', 'yaml','form', 'tab', 'menu', 'frame const pearAdmin = new function() { - let configPath = ''; + // 默认配置 + let configType = 'yml'; + let configPath = 'pear.config.yml'; this.setConfigPath = function(path) { configPath = path; } + + this.setConfigType = function(type) { + configType = type; + } this.render = function(initConfig) { if (initConfig !== undefined) { @@ -33,8 +39,23 @@ layui.define(['table', 'jquery', 'element', 'yaml','form', 'tab', 'menu', 'frame } this.readConfig = function() { - const configUrl = configPath === '' ? "pear.config.yml" : configPath; - return yaml.load(configUrl); + if(configType === "yml"){ + return yaml.load(configPath); + } + else + { + let data; + $.ajax({ + url:configPath, + type:'get', + dataType:'json', + async: false, + success:function(result){ + data = result; + } + }) + return data; + } } this.logoRender = function(param) { @@ -205,7 +226,7 @@ layui.define(['table', 'jquery', 'element', 'yaml','form', 'tab', 'menu', 'frame // 自 定 义 样 式 选 择 边 框 配 色 style += '.pearone-color .color-content li.layui-this:after, .pearone-color .color-content li:hover:after {border: ' + - color + ' 2px solid!important;}'; + color + ' 3px solid!important;}'; style += '.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{background-color:' + color + '!important}'; diff --git a/component/pear/pear.all.js b/component/pear/pear.all.js index 2e06fd0..d6944a6 100644 --- a/component/pear/pear.all.js +++ b/component/pear/pear.all.js @@ -7,11 +7,11 @@ window.rootPath = (function(src) { })(); /** - * 扩展包集成 + * 核心依赖 * */ layui.config({ base: rootPath + "modules/", - version: true + version: "3.3.9.Release" }).extend({ admin: "admin", // 框架布局组件 menu: "menu", // 数据菜单组件 @@ -43,4 +43,4 @@ layui.config({ yaml:"yaml", // yaml 解析组件 context: "context", // 上下文组件 http: "http" // ajax请求组件 -}); +}); \ No newline at end of file diff --git a/component/pear/pear.js b/component/pear/pear.js index 2e06fd0..209094a 100644 --- a/component/pear/pear.js +++ b/component/pear/pear.js @@ -7,11 +7,11 @@ window.rootPath = (function(src) { })(); /** - * 扩展包集成 + * 核心依赖 * */ layui.config({ base: rootPath + "modules/", - version: true + version: "3.3.9.Release" }).extend({ admin: "admin", // 框架布局组件 menu: "menu", // 数据菜单组件 diff --git a/config/pear.config.json b/config/pear.config.json new file mode 100644 index 0000000..f802cc6 --- /dev/null +++ b/config/pear.config.json @@ -0,0 +1,65 @@ +{ + "logo": { + "title": "Pear Admin", + "image": "admin/images/logo.png" + }, + "menu": { + "data": "admin/data/menu.json", + "accordion": true, + "control": false, + "select": "0" + }, + "tab": { + "muiltTab": true, + "keepState": true, + "tabMax": 30, + "index": { + "id": "0", + "href": "view/console/console1.html", + "title": "首页" + } + }, + "theme": { + "defaultColor": "2", + "defaultMenu": "dark-theme", + "allowCustom": true + }, + "colors": [{ + "id": "1", + "color": "#FF5722" + }, + { + "id": "2", + "color": "#5FB878" + }, + { + "id": "3", + "color": "#1E9FFF" + }, { + "id": "4", + "color": "#FFB800" + }, { + "id": "5", + "color": "darkgray" + } + ], + "links": [{ + "icon": "layui-icon layui-icon-auz", + "title": "官方网站", + "href": "http://www.pearadmin.com" + }, + { + "icon": "layui-icon layui-icon-auz", + "title": "开发文档", + "href": "http://www.pearadmin.com" + }, + { + "icon": "layui-icon layui-icon-auz", + "title": "开源地址", + "href": "https://gitee.com/Jmysy/Pear-Admin-Layui" + } + ], + "other": { + "keepLoad": 1200 + } +} diff --git a/index.html b/index.html index e9fe477..c7d8aac 100644 --- a/index.html +++ b/index.html @@ -90,6 +90,8 @@ } // 框架初始化时会读取 根目录下 pear.config.yml 文件作为初始化配置 // 你可以通过 admin.setConfigPath 方法修改配置文件位置 + // 你可以通过 admin.setConfigType 方法修改配置文件类型 + admin.setConfigType("yml"); admin.setConfigPath("config/pear.config.yml"); admin.render(); })