diff --git a/admin/css/admin.css b/admin/css/admin.css index 1f04120..5279943 100644 --- a/admin/css/admin.css +++ b/admin/css/admin.css @@ -10,8 +10,8 @@ } .pear-admin .layui-header { - left: 220px; - width: calc(100% - 220px); + left: 230px; + width: calc(100% - 230px); background-color: white; border-bottom: 1px solid whitesmoke; } @@ -27,8 +27,9 @@ } .pear-admin .layui-logo { - width: 220px; + width: 230px; height: 60px; + line-height: 60px; position: relative; background-color: #28333E; @@ -54,7 +55,7 @@ .pear-admin .layui-side { top: 0px; - width: 220px; + width: 230px; box-shadow: 2px 0 6px rgba(0, 21, 41, .35); z-index: 9999; } @@ -65,8 +66,9 @@ } .pear-admin .layui-side-scroll { - height: calc(100% - 60px); + height: calc(100% - 60px)!important; background-color: #28333E; + width: 230px; } @@ -76,7 +78,7 @@ } .pear-admin .layui-body { - left: 220px; + left: 230px; bottom: 0px; } diff --git a/admin/data/menu.json b/admin/data/menu.json index 6f27078..eb03f77 100644 --- a/admin/data/menu.json +++ b/admin/data/menu.json @@ -10,7 +10,7 @@ "icon": "layui-icon layui-icon-console", "type": 1, "openType": "_iframe", - "href": "view/console/console1.html" + "href": "view/console/console.html" }, { "id": 13, "title": "数据分析", @@ -36,6 +36,14 @@ }, { "id": 202, + "title": "表单", + "icon": "layui-icon layui-icon-face-cry", + "type": 1, + "openType": "_iframe", + "href": "view/document/form.html" + }, + { + "id": 203, "title": "多选下拉", "icon": "layui-icon layui-icon-face-cry", "type": 1, @@ -43,7 +51,7 @@ "href": "view/document/select.html" }, { - "id": 203, + "id": 204, "title": "抽屉组件", "icon": "layui-icon layui-icon-face-cry", "type": 1, @@ -52,6 +60,40 @@ } ] }, + { + "id": "chart", + "title": "统计图表", + "icon": "layui-icon layui-icon-auz", + "type": 0, + "href": "", + "children": [{ + "id": 501, + "title": "折线图", + "icon": "layui-icon layui-icon-face-smile", + "type": 1, + "openType": "_iframe", + "href": "view/chart/line.html" + }, + { + "id": 404, + "title": "404", + "icon": "layui-icon layui-icon-face-cry", + "type": 1, + "openType": "_iframe", + "href": "view/error/404.html" + }, + + { + "id": 500, + "title": "500", + "icon": "layui-icon layui-icon-face-cry", + "type": 1, + "openType": "_iframe", + "href": "view/error/500.html" + } + + ] + }, { "id": "error", "title": "错误页面", diff --git a/assets/console.css b/assets/console.css new file mode 100644 index 0000000..ee5f974 --- /dev/null +++ b/assets/console.css @@ -0,0 +1,100 @@ +.top-panel { + border-radius: 4px; + text-align: center; +} + +.top-panel>.layui-card-body { + height: 60px; +} + +.top-panel-number { + line-height: 60px; + font-size: 30px; + border-right: 1px solid #eceff9; +} + +.top-panel-tips { + padding-left: 8px; + padding-top: 16px; + line-height: 30px; + font-size: 12px; +} + +.pear-container { + background-color: whitesmoke; + margin: 10px; +} + +.card { + width: 100%; + height: 160px; + background-color: whitesmoke; + border-radius: 4px; +} + +.card .header .avatar { + width: 28px; + height: 28px; + margin: 20px; + border-radius: 50px; +} + +.card .header { + color: dimgray; +} + +.card .body { + color: gray; +} + +.card .body { + margin-left: 20px; + margin-right: 20px; +} + +.card .footer { + margin-left: 20px; + margin-right: 20px; + margin-top: 20px; + font-size: 13px; + color: gray; + position: absolute; +} + +.list .list-item { + height: 32px; + line-height: 32px; + color: gray; + padding: 5px; + padding-left: 15px; + border-radius: 4px; + margin-top: 5.2px; +} + +.custom-tab .layui-tab-title { + border-bottom-width: 0px; + border-bottom-style: none; +} + +.custom-tab .layui-tab-title li { + margin-left: 10px; +} + +.list .list-item:hover { + background-color: whitesmoke; +} + +.list .list-item .title { + font-size: 13px; + width: 100%; +} + +.list .list-item .footer { + position: absolute; + right: 30px; + font-size: 12px; +} + +.top-panel-tips i { + font-size: 33px; +} \ No newline at end of file diff --git a/component/layui/lay/extends/pearAdmin.js b/component/layui/lay/extends/pearAdmin.js deleted file mode 100644 index 870fdfb..0000000 --- a/component/layui/lay/extends/pearAdmin.js +++ /dev/null @@ -1,242 +0,0 @@ -layui.define(['table', 'jquery', 'element', 'form', 'pearTab', 'pearMenu', 'pearFrame'], - function(exports) { - "use strict"; - - var $ = layui.jquery, - form = layui.form, - element = layui.element, - pearTab = layui.pearTab, - pearMenu = layui.pearMenu, - pearFrame = layui.pearFrame; - - var bodyFrame; - var sideMenu; - var bodyTab; - - var pearAdmin = new function() { - - this.render = function(option) { - this.menuRender(option); - this.bodyRender(option); - this.keepLoad(option); - this.logoRender(option); - } - - this.logoRender = function(option) { - - $(".layui-logo .logo").attr("src", option.logoImage); - $(".layui-logo .title").html(option.logoTitle); - } - - this.menuRender = function(option) { - sideMenu = pearMenu.render({ - elem: 'sideMenu', //依赖容器 - async: true, //数据形式 - theme: option.theme, - height: '100%', - control: option.control ? 'control' : false, // control - defaultMenu: 1, - defaultOpen: 0, //默认打开菜单 - accordion: true, - url: option.data, //数据地址 - parseData: false, //请求后是否进行数据解析 函数 - change: option.change - }) - sideMenu.selectItem(option.select); - } - - this.bodyRender = function(option) { - if (option.muiltTab) { - bodyTab = pearTab.render({ - elem: 'content', - roll: true, - tool: true, - width: '100%', - height: '100%', - index: 0, - tabMax: 20, - closeEvent: function(id) { - sideMenu.selectItem(id); - }, - data: [{ - id: '0', - url: option.index, - title: '首页', - close: false - }] //初始化数据 - }); - - bodyTab.click(function(id) { - bodyTab.positionTab(); - sideMenu.selectItem(id); - }) - - $("body").on("click", ".refresh", function() { - - bodyTab.refresh(600); - }) - - sideMenu.click(function(dom, data) { - - bodyTab.addTabOnly({ - id: data.menuId, - title: data.menuTitle, - url: data.menuUrl, - icon: data.menuIcon, - close: true - }, 300); - compatible(); - }) - - } else { - bodyFrame = pearFrame.render({ - elem: 'content', - title: '工作空间 / 首页', - url: option.index, - width: '100%', - height: '100%' - }); - - $("body").on("click", ".refresh", function() { - - bodyFrame.refresh(600); - }) - - sideMenu.click(function(dom, data) { - bodyFrame.changePage(data.menuUrl, data.menuPath, true); - }) - } - } - - this.keepLoad = function(option) { - setTimeout(function() { - $(".loader-main").fadeOut(option.done); - }, option.keepLoad) - } - }; - - $("body").on("click", ".collaspe,.pear-cover", function() { - sideMenu.collaspe(); - if ($(".pear-admin").is(".pear-mini")) { - $(".layui-icon-spread-left").addClass("layui-icon-shrink-right") - $(".layui-icon-spread-left").removeClass("layui-icon-spread-left") - $(".pear-admin").removeClass("pear-mini"); - } else { - $(".layui-icon-shrink-right").addClass("layui-icon-spread-left") - $(".layui-icon-shrink-right").removeClass("layui-icon-shrink-right") - $(".pear-admin").addClass("pear-mini"); - } - }) - - $("body").on("click", ".fullScreen", function() { - if ($(this).hasClass("layui-icon-screen-restore")) { - screenFun(2).then(function() { - $(".fullScreen").eq(0).removeClass("layui-icon-screen-restore"); - }); - } else { - screenFun(1).then(function() { - $(".fullScreen").eq(0).addClass("layui-icon-screen-restore"); - }); - } - - }); - -/* function compatible() { - if ($(window).width() <= 768) { - sideMenu.collaspe(); - if ($(".pear-admin").is(".pear-mini")) { - $(".layui-icon-spread-left").addClass("layui-icon-shrink-right") - $(".layui-icon-spread-left").removeClass("layui-icon-spread-left") - $(".pear-admin").removeClass("pear-mini"); - } else { - $(".layui-icon-shrink-right").addClass("layui-icon-spread-left") - $(".layui-icon-shrink-right").removeClass("layui-icon-shrink-right") - $(".pear-admin").addClass("pear-mini"); - } - } - } */ - - function screenFun(num) { - num = num || 1; - num = num * 1; - var docElm = document.documentElement; - - switch (num) { - case 1: - if (docElm.requestFullscreen) { - docElm.requestFullscreen(); - } else if (docElm.mozRequestFullScreen) { - docElm.mozRequestFullScreen(); - } else if (docElm.webkitRequestFullScreen) { - docElm.webkitRequestFullScreen(); - } else if (docElm.msRequestFullscreen) { - docElm.msRequestFullscreen(); - } - break; - case 2: - if (document.exitFullscreen) { - document.exitFullscreen(); - } else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if (document.webkitCancelFullScreen) { - document.webkitCancelFullScreen(); - } else if (document.msExitFullscreen) { - document.msExitFullscreen(); - } - break; - } - return new Promise(function(res, rej) { - res("返回值"); - }); - } - - - $("body").on("click", ".setting", function() { - - openRight(""); - - }) - - function openRight(html) { - layer.open({ - type: 1, - offset: 'r', - area: ['340px', '100%'], - title: false, - shade: 0.1, - closeBtn: 0, - shadeClose: false, - anim: -1, - skin: 'layer-anim-right', - move: false, - content: html, - success: function(layero, index) { - - form.render(); - - var color = localStorage.getItem("theme-color"); - if (color != "null") { - $(".select-color-item").removeClass("layui-icon") - .removeClass("layui-icon-ok"); - - $(".select-color-item").each(function() { - if ($(this).css("background-color") === color) { - $(this).addClass("layui-icon").addClass("layui-icon-ok"); - } - }); - } - - $('#layui-layer-shade' + index).click(function() { - var $layero = $('#layui-layer' + index); - $layero.animate({ - left: $layero.offset().left + $layero.width() - }, 200, function() { - layer.close(index); - }); - }) - } - }); - } - - exports('pearAdmin', pearAdmin); - }) diff --git a/component/layui/lay/extends/pearFrame.js b/component/layui/lay/extends/pearFrame.js deleted file mode 100644 index 11fe7e2..0000000 --- a/component/layui/lay/extends/pearFrame.js +++ /dev/null @@ -1,93 +0,0 @@ -layui.define(['table', 'jquery', 'element'], function (exports) { - "use strict"; - - var MOD_NAME = 'pearFrame', - $ = layui.jquery, - element = layui.element; - - var pearFrame = function (opt) { - this.option = opt; - }; - - pearFrame.prototype.render = function (opt) { - //默认配置值 - var option = { - elem:opt.elem, - url:opt.url, - title:opt.title, - width:opt.width, - height:opt.height, - done:opt.done ? opt.done: function(){ console.log("菜单渲染成功");} - } - - - createFrameHTML(option); - - $("#"+option.elem).width(option.width); - $("#"+option.elem).height(option.height); - - return new pearFrame(option); - } - - pearFrame.prototype.changePage = function(url,title,loading){ - - if(loading){ - var loading = $("#"+this.option.elem).find(".pear-frame-loading"); - - loading.css({display:'block'}); - } - - $("#"+this.option.elem+" iframe").attr("src",url); - - $("#"+this.option.elem+" .title").html(title); - - if(loading){ - var loading = $("#"+this.option.elem).find(".pear-frame-loading"); - - setTimeout(function(){ - - loading.css({display:'none'}); - - },800) - - } - - } - - pearFrame.prototype.refresh = function (time) { - - - // 刷 新 指 定 的 选 项 卡 - if(time!=false){ - - var loading = $("#"+this.option.elem).find(".pear-frame-loading"); - - loading.css({display:'block'}); - - if(time!=0){ - - setTimeout(function(){ - loading.css({display:'none'}); - },time) - } - - } - - $("#"+this.option.elem).find("iframe")[0].contentWindow.location.reload(true); - } - - function createFrameHTML(option){ - - var iframe = "" - - var loading = '