整理代码

develop
就眠仪式 2020-11-30 23:12:25 +08:00
parent 01283ff703
commit 604c556cca
13 changed files with 422 additions and 313 deletions

View File

@ -117,7 +117,6 @@
.pear-mini .layui-side-scroll {
height: calc(100% - 60px);
}
.pear-admin .layui-header .layui-nav .layui-nav-bar {
top: 0px !important;
height: 2px !important;

View File

@ -6,7 +6,6 @@
z-index: 9999999;
margin-top: -61px;
}
.loader {
width: 50px;
height: 50px;
@ -16,7 +15,6 @@
z-index: 999999;
background-color: whitesmoke;
}
.loader:before {
content: "";
width: 50px;
@ -29,7 +27,6 @@
left: 0;
animation: shadow .5s linear infinite;
}
.loader:after {
content: "";
width: 50px;
@ -41,7 +38,6 @@
left: 0;
animation: loading .5s linear infinite;
}
@-webkit-keyframes loading {
17% {
border-bottom-right-radius: 3px;
@ -64,7 +60,6 @@
transform: translateY(0) rotate(90deg);
}
}
@keyframes loading {
17% {
border-bottom-right-radius: 3px;
@ -87,7 +82,6 @@
transform: translateY(0) rotate(90deg);
}
}
@-webkit-keyframes shadow {
0%,
@ -99,7 +93,6 @@
transform: scale(1.2, 1);
}
}
@keyframes shadow {
0%,

View File

@ -17,11 +17,9 @@
font-size: 14px;
border-radius: 4px;
}
.pear-btn i {
font-size: 13px;
}
.pear-btn:hover {
opacity: .8;
filter: alpha(opacity=80);
@ -29,78 +27,63 @@
border-color: #c6e2ff;
background-color: #ECF5FF;
}
.pear-btn-danger,
.pear-btn-warming,
.pear-btn-success,
.pear-btn-primary {
color: #fff !important
}
.pear-btn[dashed] {
border-style: dashed !important;
}
/** Button 主题 */
.pear-btn-primary {
background-color: #2D8CF0 !important;
}
.pear-btn-danger {
background-color: #f56c6c !important
}
.pear-btn-warming {
background-color: #e6a23c !important
}
.pear-btn-success {
background-color: #67c23a !important
}
.pear-btn[round] {
border-radius: 50px;
}
.pear-btn-primary[plain] {
color: #409eff !important;
background: #ecf5ff !important;
border-color: #b3d8ff !important;
}
.pear-btn-primary[plain]:hover {
color: #fff !important;
background-color: #2d8cf0 !important
}
.pear-btn-success[plain] {
color: #67c23a !important;
background: #f0f9eb !important;
border-color: #c2e7b0 !important;
}
.pear-btn-success[plain]:hover {
color: white !important;
background-color: #67c23a !important
}
.pear-btn-warming[plain] {
color: #e6a23c !important;
background: #fdf6ec !important;
border-color: #f5dab1 !important;
}
.pear-btn-warming[plain]:hover {
color: white !important;
background-color: #e6a23c !important
}
.pear-btn-danger[plain] {
color: #f56c6c !important;
background: #fef0f0 !important;
border-color: #fbc4c4 !important;
}
.pear-btn-danger[plain]:hover {
color: white !important;
background-color: #f56c6c !important
@ -111,36 +94,30 @@
display: inline-block;
vertical-align: middle;
}
.pear-btn-group .pear-btn {
float: left;
position: relative;
border-radius: 0px;
}
.pear-btn-md {
height: 34px;
line-height: 34px;
padding: 0 10px;
font-size: 12.5px;
}
.pear-btn-group .pear-btn:first-child {
border-top-left-radius: 4px !important;
border-bottom-left-radius: 4px !important;
}
.pear-btn-group .pear-btn:last-child {
border-top-right-radius: 4px !important;
border-bottom-right-radius: 4px !important;
}
.pear-btn-group .pear-btn[round]:first-child {
border-top-left-radius: 50px !important;
border-bottom-left-radius: 50px !important;
}
.pear-btn-group .pear-btn[round]:last-child {
border-top-right-radius: 50px !important;
border-bottom-right-radius: 50px !important;
@ -153,14 +130,12 @@
padding: 0 10px;
font-size: 12px;
}
.pear-btn-xs {
height: 22px;
line-height: 22px;
padding: 0 5px;
font-size: 12px;
}
.pear-btn-lg {
height: 44px;
line-height: 44px;

View File

@ -1,13 +1,3 @@
/*!
* Cropper v0.9.1
* https://github.com/fengyuanchen/cropper
*
* Copyright (c) 2014-2015 Fengyuan Chen and contributors
* Released under the MIT license
*
* Date: 2015-03-21T04:58:27.265Z
*/
.cropper-container {
position: relative;
overflow: hidden;
@ -30,7 +20,10 @@
image-orientation: 0deg !important
}
.cropper-canvas, .cropper-crop-box, .cropper-drag-box, .cropper-modal {
.cropper-canvas,
.cropper-crop-box,
.cropper-drag-box,
.cropper-modal {
position: absolute;
top: 0;
right: 0;
@ -85,7 +78,9 @@
border-left-width: 1px
}
.cropper-face, .cropper-line, .cropper-point {
.cropper-face,
.cropper-line,
.cropper-point {
position: absolute;
display: block;
width: 100%;
@ -269,6 +264,9 @@
cursor: crosshair
}
.cropper-disabled .cropper-canvas, .cropper-disabled .cropper-face, .cropper-disabled .cropper-line, .cropper-disabled .cropper-point {
.cropper-disabled .cropper-canvas,
.cropper-disabled .cropper-face,
.cropper-disabled .cropper-line,
.cropper-disabled .cropper-point {
cursor: not-allowed
}

View File

@ -1,7 +1,162 @@
/**
* layui_dropdown
* v2.3.2
* by Microanswer
* http://layuidropdown.microanswer.cn/
**/
html #layuicss-dropdown_css{display:none;position:absolute;width:1989px}.dropdown-root{position:fixed;outline:0;overflow:hidden}.dropdown-pointer{width:0;height:0;position:absolute;display:block;overflow:hidden;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgBAMAAABQs2O3AAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABVQTFRFAAAAgICAgICAgICAhISE8PDw////jUnEegAAAAd0Uk5TAB/2/////74r3wgAAACOSURBVHicfcztDYAgDEVR2MCwgXEDwwbGDYwbyP4jyJfYlvbdvzc5zrH8ti8OFeKxou+384JEiPeDiAykhIgMpASICiCiAoDogE10wCQGYBEDMAgC6AQBVIIBGsEAhRDATAhgIiZAEhMgCAXghAIwQgUooQKEMICfMIBBmMBHmEAnANAIADQCAYVwCCjEC5fhzAE36RUGAAAAAElFTkSuQmCC) bottom center no-repeat;background-size:100% 50%;-webkit-transform-origin:center center;-moz-transform-origin:center center;-ms-transform-origin:center center;-o-transform-origin:center center;transform-origin:center center}.dropdown-pointer.bottom{-webkit-transform:rotate(-180deg);-moz-transform:rotate(-180deg);-ms-transform:rotate(-180deg);-o-transform:rotate(-180deg);transform:rotate(-180deg)}.dropdown-root .dropdown-content{background-color:#fff;border-radius:3px;box-shadow:1px 1px 5px #979797;overflow-x:auto;overflow-y:hidden}.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-thead{display:table-header-group}.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tbody{display:table-row-group}.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tr{display:table-row}.dropdown-root .dropdown-content .dropdown-content-table,.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-td,.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-th{display:table-cell;border:unset;text-align:unset;font-weight:400;min-height:unset;font-size:12px;line-height:12px;padding-top:0;padding-bottom:0}.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-th{font-weight:700}.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tr,.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tr:hover{background-color:unset}.dropdown-root .dropdown-content .dropdown-menu-wrap{border-right:1px solid transparent;overflow-y:auto;overflow-x:hidden}.dropdown-root .dropdown-content .dropdown-menu-fixed-head{border-right:1px solid transparent;overflow:hidden}.dropdown-root .dropdown-content .dropdown-menu-fixed-head .menu-fixed-head{margin:6px 14px 2px;color:#a8a8a8;font-size:12px}.dropdown-root .dropdown-content .dropdown-menu-fixed-head.menu-splitor,.dropdown-root .dropdown-content .dropdown-menu-wrap.menu-splitor{border-right:1px solid #D9D9D9}.dropdown-root .dropdown-content .dropdown-menu-wrap.overflowauto{overflow-y:auto;overflow-x:hidden}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu{padding:0;margin:0}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap{list-style:none;outline:0}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap:first-child{margin-top:10px}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap.nomargin{margin-top:0!important}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap:last-child{margin-bottom:10px}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header{margin-top:6px}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header.withLine{margin-left:0;margin-bottom:0;margin-right:0}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header,.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header legend{font-size:12px!important;line-height:15px!important;padding:0 14px!important;color:#a8a8a8}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-item{line-height:36px}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-item a{display:block;color:#333;padding:0 20px;min-width:40px;text-indent:0;font-size:14px;white-space:nowrap}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-item a:hover{background-color:#D9D9D9}
html #layuicss-dropdown_css {
display: none;
position: absolute;
width: 1989px
}
.dropdown-root {
position: fixed;
outline: 0;
overflow: hidden
}
.dropdown-pointer {
width: 0;
height: 0;
position: absolute;
display: block;
overflow: hidden;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgBAMAAABQs2O3AAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABVQTFRFAAAAgICAgICAgICAhISE8PDw////jUnEegAAAAd0Uk5TAB/2/////74r3wgAAACOSURBVHicfcztDYAgDEVR2MCwgXEDwwbGDYwbyP4jyJfYlvbdvzc5zrH8ti8OFeKxou+384JEiPeDiAykhIgMpASICiCiAoDogE10wCQGYBEDMAgC6AQBVIIBGsEAhRDATAhgIiZAEhMgCAXghAIwQgUooQKEMICfMIBBmMBHmEAnANAIADQCAYVwCCjEC5fhzAE36RUGAAAAAElFTkSuQmCC) bottom center no-repeat;
background-size: 100% 50%;
-webkit-transform-origin: center center;
-moz-transform-origin: center center;
-ms-transform-origin: center center;
-o-transform-origin: center center;
transform-origin: center center
}
.dropdown-pointer.bottom {
-webkit-transform: rotate(-180deg);
-moz-transform: rotate(-180deg);
-ms-transform: rotate(-180deg);
-o-transform: rotate(-180deg);
transform: rotate(-180deg)
}
.dropdown-root .dropdown-content {
background-color: #fff;
border-radius: 3px;
box-shadow: 1px 1px 5px #979797;
overflow-x: auto;
overflow-y: hidden
}
.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-thead {
display: table-header-group
}
.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tbody {
display: table-row-group
}
.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tr {
display: table-row
}
.dropdown-root .dropdown-content .dropdown-content-table,
.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-td,
.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-th {
display: table-cell;
border: unset;
text-align: unset;
font-weight: 400;
min-height: unset;
font-size: 12px;
line-height: 12px;
padding-top: 0;
padding-bottom: 0
}
.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-th {
font-weight: 700
}
.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tr,
.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tr:hover {
background-color: unset
}
.dropdown-root .dropdown-content .dropdown-menu-wrap {
border-right: 1px solid transparent;
overflow-y: auto;
overflow-x: hidden
}
.dropdown-root .dropdown-content .dropdown-menu-fixed-head {
border-right: 1px solid transparent;
overflow: hidden
}
.dropdown-root .dropdown-content .dropdown-menu-fixed-head .menu-fixed-head {
margin: 6px 14px 2px;
color: #a8a8a8;
font-size: 12px
}
.dropdown-root .dropdown-content .dropdown-menu-fixed-head.menu-splitor,
.dropdown-root .dropdown-content .dropdown-menu-wrap.menu-splitor {
border-right: 1px solid #D9D9D9
}
.dropdown-root .dropdown-content .dropdown-menu-wrap.overflowauto {
overflow-y: auto;
overflow-x: hidden
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu {
padding: 0;
margin: 0
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap {
list-style: none;
outline: 0
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap:first-child {
margin-top: 10px
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap.nomargin {
margin-top: 0 !important
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap:last-child {
margin-bottom: 10px
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header {
margin-top: 6px
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header.withLine {
margin-left: 0;
margin-bottom: 0;
margin-right: 0
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header,
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header legend {
font-size: 12px !important;
line-height: 15px !important;
padding: 0 14px !important;
color: #a8a8a8
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-item {
line-height: 36px
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-item a {
display: block;
color: #333;
padding: 0 20px;
min-width: 40px;
text-indent: 0;
font-size: 14px;
white-space: nowrap
}
.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-item a:hover {
background-color: #D9D9D9
}

View File

@ -24,7 +24,6 @@
.layui-nav-tree .layui-this,
.layui-nav-tree .layui-this>a,
.layui-nav-tree .layui-this>a:hover {
background-color: #5FB878;
}

View File

@ -40,8 +40,8 @@
.pear-tab .layui-tab-title .pear-tab-active {
display: inline-block;
background-color: lightgray;
width: 9px;
height: 9px;
width: 8px;
height: 8px;
border-radius: 30px;
margin-right: 12px;
}
@ -182,6 +182,7 @@
animation-fill-mode: forwards;
}
.ball-loader {
position: absolute;
left: 50%;

View File

@ -163,6 +163,7 @@ layui.define(['table', 'jquery', 'element', 'form', 'tab', 'menu', 'frame'],
}
localStorage.setItem("theme-color", color.id);
localStorage.setItem("theme-menu", menu);
localStorage.setItem("theme-color-context",color.color);
this.colorSet(color.color);
this.menuSkin(menu);
}

View File

@ -27,7 +27,6 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
change: opt.change ? opt.change : function() {},
done: opt.done ? opt.done : function() {}
}
if (option.async) {
getData(option.url).then(function(data) {
option.data = data;
@ -39,7 +38,6 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
renderMenu(option);
}, 500);
}
return new pearMenu(opt);
}
@ -214,14 +212,16 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
'" class="layui-nav arrow layui-nav-tree pear-nav-tree">';
// 兼容移动端
controlPe += '<li class="layui-nav-item"><a class="pe-title" href="javascript:;" >' + item.title + '</a>';
controlItemPe += '<dd pear-href="' + item.href + '" pear-title="' + item.title + '" pear-id="' + item.id +'"><a href="javascript:void(0);">'+ item.title +'</a></dd>';
controlItemPe += '<dd pear-href="' + item.href + '" pear-title="' + item.title + '" pear-id="' + item.id +
'"><a href="javascript:void(0);">' + item.title + '</a></dd>';
} else {
controlItem = '<li pear-href="' + item.href + '" pear-title="' + item.title + '" pear-id="' + item.id +
'" class="layui-nav-item"><a href="#">' + item.title + '</a></li>';
menuItem = '<ul style="display:none" pear-id="' + item.id + '" lay-filter="' + option.elem +
'" class="layui-nav arrow layui-nav-tree pear-nav-tree">';
controlItemPe += '<dd pear-href="' + item.href + '" pear-title="' + item.title + '" pear-id="' + item.id +'"><a href="javascript:void(0);">'+ item.title +'</a></dd>';
controlItemPe += '<dd pear-href="' + item.href + '" pear-title="' + item.title + '" pear-id="' + item.id +
'"><a href="javascript:void(0);">' + item.title + '</a></dd>';
}
index++;
@ -255,7 +255,6 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
})
menu += menuItem + '</ul>';
control += controlItem;
})
controlItemPe += "</li></dl></ul>"
controlPe += controlItemPe;
@ -361,26 +360,21 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
if (b) {
$("#" + option.elem + ".pear-nav-mini .layui-nav-item,#" + option.elem + ".pear-nav-mini dd").hover(function() {
$(this).children(".layui-nav-child").addClass("layui-nav-hover");
var top = $(this).offset().top + 5;
var y = window.document.body.clientHeight;
var height = $(window).height();
var topLength = $(this).offset().top;
var thisHeight = $(this).children(".layui-nav-child").height();
if ((thisHeight + topLength) > height) {
topLength = height - thisHeight - 10;
}
if (!$(this).is(".layui-nav-item")) {
var left = $(this).offset().left + $(this).width()+2;
var left = $(this).offset().left + $(this).width() + 3;
$(this).children(".layui-nav-child").offset({
left: left
});
} else {
var left = $(this).offset().left + 62;
var left = $(this).offset().left + 63;
$(this).children(".layui-nav-child").offset({
left: left
});

View File

@ -312,13 +312,10 @@ layui.define(['jquery', 'element'], function(exports) {
function tabDelete(elem, id, callback) {
//根据 elem id 来删除指定的 layui title li
var tabTitle = $(".layui-tab[lay-filter='" + elem + "']").find(".layui-tab-title");
// 删除指定 id 的 title
var removeTab = tabTitle.find("li[lay-id='" + id + "']");
var nextNode = removeTab.next("li");
if(!removeTab.hasClass("layui-this")){
@ -334,38 +331,30 @@ layui.define(['jquery', 'element'], function(exports) {
if (nextNode.length) {
nextNode.addClass("layui-this");
currId = nextNode.attr("lay-id");
$("#" + elem + " [id='" + currId + "']").parent().addClass("layui-show");
} else {
var prevNode = removeTab.prev("li");
prevNode.addClass("layui-this");
currId = prevNode.attr("lay-id");
$("#" + elem + " [id='" + currId + "']").parent().addClass("layui-show");
}
callback(currId);
removeTab.remove();
// 删除 content
var tabContent = $(".layui-tab[lay-filter='" + elem + "']").find("iframe[id='" + id + "']").parent();
tabContent.remove();
}
function createTab(option) {
var type = "";
var types = option.type+" ";
if (option.roll == true) {
type = "layui-tab-roll";
@ -379,7 +368,7 @@ layui.define(['jquery', 'element'], function(exports) {
type = "layui-tab-rollTool";
}
var tab = '<div class="pear-tab ' + type + ' layui-tab" lay-filter="' + option.elem + '" lay-allowClose="true">';
var tab = '<div class="pear-tab ' + types + type + ' layui-tab" lay-filter="' + option.elem + '" lay-allowClose="true">';
var title = '<ul class="layui-tab-title">';

View File

@ -41,6 +41,7 @@
<dd><a href="login.html">注销登录</a></dd>
</dl>
</li>
<!-- 主 题 配 置 -->
<li class="layui-nav-item setting"><a href="#" class="layui-icon layui-icon-more-vertical"></a></li>
</ul>
</div>
@ -48,7 +49,9 @@
<div class="layui-side layui-bg-black">
<!-- 顶 部 图 标 -->
<div class="layui-logo">
<!-- 图 表 -->
<img class="logo"></img>
<!-- 标 题 -->
<span class="title"></span>
</div>
<!-- 侧 边 菜 单 -->
@ -58,6 +61,7 @@
</div>
<!-- 视 图 页 面 -->
<div class="layui-body">
<!-- 内 容 页 面 -->
<div id="content"></div>
</div>
</div>

View File

@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title>Login Page</title>
<!-- 样 式 文 件 -->
<link rel="stylesheet" href="component/pear/css/pear.css" />
<link rel="stylesheet" href="admin/css/other/login.css" />
</head>

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<title>行为日志</title>
<link rel="stylesheet" href="../../component/pear/css/pear.css" />
</head>
<body class="pear-container">