更新依赖pearadminlayui
@@ -91,25 +91,27 @@ def get_render_config():
|
||||
}, menu={
|
||||
# 菜单数据来源
|
||||
"data": "/rights/menu",
|
||||
"collaspe": True,
|
||||
"collaspe": False,
|
||||
# 是否同时只打开一个菜单目录
|
||||
"accordion": True,
|
||||
"method": "GET",
|
||||
# 是否开启多系统菜单模式
|
||||
"control": False,
|
||||
# 顶部菜单宽度 PX
|
||||
"controlWidth": 500,
|
||||
# 默认选中的菜单项
|
||||
"select": "0",
|
||||
# 是否开启异步菜单,false 时 data 属性设置为菜单数据,false 时为 json 文件或后端接口
|
||||
"async": True
|
||||
}, tab={
|
||||
# 是否开启多选项卡
|
||||
"muiltTab": True,
|
||||
"enable": True,
|
||||
# 切换选项卡时,是否刷新页面状态
|
||||
"keepState": True,
|
||||
# 是否开启 Tab 记忆
|
||||
"session": True,
|
||||
# 最大可打开的选项卡数量
|
||||
"tabMax": 30,
|
||||
"max": 30,
|
||||
"index": {
|
||||
# 标识 ID , 建议与菜单项中的 ID 一致
|
||||
"id": "10",
|
||||
|
||||
@@ -12,13 +12,64 @@ body,
|
||||
transition: all .3s;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-side {
|
||||
top: 60px!important;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-side .layui-logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header .layui-logo {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-side .layui-side-scroll {
|
||||
height: 100%!important;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-side .layui-side-scroll {
|
||||
height: 100%!important;
|
||||
}
|
||||
|
||||
.pear-admin .layui-header.dark-theme .layui-layout-control .layui-this *{
|
||||
background-color: rgba(0,0,0,.1)!important;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header {
|
||||
z-index: 99999;
|
||||
width: 100%;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header .layui-layout-left {
|
||||
left: 230px;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header .layui-logo .title {
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header .layui-layout-control {
|
||||
display: inline-block;
|
||||
left: 370px;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header.dark-theme {
|
||||
box-shadow: 2px 0 6px rgb(0 21 41 / 35%);
|
||||
}
|
||||
|
||||
.pear-admin .layui-header .layui-logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pear-admin .layui-logo .title {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.pear-admin .layui-layout-right .layui-nav-child {
|
||||
border: 1px solid whitesmoke;
|
||||
border-radius: 6px;
|
||||
border-radius: 4px;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
@@ -29,11 +80,6 @@ body,
|
||||
border-bottom: 1px solid whitesmoke;
|
||||
}
|
||||
|
||||
.pear-admin .layui-header .layui-nav-img {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.pear-admin .layui-layout-control {
|
||||
left: 140px;
|
||||
position: absolute;
|
||||
@@ -45,10 +91,11 @@ body,
|
||||
|
||||
.pear-admin .layui-logo {
|
||||
width: 230px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
height: 59px;
|
||||
line-height: 59px;
|
||||
position: relative;
|
||||
background-color: #28333E;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, .12);
|
||||
}
|
||||
|
||||
.pear-admin .layui-logo img {
|
||||
@@ -103,12 +150,12 @@ body,
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
/** 隐 藏 布 局 样 式 */
|
||||
.pear-mini .layui-logo .title {
|
||||
/** 收缩布局 */
|
||||
.pear-mini .layui-side .layui-logo .title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pear-mini .layui-logo .logo {
|
||||
.pear-mini .layui-side .layui-logo .logo {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@@ -125,7 +172,7 @@ body,
|
||||
left: 60px;
|
||||
}
|
||||
|
||||
.pear-mini .layui-logo {
|
||||
.pear-mini .layui-side .layui-logo {
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
@@ -213,7 +260,6 @@ body,
|
||||
height: calc(100% - 62px);
|
||||
}
|
||||
|
||||
/** 隐 藏 布 局 样 式 */
|
||||
.pear-mini .layui-side {
|
||||
width: 0px;
|
||||
}
|
||||
@@ -292,22 +338,50 @@ body,
|
||||
|
||||
}
|
||||
|
||||
/** 亮色侧边风格 */
|
||||
.light-theme .layui-logo {
|
||||
background-color: white !important;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.light-theme .layui-side-scroll {
|
||||
background-color: white !important;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
/** 侧边主题 (亮) */
|
||||
.light-theme.layui-side {
|
||||
box-shadow: 2px 0 8px 0 rgba(29, 35, 41, .05) !important;
|
||||
}
|
||||
|
||||
/** 主 题 选 择 界 面 样 式 */
|
||||
.light-theme.layui-side .layui-logo {
|
||||
background-color: white !important;
|
||||
color: black !important;
|
||||
border-bottom: 1px whitesmoke solid;
|
||||
}
|
||||
|
||||
.light-theme.layui-side .layui-side-scroll {
|
||||
background-color: white !important;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.dark-theme.layui-header {
|
||||
border-bottom: none;
|
||||
background-color: #28333E;
|
||||
color: whitesmoke;
|
||||
}
|
||||
|
||||
.dark-theme.layui-header li>a{
|
||||
color: whitesmoke!important;
|
||||
}
|
||||
|
||||
.dark-theme.layui-header .layui-logo {
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/** 顶部主题 (白) */
|
||||
.light-theme.layui-header .layui-logo {
|
||||
background-color: white;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/** 主题面板 */
|
||||
.pearone-color .set-text {
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
}
|
||||
|
||||
.pearone-color .color-title {
|
||||
padding: 15px 0 0px 20px;
|
||||
margin-bottom: 4px;
|
||||
@@ -389,58 +463,3 @@ body,
|
||||
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .15);
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
/** 友情链接 */
|
||||
.more-setting {
|
||||
margin-top: 45px;
|
||||
}
|
||||
|
||||
.more-setting form {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.more-setting-title {
|
||||
padding: 15px 0 0px 20px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.more-setting .layui-form-label {
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.more-menu-list {
|
||||
width: 100%;
|
||||
margin-top: 80px;
|
||||
}
|
||||
|
||||
.more-menu-item:first-child {
|
||||
border-top: 1px solid #e8e8e8;
|
||||
}
|
||||
|
||||
.more-menu-item .layui-icon {
|
||||
font-size: 18px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.more-menu-item {
|
||||
color: #595959;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
font-size: 16px;
|
||||
padding: 0 25px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
font-style: normal;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.more-menu-item:hover {
|
||||
background-color: whitesmoke;
|
||||
}
|
||||
|
||||
.more-menu-item:after {
|
||||
color: #8c8c8c;
|
||||
right: 16px;
|
||||
content: "\e602";
|
||||
position: absolute;
|
||||
font-family: layui-icon !important;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
.top-panel-number {
|
||||
line-height: 60px;
|
||||
font-size: 30px;
|
||||
font-size: 29px;
|
||||
border-right: 1px solid #eceff9;
|
||||
}
|
||||
|
||||
@@ -69,9 +69,10 @@
|
||||
.custom-tab .layui-tab-title li {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.list .list-item {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
height: 31.8px;
|
||||
line-height: 31.8px;
|
||||
color: gray;
|
||||
padding: 5px;
|
||||
padding-left: 15px;
|
||||
|
||||
@@ -1,18 +1,121 @@
|
||||
.pear-container {background-color: whitesmoke;margin: 10px;}
|
||||
.pear-card {width: 100%;height: 66px;background-color: #F8F8F8;display: inline-block;border-radius: 5px;text-align: center;margin-bottom: 3px;}
|
||||
.pear-card:hover,.pear-card2:hover{box-shadow: 2px 0 8px 0 lightgray!important;}.pear-card2 {width: 100%;height: 90px;background-color: #F8F8F8;display: inline-block;border-radius: 5px;text-align: center;margin-bottom: 3px;}
|
||||
.pear-card2 i {font-size: 30px;height: 90px;line-height: 90px;}
|
||||
.pear-card i {font-size: 30px;height: 66px;line-height: 66px;}
|
||||
.layui-col-md3 {text-align: center;}
|
||||
.pear-card-title {margin-top: 3px;}
|
||||
.person img {width: 90px;height: 90px;border-radius: 4px;margin-top: 8px;margin-left: 8px;}
|
||||
.pear-card2 .count {color: #51A351;font-size: 30px;margin-top: 12px;}
|
||||
.pear-card2 .title {color: gray;font-size: 14px;margin-top: 14px;}
|
||||
.pear-card-status {padding: 0 10px 10px;}
|
||||
.pear-card-status li {position: relative;padding: 10px 0;border-bottom: 1px solid #EEE;}
|
||||
.pear-card-status li h3 {padding-bottom: 5px;font-weight: 700;}
|
||||
.pear-card-status li p {padding-bottom: 10px;padding-top: 3px ;}
|
||||
.pear-card-status li>span {color: #999;}
|
||||
.pear-reply {position: absolute;right: 20px;}
|
||||
.person .title{font-size: 17px;font-weight: 600;margin-left: 18px;margin-top: 16px;position: absolute;display: inline-block;}
|
||||
.person .desc{font-size: 16px;font-weight: 600;margin-left: 115px;margin-top: -30px;position: absolute;display: inline-block;}
|
||||
.pear-container {
|
||||
background-color: whitesmoke;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.pear-card {
|
||||
width: 100%;
|
||||
height: 66px;
|
||||
background-color: #F8F8F8;
|
||||
display: inline-block;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.pear-card:hover,
|
||||
.pear-card2:hover {
|
||||
box-shadow: 2px 0 8px 0 lightgray !important;
|
||||
}
|
||||
|
||||
.pear-card2 {
|
||||
width: 100%;
|
||||
height: 90px;
|
||||
background-color: #F8F8F8;
|
||||
display: inline-block;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.pear-card2 i {
|
||||
font-size: 30px;
|
||||
height: 90px;
|
||||
line-height: 90px;
|
||||
}
|
||||
|
||||
.pear-card i {
|
||||
font-size: 30px;
|
||||
height: 66px;
|
||||
line-height: 66px;
|
||||
}
|
||||
|
||||
.layui-col-md3 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pear-card-title {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.person img {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
border-radius: 4px;
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.pear-card2 .count {
|
||||
color: #51A351;
|
||||
font-size: 30px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.pear-card2 .title {
|
||||
color: gray;
|
||||
font-size: 14px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.pear-card-status {
|
||||
padding: 0 10px 10px;
|
||||
}
|
||||
|
||||
.pear-card-status li {
|
||||
position: relative;
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid #EEE;
|
||||
}
|
||||
|
||||
.pear-card-status li h3 {
|
||||
padding-bottom: 5px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.pear-card-status li p {
|
||||
padding-bottom: 10px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
.pear-card-status li>span {
|
||||
color: #999;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.pear-reply {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
bottom: 12px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.person .title {
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
margin-left: 18px;
|
||||
margin-top: 16px;
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.person .desc {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-left: 115px;
|
||||
margin-top: -30px;
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@@ -391,14 +391,6 @@
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 代码高亮 */
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "...",
|
||||
"count": 3,
|
||||
"msg": "not data",
|
||||
"count": 30,
|
||||
"data": [{
|
||||
"id": "1",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png",
|
||||
@@ -15,42 +14,44 @@
|
||||
"remark": "生命就像一盒巧克力,结果往往出人意料",
|
||||
"time": "几秒前"
|
||||
}, {
|
||||
"id": "1",
|
||||
"id": "3",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png",
|
||||
"title": "Angular",
|
||||
"remark": "希望是一个好东西,也许是最好的,好东西是不会消亡的",
|
||||
"time": "几秒前"
|
||||
},
|
||||
{
|
||||
"id": "1",
|
||||
"id": "4",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png",
|
||||
"title": "React",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
}, {
|
||||
"id": "1",
|
||||
"id": "5",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png",
|
||||
"title": "Alipay",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
}, {
|
||||
"id": "2",
|
||||
"id": "6",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iXjVmWVHbCJAyqvDxdtx.png",
|
||||
"title": "Layui",
|
||||
"remark": "生命就像一盒巧克力,结果往往出人意料",
|
||||
"time": "几秒前"
|
||||
}, {
|
||||
"id": "1",
|
||||
"id": "7",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png",
|
||||
"title": "Angular",
|
||||
"remark": "希望是一个好东西,也许是最好的,好东西是不会消亡的",
|
||||
"time": "几秒前"
|
||||
},
|
||||
{
|
||||
"id": "1",
|
||||
"id": "8",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png",
|
||||
"title": "React",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
}]
|
||||
}
|
||||
],
|
||||
"code": 0
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[{
|
||||
"id": 1,
|
||||
"title": "工作空间",
|
||||
"type": 0,
|
||||
"icon": "layui-icon layui-icon-console",
|
||||
"type": 0,
|
||||
"href": "",
|
||||
"children": [{
|
||||
"id": 10,
|
||||
@@ -24,7 +24,7 @@
|
||||
"icon": "layui-icon layui-icon-console",
|
||||
"type": 1,
|
||||
"openType": "_iframe",
|
||||
"href": "http://www.baidu.com"
|
||||
"href": "http://www.bing.com"
|
||||
}, {
|
||||
"id": 15,
|
||||
"title": "主题预览",
|
||||
@@ -144,11 +144,18 @@
|
||||
"href": "view/document/drawer.html"
|
||||
}, {
|
||||
"id": 2022,
|
||||
"title": "消息通知",
|
||||
"title": "消息通知 (过时)",
|
||||
"icon": "layui-icon layui-icon-face-cry",
|
||||
"type": 1,
|
||||
"openType": "_iframe",
|
||||
"href": "view/document/notice.html"
|
||||
}, {
|
||||
"id": 2025,
|
||||
"title": "消息通知 (新增)",
|
||||
"icon": "layui-icon layui-icon-face-cry",
|
||||
"type": 1,
|
||||
"openType": "_iframe",
|
||||
"href": "view/document/toast.html"
|
||||
}, {
|
||||
"id": 2024,
|
||||
"title": "加载组件",
|
||||
|
||||
@@ -1,20 +1,43 @@
|
||||
[{
|
||||
"id": 1,
|
||||
"title": "私信",
|
||||
"title": "通知",
|
||||
"children": [{
|
||||
"id": 11,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条私人消息",
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "你收到了 14 份新周报",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条私人消息",
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png",
|
||||
"title": "曲妮妮 已通过第三轮面试",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png",
|
||||
"title": "可以区分多种通知类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",
|
||||
"title": "左侧图标用于区分不同的类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "内容不要超过两行字",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}]
|
||||
},
|
||||
{
|
||||
@@ -22,67 +45,83 @@
|
||||
"title": "消息",
|
||||
"children": [{
|
||||
"id": 11,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "你收到了 14 份新周报",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png",
|
||||
"title": "曲妮妮 已通过第三轮面试",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png",
|
||||
"title": "可以区分多种通知类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",
|
||||
"title": "左侧图标用于区分不同的类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "内容不要超过两行字",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
"time": "刚刚"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "通知",
|
||||
"title": "代办",
|
||||
"children": [{
|
||||
"id": 11,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条警告通知",
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "你收到了 14 份新周报",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条警告通知",
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png",
|
||||
"title": "曲妮妮 已通过第三轮面试",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png",
|
||||
"title": "可以区分多种通知类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",
|
||||
"title": "左侧图标用于区分不同的类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "内容不要超过两行字",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"parentId": "0",
|
||||
"icon": "layui-icon-set-fill",
|
||||
"sort": 1,
|
||||
"enable": 1,
|
||||
"checkArr": "0"
|
||||
}, {
|
||||
"powerId": "2",
|
||||
@@ -23,6 +24,7 @@
|
||||
"parentId": "1",
|
||||
"icon": "layui-icon-username",
|
||||
"sort": null,
|
||||
"enable": 1,
|
||||
"checkArr": "0"
|
||||
}, {
|
||||
"powerId": "3",
|
||||
@@ -34,6 +36,7 @@
|
||||
"parentId": "1",
|
||||
"icon": "layui-icon-user",
|
||||
"sort": null,
|
||||
"enable": 1,
|
||||
"checkArr": "0"
|
||||
}, {
|
||||
"powerId": "4",
|
||||
|
||||
@@ -1 +1,42 @@
|
||||
{"createTime":null,"createBy":null,"updateTime":null,"updateBy":null,"remark":null,"code":0,"msg":"...","count":3,"data":[{"createTime":null,"createBy":null,"updateTime":null,"updateBy":null,"remark":null,"roleId":"1","roleName":"超级管理员","roleCode":"admin","enable":"1","details":"超级管理员","checked":false},{"createTime":null,"createBy":null,"updateTime":null,"updateBy":null,"remark":null,"roleId":"2","roleName":"普通管理员","roleCode":"manager","enable":"0","details":"普通管理员","checked":false},{"createTime":null,"createBy":null,"updateTime":null,"updateBy":null,"remark":null,"roleId":"3","roleName":"普通用户","roleCode":"pearson","enable":"0","details":"普通用户","checked":false}]}
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "...",
|
||||
"count": 3,
|
||||
"data": [{
|
||||
"createTime": null,
|
||||
"createBy": null,
|
||||
"updateTime": null,
|
||||
"updateBy": null,
|
||||
"remark": null,
|
||||
"roleId": "1",
|
||||
"roleName": "超级管理员",
|
||||
"roleCode": "admin",
|
||||
"enable": "1",
|
||||
"details": "超级管理员",
|
||||
"checked": false
|
||||
}, {
|
||||
"createTime": null,
|
||||
"createBy": null,
|
||||
"updateTime": null,
|
||||
"updateBy": null,
|
||||
"remark": null,
|
||||
"roleId": "2",
|
||||
"roleName": "普通管理员",
|
||||
"roleCode": "manager",
|
||||
"enable": "0",
|
||||
"details": "普通管理员",
|
||||
"checked": false
|
||||
}, {
|
||||
"createTime": null,
|
||||
"createBy": null,
|
||||
"updateTime": null,
|
||||
"updateBy": null,
|
||||
"remark": null,
|
||||
"roleId": "3",
|
||||
"roleName": "普通用户",
|
||||
"roleCode": "pearson",
|
||||
"enable": "0",
|
||||
"details": "普通用户",
|
||||
"checked": false
|
||||
}]
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"avatar": null,
|
||||
"sex": "1",
|
||||
"phone": "1555324324234",
|
||||
"enable": "1",
|
||||
"enable": "0",
|
||||
"login": "1",
|
||||
"roleIds": null
|
||||
}, {
|
||||
|
||||
|
Before Width: | Height: | Size: 299 KiB After Width: | Height: | Size: 309 KiB |
@@ -25,7 +25,6 @@
|
||||
opacity: .8;
|
||||
filter: alpha(opacity=80);
|
||||
color: #409eff;
|
||||
border-color: #c6e2ff;
|
||||
background-color: #ECF5FF;
|
||||
}
|
||||
|
||||
@@ -51,8 +50,8 @@
|
||||
border: #f6ad55;
|
||||
}
|
||||
.pear-btn-success {
|
||||
background-color: #5FB878 !important;
|
||||
border: #5FB878;
|
||||
background-color: #36b368 !important;
|
||||
border: #36b368;
|
||||
}
|
||||
|
||||
.pear-btn[round] {
|
||||
@@ -62,7 +61,6 @@
|
||||
.pear-btn-primary[plain] {
|
||||
color: #409eff !important;
|
||||
background: #ecf5ff 10% !important;
|
||||
border-color: #b3d8ff !important;
|
||||
}
|
||||
|
||||
.pear-btn-primary[plain]:hover {
|
||||
@@ -71,20 +69,18 @@
|
||||
}
|
||||
|
||||
.pear-btn-success[plain] {
|
||||
color: #67c23a !important;
|
||||
color: #36b368 !important;
|
||||
background: #f0f9eb !important;
|
||||
border-color: #c2e7b0 !important;
|
||||
}
|
||||
|
||||
.pear-btn-success[plain]:hover {
|
||||
color: white !important;
|
||||
background-color: #67c23a !important
|
||||
background-color: #36b368 !important
|
||||
}
|
||||
|
||||
.pear-btn-warming[plain] {
|
||||
color: #e6a23c !important;
|
||||
background: #fdf6ec !important;
|
||||
border-color: #f5dab1 !important;
|
||||
}
|
||||
|
||||
.pear-btn-warming[plain]:hover {
|
||||
@@ -95,7 +91,6 @@
|
||||
.pear-btn-danger[plain] {
|
||||
color: #f56c6c !important;
|
||||
background: #fef0f0 !important;
|
||||
border-color: #fbc4c4 !important;
|
||||
}
|
||||
|
||||
.pear-btn-danger[plain]:hover {
|
||||
|
||||
@@ -69,10 +69,25 @@
|
||||
margin-left: -10px;
|
||||
}
|
||||
|
||||
.pear-card-component {
|
||||
.cloud-card-component {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.pear-card-component .layui-laypage .layui-laypage-curr .layui-laypage-em {
|
||||
border-radius: 0px !important;
|
||||
.cloud-card-component .layui-table-click {
|
||||
border-radius: 6px!important;
|
||||
}
|
||||
|
||||
.ew-table-loading {
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
}
|
||||
.ew-table-loading > i {
|
||||
color: #999;
|
||||
font-size: 30px;
|
||||
}
|
||||
.ew-table-loading.ew-loading-float {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
@@ -1,28 +1,32 @@
|
||||
.layui-card-body .layui-form{
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
input::-webkit-input-placeholder,
|
||||
textarea::-webkit-input-placeholder {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.layui-input:hover,
|
||||
.layui-textarea:hover,
|
||||
.layui-input:focus,
|
||||
.layui-textarea:focus {
|
||||
border-color: #eee;
|
||||
}
|
||||
|
||||
.layui-input:focus,
|
||||
.layui-textarea:focus {
|
||||
border-color: #5FB878 !important;
|
||||
box-shadow: 0 0 0 3px #f0f9eb !important;
|
||||
}
|
||||
|
||||
.layui-input[success] {
|
||||
box-shadow: 0px 0px 3px 1px #5FB878 !important;
|
||||
box-shadow: 0px 0px 0px 3px #f0f9eb !important;
|
||||
border: #5FB878 1px solid!important;
|
||||
}
|
||||
|
||||
.layui-input[failure] {
|
||||
box-shadow: 0px 0px 3px 1px #F56C6C;
|
||||
box-shadow: 0px 0px 0px 3px #fef0f0 !important;
|
||||
border: #F56C6C 1px solid;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,15 +33,15 @@
|
||||
|
||||
.pear-frame .pear-frame-content {
|
||||
width: 100%;
|
||||
height: calc(100% - 45px) !important;
|
||||
height: calc(100% - 0px) !important;
|
||||
}
|
||||
|
||||
.pear-frame-loading {
|
||||
position: absolute;
|
||||
display: none;
|
||||
width: 100%;
|
||||
height: calc(100% - 45px) !important;
|
||||
top: 42px;
|
||||
height: calc(100% - 0px) !important;
|
||||
top: 0px;
|
||||
z-index: 19;
|
||||
background-color: #fff
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
.layui-iconpicker .layui-anim{
|
||||
width: 300px!important;
|
||||
}
|
||||
@@ -73,7 +73,15 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pear-nav-tree .layui-nav-item a .layui-badge-dot {
|
||||
float: right;
|
||||
right: 13px;
|
||||
}
|
||||
|
||||
.pear-nav-tree .layui-nav-item a .layui-badge {
|
||||
float: right;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
/** 实 现 菜 单 隐 藏 */
|
||||
.pear-nav-mini {
|
||||
@@ -108,9 +116,11 @@
|
||||
.pear-nav-control.pc .layui-this * {
|
||||
background-color: whitesmoke;
|
||||
}
|
||||
|
||||
.pear-nav-control.pc *{
|
||||
color: darkslategray!important;
|
||||
}
|
||||
|
||||
.pear-nav-control.pc .layui-nav-bar{
|
||||
display: none!important;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,12 @@
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.pear-notice li {
|
||||
.pear-notice {
|
||||
box-shadow: 0 6px 16px -8px rgb(0 0 0 / 8%), 0 9px 28px 0 rgb(0 0 0 / 5%), 0 12px 48px 16px rgb(0 0 0 / 3%)!important;
|
||||
}
|
||||
|
||||
.pear-notice .layui-tab-title {
|
||||
text-align: center;
|
||||
border-right: 1px solid whitesmoke;
|
||||
}
|
||||
|
||||
@@ -12,12 +17,7 @@
|
||||
}
|
||||
|
||||
.pear-notice {
|
||||
width: 285px!important;
|
||||
}
|
||||
|
||||
.pear-notice span{
|
||||
margin-left: 20px;
|
||||
font-size: 13px;
|
||||
width: 360px !important;
|
||||
}
|
||||
|
||||
.pear-notice img {
|
||||
@@ -25,18 +25,48 @@
|
||||
width: 33px !important;
|
||||
height: 33px !important;
|
||||
border-radius: 50px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.pear-notice-item {
|
||||
height: 45px !important;
|
||||
line-height: 45px !important;
|
||||
padding-right: 20px;
|
||||
padding-left: 20px;
|
||||
border-bottom: 1px solid whitesmoke;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
.pear-notice-end {
|
||||
float: right;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.pear-notice-item span{
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
/** 滚动条样式 */
|
||||
.pear-notice *::-webkit-scrollbar{width:0px;height:0px;}
|
||||
.pear-notice *::-webkit-scrollbar-track{background: white;border-radius:2px;}
|
||||
.pear-notice *::-webkit-scrollbar-thumb{background: #E6E6E6;border-radius:2px;}
|
||||
.pear-notice *::-webkit-scrollbar-thumb:hover{background: #E6E6E6;}
|
||||
.pear-notice *::-webkit-scrollbar-corner{background: #f6f6f6;}
|
||||
.pear-notice *::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
.pear-notice *::-webkit-scrollbar-track {
|
||||
background: white;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.pear-notice *::-webkit-scrollbar-thumb {
|
||||
background: #E6E6E6;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.pear-notice *::-webkit-scrollbar-thumb:hover {
|
||||
background: #E6E6E6;
|
||||
}
|
||||
|
||||
.pear-notice *::-webkit-scrollbar-corner {
|
||||
background: #f6f6f6;
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
}
|
||||
|
||||
.layui-table-cell {
|
||||
height: 34px !important;
|
||||
line-height: 34px !important;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.layui-table .layui-laypage .layui-laypage-curr .layui-laypage-em {
|
||||
@@ -32,8 +32,8 @@
|
||||
}
|
||||
|
||||
.layui-table tr {
|
||||
height: 34px !important;
|
||||
line-height: 34px !important;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.layui-table-cell {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
@import url("module/dtree/font/dtreefont.css");
|
||||
@import url("module/dtree/dtree.css");
|
||||
@import url("module/iconPicker.css");
|
||||
@import url("module/treetable.css");
|
||||
@import url("module/message.css");
|
||||
@import url("module/cropper.css");
|
||||
@@ -16,6 +15,7 @@
|
||||
@import url("module/table.css");
|
||||
@import url("module/frame.css");
|
||||
@import url("module/layer.css");
|
||||
@import url("module/toast.css");
|
||||
@import url("module/menu.css");
|
||||
@import url("module/form.css");
|
||||
@import url("module/link.css");
|
||||
|
||||
@@ -24,7 +24,6 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
|
||||
var pearAdmin = new function() {
|
||||
|
||||
// 默认配置
|
||||
var configType = 'yml';
|
||||
var configPath = 'pear.config.yml';
|
||||
|
||||
@@ -36,15 +35,6 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
configType = type;
|
||||
}
|
||||
|
||||
this.setAvatar = function(url, username) {
|
||||
var image = new Image();
|
||||
image.src = url || "admin/images/avatar.jpg";
|
||||
image.onload = function() {
|
||||
$(".layui-nav-img").attr("src", convert.imageToBase64(image));
|
||||
}
|
||||
$(".layui-nav-img").parent().append(username);
|
||||
}
|
||||
|
||||
this.render = function(initConfig) {
|
||||
if (initConfig !== undefined) {
|
||||
applyConfig(initConfig);
|
||||
@@ -92,12 +82,12 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
theme: "dark-theme",
|
||||
height: '100%',
|
||||
method: param.menu.method,
|
||||
control: param.menu.control ? 'control' : false, // control
|
||||
control: isControl(param) === 'true' || isControl(param) === true ? 'control' : false, // control
|
||||
controlWidth: param.menu.controlWidth,
|
||||
defaultMenu: 0,
|
||||
accordion: param.menu.accordion,
|
||||
url: param.menu.data,
|
||||
data: param.menu.data, //async为false时,传入菜单数组
|
||||
data: param.menu.data,
|
||||
parseData: false,
|
||||
change: function() {
|
||||
compatible();
|
||||
@@ -110,24 +100,12 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
|
||||
this.bodyRender = function(param) {
|
||||
|
||||
body.on("click", ".refresh", function() {
|
||||
var refreshA = $(".refresh a");
|
||||
refreshA.removeClass("layui-icon-refresh-1");
|
||||
refreshA.addClass("layui-anim");
|
||||
refreshA.addClass("layui-anim-rotate");
|
||||
refreshA.addClass("layui-anim-loop");
|
||||
refreshA.addClass("layui-icon-loading");
|
||||
if (param.tab.muiltTab) bodyTab.refresh(400);
|
||||
else bodyFrame.refresh(400);
|
||||
setTimeout(function() {
|
||||
refreshA.addClass("layui-icon-refresh-1");
|
||||
refreshA.removeClass("layui-anim");
|
||||
refreshA.removeClass("layui-anim-rotate");
|
||||
refreshA.removeClass("layui-anim-loop");
|
||||
refreshA.removeClass("layui-icon-loading");
|
||||
}, 600)
|
||||
refresh();
|
||||
})
|
||||
if (param.tab.muiltTab) {
|
||||
|
||||
if (isMuiltTab(param) === "true" || isMuiltTab(param) === true) {
|
||||
bodyTab = pearTab.render({
|
||||
elem: 'content',
|
||||
roll: true,
|
||||
@@ -136,7 +114,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
height: '100%',
|
||||
session: param.tab.session,
|
||||
index: 0,
|
||||
tabMax: param.tab.tabMax,
|
||||
tabMax: param.tab.max,
|
||||
closeEvent: function(id) {
|
||||
sideMenu.selectItem(id);
|
||||
},
|
||||
@@ -155,6 +133,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
bodyTab.click(function(id) {
|
||||
if (!param.tab.keepState) {
|
||||
bodyTab.refresh(false);
|
||||
@@ -185,7 +164,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
});
|
||||
|
||||
sideMenu.click(function(dom, data) {
|
||||
bodyFrame.changePage(data.menuUrl, data.menuPath, true);
|
||||
bodyFrame.changePage(data.menuUrl, true);
|
||||
compatible()
|
||||
})
|
||||
}
|
||||
@@ -198,6 +177,90 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}, param.other.keepLoad)
|
||||
}
|
||||
|
||||
this.themeRender = function(option) {
|
||||
if (option.theme.allowCustom === false) {
|
||||
$(".setting").remove();
|
||||
}
|
||||
var colorId = localStorage.getItem("theme-color");
|
||||
var currentColor = getColorById(colorId);
|
||||
localStorage.setItem("theme-color", currentColor.id);
|
||||
localStorage.setItem("theme-color-color", currentColor.color);
|
||||
localStorage.setItem("theme-color-second", currentColor.second);
|
||||
pearTheme.changeTheme(window, isAutoHead(config));
|
||||
|
||||
var menu = localStorage.getItem("theme-menu");
|
||||
if (menu === null) {
|
||||
menu = option.theme.defaultMenu;
|
||||
} else {
|
||||
if (option.theme.allowCustom === false) {
|
||||
menu = option.theme.defaultMenu;
|
||||
}
|
||||
}
|
||||
|
||||
var header = localStorage.getItem("theme-header");
|
||||
if (header === null) {
|
||||
header = option.theme.defaultHeader;
|
||||
} else {
|
||||
if (option.theme.allowCustom === false) {
|
||||
header = option.theme.defaultHeader;
|
||||
}
|
||||
}
|
||||
|
||||
var banner = localStorage.getItem("theme-banner");
|
||||
if (banner === null) {
|
||||
banner = option.theme.banner;
|
||||
} else {
|
||||
if (option.theme.allowCustom === false) {
|
||||
banner = option.theme.banner;
|
||||
}
|
||||
}
|
||||
|
||||
var autoHead = localStorage.getItem("auto-head");
|
||||
if (autoHead === null) {
|
||||
autoHead = option.other.autoHead;
|
||||
} else {
|
||||
if (option.theme.allowCustom === false) {
|
||||
autoHead = option.other.autoHead;
|
||||
}
|
||||
}
|
||||
|
||||
var muiltTab = localStorage.getItem("muilt-tab");
|
||||
if (muiltTab === null) {
|
||||
muiltTab = option.tab.enable;
|
||||
} else {
|
||||
if (option.theme.allowCustom === false) {
|
||||
muiltTab = option.tab.enable;
|
||||
}
|
||||
}
|
||||
|
||||
var control = localStorage.getItem("control");
|
||||
if (control === null) {
|
||||
control = option.menu.control;
|
||||
} else {
|
||||
if (option.theme.allowCustom === false) {
|
||||
control = option.menu.control;
|
||||
}
|
||||
}
|
||||
|
||||
localStorage.setItem("muilt-tab",muiltTab);
|
||||
localStorage.setItem("theme-banner", banner);
|
||||
localStorage.setItem("theme-menu", menu);
|
||||
localStorage.setItem("theme-header", header);
|
||||
localStorage.setItem("auto-head", autoHead);
|
||||
localStorage.setItem("control",control);
|
||||
this.menuSkin(menu);
|
||||
this.headerSkin(header);
|
||||
this.bannerSkin(banner);
|
||||
}
|
||||
|
||||
this.bannerSkin = function(theme) {
|
||||
var pearAdmin = $(".pear-admin");
|
||||
pearAdmin.removeClass("banner-layout");
|
||||
if(theme === true || theme === "true") {
|
||||
pearAdmin.addClass("banner-layout");
|
||||
}
|
||||
}
|
||||
|
||||
this.collaspe = function(param) {
|
||||
if (param.menu.collaspe) {
|
||||
if ($(window).width() >= 768) {
|
||||
@@ -206,29 +269,15 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
}
|
||||
|
||||
this.themeRender = function(option) {
|
||||
if (option.theme.allowCustom === false) {
|
||||
$(".setting").remove();
|
||||
}
|
||||
var colorId = localStorage.getItem("theme-color");
|
||||
var currentColor = getColorById(colorId);
|
||||
localStorage.setItem("theme-color", currentColor.id);
|
||||
localStorage.setItem("theme-color-context", currentColor.color);
|
||||
pearTheme.changeTheme(window, option.other.autoHead);
|
||||
var menu = localStorage.getItem("theme-menu");
|
||||
if (menu == null) {
|
||||
menu = option.theme.defaultMenu;
|
||||
} else {
|
||||
if (option.theme.allowCustom === false) {
|
||||
menu = option.theme.defaultMenu;
|
||||
}
|
||||
}
|
||||
localStorage.setItem("theme-menu", menu);
|
||||
this.menuSkin(menu);
|
||||
this.menuSkin = function(theme) {
|
||||
var pearAdmin = $(".pear-admin .layui-side");
|
||||
pearAdmin.removeClass("light-theme");
|
||||
pearAdmin.removeClass("dark-theme");
|
||||
pearAdmin.addClass(theme);
|
||||
}
|
||||
|
||||
this.menuSkin = function(theme) {
|
||||
var pearAdmin = $(".pear-admin");
|
||||
this.headerSkin = function(theme) {
|
||||
var pearAdmin = $(".pear-admin .layui-header");
|
||||
pearAdmin.removeClass("light-theme");
|
||||
pearAdmin.removeClass("dark-theme");
|
||||
pearAdmin.addClass(theme);
|
||||
@@ -241,43 +290,45 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
this.message = function(callback) {
|
||||
if (callback != null) {
|
||||
msgInstance.click(callback);
|
||||
} else {
|
||||
msgInstance.click(messageTip);
|
||||
}
|
||||
}
|
||||
|
||||
this.jump = function(id, title, url) {
|
||||
if (config.tab.muiltTab) {
|
||||
if (isMuiltTab(config)==="true" || isMuiltTab(param) === true) {
|
||||
bodyTab.addTabOnly({
|
||||
id: id,
|
||||
title: title,
|
||||
url: url,
|
||||
icon: null,
|
||||
close: true
|
||||
}, 300);
|
||||
}, 400);
|
||||
} else {
|
||||
sideMenu.selectItem(id);
|
||||
bodyFrame.changePage(url, title, true);
|
||||
bodyFrame.changePage(url, true);
|
||||
}
|
||||
}
|
||||
|
||||
this.refresh = function() {
|
||||
refresh();
|
||||
}
|
||||
};
|
||||
|
||||
var messageTip = function(id, title, context, form) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '消息', //标题
|
||||
area: ['390px', '330px'], //宽高
|
||||
shade: 0.4, //遮罩透明度
|
||||
content: "<div style='background-color:whitesmoke;'><div class='layui-card'><div class='layui-card-body'>来源 : " +
|
||||
form + "</div><div class='layui-card-header' >标题 : " + title +
|
||||
"</div><div class='layui-card-body' >内容 : " + context + "</div></div></div>", //支持获取DOM元素
|
||||
btn: ['确认'], //按钮组
|
||||
scrollbar: false, //屏蔽浏览器滚动条
|
||||
yes: function(index) { //layer.msg('yes'); //点击确定回调
|
||||
layer.close(index);
|
||||
showToast();
|
||||
}
|
||||
});
|
||||
function refresh() {
|
||||
var refreshA = $(".refresh a");
|
||||
refreshA.removeClass("layui-icon-refresh-1");
|
||||
refreshA.addClass("layui-anim");
|
||||
refreshA.addClass("layui-anim-rotate");
|
||||
refreshA.addClass("layui-anim-loop");
|
||||
refreshA.addClass("layui-icon-loading");
|
||||
if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) bodyTab.refresh(400);
|
||||
else bodyFrame.refresh(400);
|
||||
setTimeout(function() {
|
||||
refreshA.addClass("layui-icon-refresh-1");
|
||||
refreshA.removeClass("layui-anim");
|
||||
refreshA.removeClass("layui-anim-rotate");
|
||||
refreshA.removeClass("layui-anim-loop");
|
||||
refreshA.removeClass("layui-icon-loading");
|
||||
}, 600)
|
||||
}
|
||||
|
||||
function collaspe() {
|
||||
@@ -297,11 +348,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
}
|
||||
|
||||
body.on("click", ".logout", function() {
|
||||
// 回调
|
||||
var result = logout();
|
||||
|
||||
if (result) {
|
||||
// 清空缓存
|
||||
if (logout()) {
|
||||
bodyTab.clear();
|
||||
}
|
||||
})
|
||||
@@ -323,7 +370,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
});
|
||||
|
||||
body.on("click", '[user-menu-id]', function() {
|
||||
if (config.tab.muiltTab) {
|
||||
if (isMuiltTab(config) === "true" || isMuiltTab(param) === true) {
|
||||
bodyTab.addTabOnly({
|
||||
id: $(this).attr("user-menu-id"),
|
||||
title: $(this).attr("user-menu-title"),
|
||||
@@ -332,13 +379,13 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
close: true
|
||||
}, 300);
|
||||
} else {
|
||||
bodyFrame.changePage($(this).attr("user-menu-url"), "", true);
|
||||
bodyFrame.changePage($(this).attr("user-menu-url"), true);
|
||||
}
|
||||
});
|
||||
|
||||
body.on("click", ".setting", function() {
|
||||
|
||||
var bgColorHtml =
|
||||
var menuItem =
|
||||
'<li class="layui-this" data-select-bgcolor="dark-theme" >' +
|
||||
'<a href="javascript:;" data-skin="skin-blue" style="" class="clearfix full-opacity-hover">' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 12px; background: #28333E;"></span><span style="display:block; width: 80%; float: left; height: 12px; background: white;"></span></div>' +
|
||||
@@ -346,7 +393,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
'</a>' +
|
||||
'</li>';
|
||||
|
||||
bgColorHtml +=
|
||||
menuItem +=
|
||||
'<li data-select-bgcolor="light-theme" >' +
|
||||
'<a href="javascript:;" data-skin="skin-blue" style="" class="clearfix full-opacity-hover">' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 12px; background: white;"></span><span style="display:block; width: 80%; float: left; height: 12px; background: white;"></span></div>' +
|
||||
@@ -354,11 +401,54 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
'</a>' +
|
||||
'</li>';
|
||||
|
||||
var html =
|
||||
var menuHtml =
|
||||
'<div class="pearone-color">\n' +
|
||||
'<div class="color-title">整体风格</div>\n' +
|
||||
'<div class="color-title">菜单风格</div>\n' +
|
||||
'<div class="color-content">\n' +
|
||||
'<ul>\n' + bgColorHtml + '</ul>\n' +
|
||||
'<ul>\n' + menuItem + '</ul>\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
|
||||
var headItem =
|
||||
'<li class="layui-this" data-select-header="light-theme" >' +
|
||||
'<a href="javascript:;" data-skin="skin-blue" style="" class="clearfix full-opacity-hover">' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 12px; background: #28333E;"></span><span style="display:block; width: 80%; float: left; height: 12px; background: white;"></span></div>' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 40px; background: #28333E;"></span><span style="display:block; width: 80%; float: left; height: 40px; background: #f4f5f7;"></span></div>' +
|
||||
'</a>' +
|
||||
'</li>';
|
||||
|
||||
headItem +=
|
||||
'<li data-select-header="dark-theme" >' +
|
||||
'<a href="javascript:;" data-skin="skin-blue" style="" class="clearfix full-opacity-hover">' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 12px; background: #28333E;"></span><span style="display:block; width: 80%; float: left; height: 12px; background: #28333E;"></span></div>' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 40px; background: #28333E;"></span><span style="display:block; width: 80%; float: left; height: 40px; background: #f4f5f7;"></span></div>' +
|
||||
'</a>' +
|
||||
'</li>';
|
||||
|
||||
var headHtml =
|
||||
'<div class="pearone-color">\n' +
|
||||
'<div class="color-title">顶部风格</div>\n' +
|
||||
'<div class="color-content">\n' +
|
||||
'<ul>\n' + headItem + '</ul>\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
|
||||
var moreItem =
|
||||
'<div class="layui-form-item"><div class="layui-input-inline"><input type="checkbox" name="control" lay-filter="control" lay-skin="switch" lay-text="开|关"></div><span class="set-text">菜单</span></div>';
|
||||
|
||||
moreItem +=
|
||||
'<div class="layui-form-item"><div class="layui-input-inline"><input type="checkbox" name="muilt-tab" lay-filter="muilt-tab" lay-skin="switch" lay-text="开|关"></div><span class="set-text">视图</span></div>';
|
||||
|
||||
moreItem +=
|
||||
'<div class="layui-form-item"><div class="layui-input-inline"><input type="checkbox" name="banner" lay-filter="banner" lay-skin="switch" lay-text="开|关"></div><span class="set-text">通栏</span></div>';
|
||||
|
||||
moreItem +=
|
||||
'<div class="layui-form-item"><div class="layui-input-inline"><input type="checkbox" name="auto-head" lay-filter="auto-head" lay-skin="switch" lay-text="开|关"></div><span class="set-text">通色</span></div>';
|
||||
|
||||
var moreHtml = '<br><div class="pearone-color">\n' +
|
||||
'<div class="color-title">更多设置</div>\n' +
|
||||
'<div class="color-content">\n' +
|
||||
'<form class="layui-form">\n' + moreItem + '</form>\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
|
||||
@@ -373,20 +463,30 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
anim: -1,
|
||||
skin: 'layer-anim-right',
|
||||
move: false,
|
||||
content: html + buildColorHtml() + buildLinkHtml() + bottomTool(),
|
||||
content: menuHtml + headHtml + buildColorHtml() + moreHtml + bottomTool(),
|
||||
success: function(layero, index) {
|
||||
|
||||
form.render();
|
||||
|
||||
var color = localStorage.getItem("theme-color");
|
||||
var menu = localStorage.getItem("theme-menu");
|
||||
var header = localStorage.getItem("theme-header");
|
||||
|
||||
if (color !== "null") {
|
||||
$(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok");
|
||||
$("*[color-id='" + color + "']").addClass("layui-icon").addClass("layui-icon-ok");
|
||||
}
|
||||
|
||||
if (menu !== "null") {
|
||||
$("*[data-select-bgcolor]").removeClass("layui-this");
|
||||
$("[data-select-bgcolor='" + menu + "']").addClass("layui-this");
|
||||
}
|
||||
|
||||
if (header !== "null") {
|
||||
$("*[data-select-header]").removeClass("layui-this");
|
||||
$("[data-select-header='" + header + "']").addClass("layui-this");
|
||||
}
|
||||
|
||||
$('#layui-layer-shade' + index).click(function() {
|
||||
var $layero = $('#layui-layer' + index);
|
||||
$layero.animate({
|
||||
@@ -404,6 +504,53 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
|
||||
form.on('switch(control)', function(data) {
|
||||
localStorage.setItem("control", this.checked);
|
||||
window.location.reload();
|
||||
})
|
||||
|
||||
form.on('switch(muilt-tab)', function(data) {
|
||||
localStorage.setItem("muilt-tab", this.checked);
|
||||
window.location.reload();
|
||||
})
|
||||
|
||||
form.on('switch(auto-head)', function(data) {
|
||||
localStorage.setItem("auto-head", this.checked);
|
||||
pearTheme.changeTheme(window, this.checked);
|
||||
})
|
||||
|
||||
form.on('switch(banner)', function(data) {
|
||||
localStorage.setItem("theme-banner", this.checked);
|
||||
pearAdmin.bannerSkin(this.checked);
|
||||
})
|
||||
|
||||
if (localStorage.getItem('theme-banner') === 'true') {
|
||||
$('input[name="banner"]').attr('checked', 'checked')
|
||||
} else {
|
||||
$('input[name="banner"]').removeAttr('checked')
|
||||
}
|
||||
|
||||
if (localStorage.getItem('control') === 'true') {
|
||||
$('input[name="control"]').attr('checked', 'checked')
|
||||
} else {
|
||||
$('input[name="control"]').removeAttr('checked')
|
||||
}
|
||||
|
||||
if (localStorage.getItem('muilt-tab') === 'true') {
|
||||
$('input[name="muilt-tab"]').attr('checked', 'checked')
|
||||
} else {
|
||||
$('input[name="muilt-tab"]').removeAttr('checked')
|
||||
}
|
||||
|
||||
if (localStorage.getItem('auto-head') === 'true') {
|
||||
$('input[name="auto-head"]').attr('checked', 'checked')
|
||||
} else {
|
||||
$('input[name="auto-head"]').removeAttr('checked')
|
||||
}
|
||||
|
||||
form.render('checkbox');
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -420,14 +567,23 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
pearAdmin.menuSkin(theme);
|
||||
});
|
||||
|
||||
body.on('click', '[data-select-header]', function() {
|
||||
var theme = $(this).attr('data-select-header');
|
||||
$('[data-select-header]').removeClass("layui-this");
|
||||
$(this).addClass("layui-this");
|
||||
localStorage.setItem("theme-header", theme);
|
||||
pearAdmin.headerSkin(theme);
|
||||
});
|
||||
|
||||
body.on('click', '.select-color-item', function() {
|
||||
$(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok");
|
||||
$(this).addClass("layui-icon").addClass("layui-icon-ok");
|
||||
var colorId = $(".select-color-item.layui-icon-ok").attr("color-id");
|
||||
var currentColor = getColorById(colorId);
|
||||
localStorage.setItem("theme-color", currentColor.id);
|
||||
localStorage.setItem("theme-color-context", currentColor.color);
|
||||
pearTheme.changeTheme(window, config.other.autoHead);
|
||||
localStorage.setItem("theme-color-color", currentColor.color);
|
||||
localStorage.setItem("theme-color-second", currentColor.second);
|
||||
pearTheme.changeTheme(window, isAutoHead(config));
|
||||
});
|
||||
|
||||
function applyConfig(param) {
|
||||
@@ -461,18 +617,6 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
return color;
|
||||
}
|
||||
|
||||
function buildLinkHtml() {
|
||||
var links = "";
|
||||
$.each(config.links, function(i, value) {
|
||||
// value.target 存在,则为新窗口打开,增加 target="_blank" 属性
|
||||
links += '<a class="more-menu-item" href="' + value.href + '" ' + (value.target ? ' target="_blank" ' : '') +
|
||||
'>' +
|
||||
'<i class="' + value.icon + '" style="font-size: 19px;"></i> ' + value.title +
|
||||
'</a>'
|
||||
})
|
||||
return '<div class="more-menu-list">' + links + '</div>';
|
||||
}
|
||||
|
||||
function buildColorHtml() {
|
||||
var colors = "";
|
||||
$.each(config.colors, function(i, value) {
|
||||
@@ -529,6 +673,42 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm
|
||||
document.webkitFullscreenElement || false;
|
||||
}
|
||||
|
||||
function isControl(option) {
|
||||
if (option.theme.allowCustom) {
|
||||
if (localStorage.getItem("control") != null) {
|
||||
return localStorage.getItem("control")
|
||||
} else {
|
||||
return option.menu.control
|
||||
}
|
||||
} else {
|
||||
return option.menu.control
|
||||
}
|
||||
}
|
||||
|
||||
function isAutoHead(option) {
|
||||
if(option.theme.allowCustom) {
|
||||
if(localStorage.getItem("auto-head") != null) {
|
||||
return localStorage.getItem("auto-head");
|
||||
} else {
|
||||
return option.other.autoHead;
|
||||
}
|
||||
} else {
|
||||
return option.other.autoHead;
|
||||
}
|
||||
}
|
||||
|
||||
function isMuiltTab(option) {
|
||||
if (option.theme.allowCustom) {
|
||||
if (localStorage.getItem("muilt-tab") != null) {
|
||||
return localStorage.getItem("muilt-tab")
|
||||
} else {
|
||||
return option.tab.enable
|
||||
}
|
||||
} else {
|
||||
return option.tab.enable
|
||||
}
|
||||
}
|
||||
|
||||
window.onresize = function() {
|
||||
if (!isFullscreen()) {
|
||||
$(".fullScreen").eq(0).removeClass("layui-icon-screen-restore");
|
||||
|
||||
@@ -21,7 +21,7 @@ layui.define(['jquery'], function(exports) {
|
||||
time: opt.time ? opt.time : false,
|
||||
done: opt.done ? opt.done : function(){}
|
||||
}
|
||||
var text = $(option.elem).text();
|
||||
var text = $(option.elem).html();
|
||||
|
||||
$(option.elem).html("<i class='layui-anim layui-anim-rotate layui-icon layui-anim-loop layui-icon-loading'/>");
|
||||
|
||||
|
||||
@@ -6,97 +6,262 @@ layui.define(['table', 'laypage','jquery', 'element'], function(exports) {
|
||||
element = layui.element,
|
||||
laypage = layui.laypage;
|
||||
|
||||
var pearCard = function(opt) {
|
||||
this.option = opt;
|
||||
var _instances = {}; // 记录所有实例
|
||||
|
||||
var defaultOption = {
|
||||
elem: "#currentTableId",// 构建的模型
|
||||
url: "",// 数据 url 连接
|
||||
loading: true,//是否加载
|
||||
limit: 0, //每页数量默认是每行数量的双倍
|
||||
linenum: 4, //每行数量 2,3,4,6
|
||||
currentPage: 1,//当前页
|
||||
data:[], //静态数据
|
||||
limits:[], //页码
|
||||
page: true, //是否分页
|
||||
layout: ['count', 'prev', 'page', 'next','limit', 'skip'],//分页控件
|
||||
request: {
|
||||
pageName: 'page' //页码的参数名称,默认:page
|
||||
, limitName: 'limit' //每页数据量的参数名,默认:limit
|
||||
, idName: 'id' //主键名称,默认:id
|
||||
, titleName: 'title' //标题名称,默认:title
|
||||
, imageName: 'image' //图片地址,默认:image
|
||||
, remarkName: 'remark' //备注名称,默认:remark
|
||||
, timeName: 'time' //时间名称,默认:time
|
||||
},
|
||||
response: {
|
||||
statusName: 'code' //规定数据状态的字段名称,默认:code
|
||||
, statusCode: 0 //规定成功的状态码,默认:0
|
||||
, msgName: 'msg' //规定状态信息的字段名称,默认:msg
|
||||
, countName: 'count' //规定数据总数的字段名称,默认:count
|
||||
, dataName: 'data' //规定数据列表的字段名称,默认:data
|
||||
},
|
||||
clickItem: function(data){},
|
||||
done: function () {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
pearCard.prototype.render = function(opt) {
|
||||
var option = {
|
||||
// 构建的模型
|
||||
elem: opt.elem,
|
||||
// 数据 url 连接
|
||||
url: opt.url,
|
||||
// lineSize 每行的个数
|
||||
lineSize: opt.lineSize ? opt.lineSize : 4,
|
||||
// 共多少个
|
||||
pageSize: opt.pageSize ? opt.pageSize : 12,
|
||||
// 当前页
|
||||
currentPage: opt.currentSize ? opt.currentSize : 0,
|
||||
// 完 成 函 数
|
||||
done: opt.done ? opt.done : function() {
|
||||
alert("跳转页面");
|
||||
var card = function(opt) {
|
||||
_instances[opt.elem.substring(1)] = this;
|
||||
this.reload(opt);
|
||||
};
|
||||
card.prototype.initOptions = function (opt) {
|
||||
this.option = $.extend(true, {}, defaultOption, opt);
|
||||
if (!this.option.limit || this.option.limit == 0) {
|
||||
this.option.limit = this.option.linenum * 2;
|
||||
}
|
||||
if (!this.option.limits || this.option.limits.length == 0) {
|
||||
this.option.limits = [this.option.limit];
|
||||
}
|
||||
// 根 据 请 求 方 式 获 取 数 据
|
||||
if (option.url != null) {
|
||||
// 复制数据
|
||||
option.data = getData(option.url).data;
|
||||
}
|
||||
|
||||
// 根据结果进行相应结构的创建
|
||||
var html = createComponent(option.data);
|
||||
};
|
||||
|
||||
card.prototype.init = function () {
|
||||
var option = this.option;
|
||||
var url = option.url;
|
||||
var html = "";
|
||||
html += option.loading == true ? '<div class="ew-table-loading">' : ' <div class="ew-table-loading layui-hide">';
|
||||
html += '<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>';
|
||||
html += '</div>';
|
||||
$(option.elem).html(html);
|
||||
html = "";
|
||||
if (!!url) {
|
||||
if (url.indexOf("?") >= 0) {
|
||||
url = url + '&v=1.0.0';
|
||||
}
|
||||
else {
|
||||
url = url + '?v=1.0.0';
|
||||
}
|
||||
if (!!option.page) {
|
||||
url = url + '&' + option.request.limitName + '=' + option.limit;
|
||||
url = url + '&' + option.request.pageName + '=' + option.currentPage;
|
||||
}
|
||||
if (!!option.where) {
|
||||
for (let key in option.where) {
|
||||
url = url + '&' + key + '=' + option.where[key];
|
||||
}
|
||||
}
|
||||
getData(url).then(function(data){
|
||||
data = initData(data, option);
|
||||
if (data.code != option.response.statusCode) {
|
||||
option.data = [];
|
||||
option.count = 0;
|
||||
} else {
|
||||
option.data = data.data;
|
||||
option.count = option.data.length;
|
||||
}
|
||||
|
||||
// 初始化分页组件
|
||||
if (!!option.data && option.data.length > 0) {
|
||||
html = createComponent(option.elem.substring(1), option.linenum, option.data);
|
||||
html += "<div id='cardpage'></div>";
|
||||
}
|
||||
else {
|
||||
html = "<p>没有数据</p>";
|
||||
}
|
||||
$(option.elem).html(html);
|
||||
if (option.page) {
|
||||
laypage.render({
|
||||
elem: 'cardpage'
|
||||
,count: 100
|
||||
,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
|
||||
,jump: function(obj){
|
||||
console.log(obj)
|
||||
, count: option.count, limit: option.limit, limits: option.limits, curr: option.currentPage
|
||||
, layout: option.layout
|
||||
, jump: function (obj, first) {
|
||||
option.limit = obj.limit;
|
||||
option.currentPage = obj.curr;
|
||||
if (!first) {
|
||||
_instances[option.elem.substring(1)].reload(option);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return new pearCard(option);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (!option.alldata) {
|
||||
option.alldata = option.data;
|
||||
}
|
||||
if (option.page) {
|
||||
var data = [];
|
||||
option.count = option.alldata.length;
|
||||
for (var i = (option.currentPage - 1) * option.limit; i < option.currentPage * option.limit && i<option.alldata.length; i++) {
|
||||
data.push(option.alldata[i]);
|
||||
}
|
||||
option.data = data;
|
||||
}
|
||||
if (!!option.data && option.data.length > 0) {
|
||||
html = createComponent(option.elem.substring(1), option.linenum, option.data);
|
||||
html += "<div id='cardpage'></div>";
|
||||
}
|
||||
else {
|
||||
html = "<p>没有数据</p>";
|
||||
}
|
||||
$(option.elem).html(html);
|
||||
if (option.page) {
|
||||
laypage.render({
|
||||
elem: 'cardpage'
|
||||
, count: option.count, limit: option.limit, limits: option.limits, curr: option.currentPage
|
||||
, layout: option.layout
|
||||
, jump: function (obj, first) {
|
||||
option.limit = obj.limit;
|
||||
option.currentPage = obj.curr;
|
||||
if (!first) {
|
||||
_instances[option.elem.substring(1)].reload(option);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createComponent(data) {
|
||||
var html = "<div class='pear-card-component'>"
|
||||
var content = createCards(data);
|
||||
var page = "<div id='cardpage'></div>"
|
||||
card.prototype.reload = function (opt) {
|
||||
this.initOptions(this.option ? $.extend(true, this.option, opt) : opt);
|
||||
this.init(); // 初始化表格
|
||||
}
|
||||
|
||||
function createComponent(elem,linenum,data) {
|
||||
var html = "<div class='cloud-card-component'>"
|
||||
var content = createCards(elem, linenum,data);
|
||||
var page = "";
|
||||
content = content + page;
|
||||
html += content + "</div>"
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
/** 创建指定数量的卡片 */
|
||||
function createCards(data) {
|
||||
|
||||
function createCards(elem, linenum,data) {
|
||||
var content = "<div class='layui-row layui-col-space30'>";
|
||||
$.each(data, function(i, item) {
|
||||
|
||||
content += createCard(item);
|
||||
|
||||
})
|
||||
content += "</div>"
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
content += createCard(elem, linenum,data[i],i);
|
||||
}
|
||||
content += "</div>";
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
/** 创建一个卡片 */
|
||||
function createCard(item) {
|
||||
|
||||
function createCard(elem, linenum, item, no) {
|
||||
var line = 12 / linenum;
|
||||
var card =
|
||||
'<div class="layui-col-md3 ew-datagrid-item" data-index="0" data-number="1"> <div class="project-list-item"> <img class="project-list-item-cover" src="'+item.image+'"> <div class="project-list-item-body"> <h2>'+item.title+'</h2> <div class="project-list-item-text layui-text">'+item.remark+'</div> <div class="project-list-item-desc"> <span class="time">'+item.time+'</span> <div class="ew-head-list"> <img class="ew-head-list-item" lay-tips="曲丽丽" lay-offset="0,-5px" src="https://gw.alipayobjects.com/zos/rmsportal/ZiESqWwCXBRQoaPONSJe.png"> <img class="ew-head-list-item" lay-tips="王昭君" lay-offset="0,-5px" src="https://gw.alipayobjects.com/zos/rmsportal/tBOxZPlITHqwlGjsJWaF.png"> <img class="ew-head-list-item" lay-tips="董娜娜" lay-offset="0,-5px" src="https://gw.alipayobjects.com/zos/rmsportal/sBxjgqiuHMGRkIjqlQCd.png"> </div> </div> </div> </div> </div>'
|
||||
|
||||
'<div id=' + item.id + ' onclick="cardTableCheckedCard(' + elem + ',this)" class="layui-col-md' + line + ' ew-datagrid-item" data-index="' + no+'" data-number="1"> <div class="project-list-item"> <img class="project-list-item-cover" src="' +item.image + '"> <div class="project-list-item-body"> <h2>' + item.title + '</h2> <div class="project-list-item-text layui-text">' + item.remark + '</div> <div class="project-list-item-desc"> <span class="time">' +item.time + '</span> <div class="ew-head-list"></div> </div> </div > </div > </div > '
|
||||
return card;
|
||||
}
|
||||
|
||||
/** 同 步 请 求 获 取 数 据 */
|
||||
function getData(url) {
|
||||
|
||||
$.ajaxSettings.async = false;
|
||||
var data = null;
|
||||
|
||||
$.get(url, function(result) {
|
||||
data = result;
|
||||
});
|
||||
|
||||
$.ajaxSettings.async = true;
|
||||
function initData(tempData, option) {
|
||||
var data = {};
|
||||
data.code = tempData[option.response.statusName];
|
||||
data.msg = tempData[option.response.msgName];
|
||||
data.count = tempData[option.response.countName];
|
||||
var dataList = tempData[option.response.dataName];
|
||||
data.data = [];
|
||||
for (var i = 0; i < dataList.length; i++) {
|
||||
var item = {};
|
||||
item.id = dataList[i][option.request.idName];
|
||||
item.image = dataList[i][option.request.imageName];
|
||||
item.title = dataList[i][option.request.titleName];
|
||||
item.remark = dataList[i][option.request.remarkName];
|
||||
item.time = dataList[i][option.request.timeName];
|
||||
data.data.push(item);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
exports(MOD_NAME, new pearCard());
|
||||
function getData(url) {
|
||||
var defer = $.Deferred();
|
||||
$.get(url + "?fresh=" + Math.random(), function(result) {
|
||||
defer.resolve(result)
|
||||
});
|
||||
return defer.promise();
|
||||
}
|
||||
|
||||
window.cardTableCheckedCard = function (elem,obj) {
|
||||
$(obj).addClass('layui-table-click').siblings().removeClass('layui-table-click');
|
||||
var item = {};
|
||||
item.id = obj.id;
|
||||
item.image = $(obj).find('.project-list-item-cover')[0].src;
|
||||
item.title = $(obj).find('h2')[0].innerHTML;
|
||||
item.remark = $(obj).find('.project-list-item-text')[0].innerHTML;
|
||||
item.time = $(obj).find('.time')[0].innerHTML;
|
||||
_instances[elem.id].option.checkedItem = item;
|
||||
_instances[elem.id].option.clickItem(item);
|
||||
}
|
||||
|
||||
/** 对外提供的方法 */
|
||||
var tt = {
|
||||
|
||||
render: function (options) {
|
||||
return new card(options);
|
||||
},
|
||||
|
||||
reload: function (id, opt) {
|
||||
_instances[id].option.checkedItem = null;
|
||||
_instances[id].reload(opt);
|
||||
},
|
||||
|
||||
getChecked: function (id) {
|
||||
var option = _instances[id].option;
|
||||
var data = option.checkedItem;
|
||||
var item = {};
|
||||
if (!data) {
|
||||
return null;
|
||||
}
|
||||
item[option.request.idName] = data.id;
|
||||
item[option.request.imageName] = data.image;
|
||||
item[option.request.titleName] = data.title;
|
||||
item[option.request.remarkName] = data.remark;
|
||||
item[option.request.timeName] = data.time;
|
||||
return item;
|
||||
},
|
||||
|
||||
getAllData: function (id) {
|
||||
var option = _instances[id].option;
|
||||
var data = [];
|
||||
for (var i = 0; i < option.data.length; i++) {
|
||||
var item = {};
|
||||
item[option.request.idName] = option.data[i].id;
|
||||
item[option.request.imageName] = option.data[i].image;
|
||||
item[option.request.titleName] = option.data[i].title;
|
||||
item[option.request.remarkName] = option.data[i].remark;
|
||||
item[option.request.timeName] = option.data[i].time;
|
||||
data.push(item);
|
||||
}
|
||||
return data;
|
||||
},
|
||||
}
|
||||
|
||||
exports(MOD_NAME, tt);
|
||||
})
|
||||
@@ -1,11 +1,3 @@
|
||||
/**
|
||||
*@Name dtree 树形组件
|
||||
*@Author 智慧的小西瓜
|
||||
*@DOCS http://www.wisdomelon.com/DTreeHelper/
|
||||
*@License https://www.layui.com/
|
||||
*@LASTTIME 2020/03/31
|
||||
*@VERSION v2.5.8
|
||||
*/
|
||||
layui.define(['jquery','layer','form'], function(exports) {
|
||||
var $ = layui.$,
|
||||
layer = layui.layer,
|
||||
|
||||
@@ -24,17 +24,16 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
||||
return new pearFrame(option);
|
||||
}
|
||||
|
||||
pearFrame.prototype.changePage = function(url,title,loading){
|
||||
pearFrame.prototype.changePage = function(url,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'});
|
||||
loading.fadeOut(500);
|
||||
},800)
|
||||
}
|
||||
}
|
||||
@@ -50,7 +49,7 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
||||
var loading = $("#"+elem).find(".pear-frame-loading");
|
||||
setTimeout(function(){
|
||||
loading.css({display:'none'});
|
||||
},800)
|
||||
},400)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +59,7 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
||||
loading.css({display:'block'});
|
||||
if(time!=0){
|
||||
setTimeout(function(){
|
||||
loading.css({display:'none'});
|
||||
loading.fadeOut(500);
|
||||
},time)
|
||||
}
|
||||
}
|
||||
@@ -68,14 +67,14 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
||||
}
|
||||
|
||||
function createFrameHTML(option){
|
||||
var header = "<div class='pear-frame-title'><div class='dot'></div><div class='title'>"+option.title+"</div></div>"
|
||||
var iframe = "<iframe class='pear-frame-content' style='width:100%;height:100%;' scrolling='auto' frameborder='0' src='"+option.url+"' ></iframe>";
|
||||
var loading = '<div class="pear-frame-loading">'+
|
||||
'<div class="ball-loader">'+
|
||||
'<span></span><span></span><span></span><span></span>'+
|
||||
'</div>'+
|
||||
'</div></div>';
|
||||
$("#"+option.elem).html("<div class='pear-frame'>"+header+iframe+loading+"</div>");
|
||||
$("#"+option.elem).html("<div class='pear-frame'>"+ iframe + loading +"</div>");
|
||||
}
|
||||
|
||||
exports(MOD_NAME,new pearFrame());
|
||||
})
|
||||
@@ -1,388 +0,0 @@
|
||||
layui.define(['laypage', 'form'], function (exports) {
|
||||
"use strict";
|
||||
|
||||
var IconPicker =function () {
|
||||
this.v = '1.1';
|
||||
}, _MOD = 'iconPicker',
|
||||
_this = this,
|
||||
$ = layui.jquery,
|
||||
laypage = layui.laypage,
|
||||
form = layui.form,
|
||||
BODY = 'body',
|
||||
TIPS = '请选择图标';
|
||||
|
||||
IconPicker.prototype.render = function(options){
|
||||
var opts = options,
|
||||
// DOM选择器
|
||||
elem = opts.elem,
|
||||
// 数据类型:fontClass/unicode
|
||||
type = opts.type == null ? 'fontClass' : opts.type,
|
||||
// 是否分页:true/false
|
||||
page = opts.page == null ? true : opts.page,
|
||||
// 每页显示数量
|
||||
limit = opts.limit == null ? 12 : opts.limit,
|
||||
// 是否开启搜索:true/false
|
||||
search = opts.search == null ? true : opts.search,
|
||||
// 每个图标格子的宽度:'43px'或'20%'
|
||||
cellWidth = opts.cellWidth,
|
||||
// 点击回调
|
||||
click = opts.click,
|
||||
// 渲染成功后的回调
|
||||
success = opts.success,
|
||||
// json数据
|
||||
data = {},
|
||||
// 唯一标识
|
||||
tmp = new Date().getTime(),
|
||||
// 是否使用的class数据
|
||||
isFontClass = opts.type === 'fontClass',
|
||||
// 初始化时input的值
|
||||
ORIGINAL_ELEM_VALUE = $(elem).val(),
|
||||
TITLE = 'layui-select-title',
|
||||
TITLE_ID = 'layui-select-title-' + tmp,
|
||||
ICON_BODY = 'layui-iconpicker-' + tmp,
|
||||
PICKER_BODY = 'layui-iconpicker-body-' + tmp,
|
||||
PAGE_ID = 'layui-iconpicker-page-' + tmp,
|
||||
LIST_BOX = 'layui-iconpicker-list-box',
|
||||
selected = 'layui-form-selected',
|
||||
unselect = 'layui-unselect';
|
||||
|
||||
var a = {
|
||||
init: function () {
|
||||
data = common.getData[type]();
|
||||
|
||||
a.hideElem().createSelect().createBody().toggleSelect();
|
||||
a.preventEvent().inputListen();
|
||||
common.loadCss();
|
||||
|
||||
if (success) {
|
||||
success(this.successHandle());
|
||||
}
|
||||
|
||||
return a;
|
||||
},
|
||||
successHandle: function(){
|
||||
var d = {
|
||||
options: opts,
|
||||
data: data,
|
||||
id: tmp,
|
||||
elem: $('#' + ICON_BODY)
|
||||
};
|
||||
return d;
|
||||
},
|
||||
/**
|
||||
* 隐藏elem
|
||||
*/
|
||||
hideElem: function () {
|
||||
$(elem).hide();
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 绘制select下拉选择框
|
||||
*/
|
||||
createSelect: function () {
|
||||
var oriIcon = '<i class="layui-icon">';
|
||||
|
||||
// 默认图标
|
||||
if(ORIGINAL_ELEM_VALUE === '') {
|
||||
if(isFontClass) {
|
||||
ORIGINAL_ELEM_VALUE = 'layui-icon-circle-dot';
|
||||
} else {
|
||||
ORIGINAL_ELEM_VALUE = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (isFontClass) {
|
||||
oriIcon = '<i class="layui-icon '+ ORIGINAL_ELEM_VALUE +'">';
|
||||
} else {
|
||||
oriIcon += ORIGINAL_ELEM_VALUE;
|
||||
}
|
||||
oriIcon += '</i>';
|
||||
|
||||
var selectHtml = '<div class="layui-iconpicker layui-unselect layui-form-select" id="'+ ICON_BODY +'">' +
|
||||
'<div class="'+ TITLE +'" id="'+ TITLE_ID +'">' +
|
||||
'<div class="layui-iconpicker-item">'+
|
||||
'<span class="layui-iconpicker-icon layui-unselect">' +
|
||||
oriIcon +
|
||||
'</span>'+
|
||||
'<i class="layui-edge"></i>' +
|
||||
'</div>'+
|
||||
'</div>' +
|
||||
'<div class="layui-anim layui-anim-upbit" style="">' +
|
||||
'123' +
|
||||
'</div>';
|
||||
$(elem).after(selectHtml);
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 展开/折叠下拉框
|
||||
*/
|
||||
toggleSelect: function () {
|
||||
var item = '#' + TITLE_ID + ' .layui-iconpicker-item,#' + TITLE_ID + ' .layui-iconpicker-item .layui-edge';
|
||||
a.event('click', item, function (e) {
|
||||
var $icon = $('#' + ICON_BODY);
|
||||
if ($icon.hasClass(selected)) {
|
||||
$icon.removeClass(selected).addClass(unselect);
|
||||
} else {
|
||||
// 隐藏其他picker
|
||||
$('.layui-form-select').removeClass(selected);
|
||||
// 显示当前picker
|
||||
$icon.addClass(selected).removeClass(unselect);
|
||||
}
|
||||
e.stopPropagation();
|
||||
});
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 绘制主体部分
|
||||
*/
|
||||
createBody: function () {
|
||||
// 获取数据
|
||||
var searchHtml = '';
|
||||
|
||||
if (search) {
|
||||
searchHtml = '<div class="layui-iconpicker-search">' +
|
||||
'<input class="layui-input">' +
|
||||
'<i class="layui-icon"></i>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
// 组合dom
|
||||
var bodyHtml = '<div class="layui-iconpicker-body" id="'+ PICKER_BODY +'">' +
|
||||
searchHtml +
|
||||
'<div class="'+ LIST_BOX +'"></div> '+
|
||||
'</div>';
|
||||
$('#' + ICON_BODY).find('.layui-anim').eq(0).html(bodyHtml);
|
||||
a.search().createList().check().page();
|
||||
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 绘制图标列表
|
||||
* @param text 模糊查询关键字
|
||||
* @returns {string}
|
||||
*/
|
||||
createList: function (text) {
|
||||
var d = data,
|
||||
l = d.length,
|
||||
pageHtml = '',
|
||||
listHtml = $('<div class="layui-iconpicker-list">')//'<div class="layui-iconpicker-list">';
|
||||
|
||||
// 计算分页数据
|
||||
var _limit = limit, // 每页显示数量
|
||||
_pages = l % _limit === 0 ? l / _limit : parseInt(l / _limit + 1), // 总计多少页
|
||||
_id = PAGE_ID;
|
||||
|
||||
// 图标列表
|
||||
var icons = [];
|
||||
|
||||
for (var i = 0; i < l; i++) {
|
||||
var obj = d[i];
|
||||
|
||||
// 判断是否模糊查询
|
||||
if (text && obj.indexOf(text) === -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 是否自定义格子宽度
|
||||
var style = '';
|
||||
if (cellWidth !== null) {
|
||||
style += ' style="width:' + cellWidth + '"';
|
||||
}
|
||||
|
||||
// 每个图标dom
|
||||
var icon = '<div class="layui-iconpicker-icon-item" title="'+ obj +'" '+ style +'>';
|
||||
if (isFontClass){
|
||||
icon += '<i class="layui-icon '+ obj +'"></i>';
|
||||
} else {
|
||||
icon += '<i class="layui-icon">'+ obj.replace('amp;', '') +'</i>';
|
||||
}
|
||||
icon += '</div>';
|
||||
|
||||
icons.push(icon);
|
||||
}
|
||||
|
||||
// 查询出图标后再分页
|
||||
l = icons.length;
|
||||
_pages = l % _limit === 0 ? l / _limit : parseInt(l / _limit + 1);
|
||||
for (var i = 0; i < _pages; i++) {
|
||||
// 按limit分块
|
||||
var lm = $('<div class="layui-iconpicker-icon-limit" id="layui-iconpicker-icon-limit-' + tmp + (i+1) +'">');
|
||||
|
||||
for (var j = i * _limit; j < (i+1) * _limit && j < l; j++) {
|
||||
lm.append(icons[j]);
|
||||
}
|
||||
|
||||
listHtml.append(lm);
|
||||
}
|
||||
|
||||
// 无数据
|
||||
if (l === 0) {
|
||||
listHtml.append('<p class="layui-iconpicker-tips">无数据</p>');
|
||||
}
|
||||
|
||||
// 判断是否分页
|
||||
if (page){
|
||||
$('#' + PICKER_BODY).addClass('layui-iconpicker-body-page');
|
||||
pageHtml = '<div class="layui-iconpicker-page" id="'+ PAGE_ID +'">' +
|
||||
'<div class="layui-iconpicker-page-count">' +
|
||||
'<span id="'+ PAGE_ID +'-current">1</span>/' +
|
||||
'<span id="'+ PAGE_ID +'-pages">'+ _pages +'</span>' +
|
||||
' (<span id="'+ PAGE_ID +'-length">'+ l +'</span>)' +
|
||||
'</div>' +
|
||||
'<div class="layui-iconpicker-page-operate">' +
|
||||
'<i class="layui-icon" id="'+ PAGE_ID +'-prev" data-index="0" prev></i> ' +
|
||||
'<i class="layui-icon" id="'+ PAGE_ID +'-next" data-index="2" next></i> ' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
$('#' + ICON_BODY).find('.layui-anim').find('.' + LIST_BOX).html('').append(listHtml).append(pageHtml);
|
||||
return a;
|
||||
},
|
||||
preventEvent: function() {
|
||||
var item = '#' + ICON_BODY + ' .layui-anim';
|
||||
a.event('click', item, function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
return a;
|
||||
},
|
||||
page: function () {
|
||||
var icon = '#' + PAGE_ID + ' .layui-iconpicker-page-operate .layui-icon';
|
||||
|
||||
$(icon).unbind('click');
|
||||
a.event('click', icon, function (e) {
|
||||
var elem = e.currentTarget,
|
||||
total = parseInt($('#' +PAGE_ID + '-pages').html()),
|
||||
isPrev = $(elem).attr('prev') !== undefined,
|
||||
// 按钮上标的页码
|
||||
index = parseInt($(elem).attr('data-index')),
|
||||
$cur = $('#' +PAGE_ID + '-current'),
|
||||
// 点击时正在显示的页码
|
||||
current = parseInt($cur.html());
|
||||
|
||||
// 分页数据
|
||||
if (isPrev && current > 1) {
|
||||
current=current-1;
|
||||
$(icon + '[prev]').attr('data-index', current);
|
||||
} else if (!isPrev && current < total){
|
||||
current=current+1;
|
||||
$(icon + '[next]').attr('data-index', current);
|
||||
}
|
||||
$cur.html(current);
|
||||
|
||||
// 图标数据
|
||||
$('#'+ ICON_BODY + ' .layui-iconpicker-icon-limit').hide();
|
||||
$('#layui-iconpicker-icon-limit-' + tmp + current).show();
|
||||
e.stopPropagation();
|
||||
});
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
search: function () {
|
||||
var item = '#' + PICKER_BODY + ' .layui-iconpicker-search .layui-input';
|
||||
a.event('input propertychange', item, function (e) {
|
||||
var elem = e.target,
|
||||
t = $(elem).val();
|
||||
a.createList(t);
|
||||
});
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 点击选中图标
|
||||
*/
|
||||
check: function () {
|
||||
var item = '#' + PICKER_BODY + ' .layui-iconpicker-icon-item';
|
||||
a.event('click', item, function (e) {
|
||||
var el = $(e.currentTarget).find('.layui-icon'),
|
||||
icon = '';
|
||||
if (isFontClass) {
|
||||
var clsArr = el.attr('class').split(/[\s\n]/),
|
||||
cls = clsArr[1],
|
||||
icon = cls;
|
||||
$('#' + TITLE_ID).find('.layui-iconpicker-item .layui-icon').html('').attr('class', clsArr.join(' '));
|
||||
} else {
|
||||
var cls = el.html(),
|
||||
icon = cls;
|
||||
$('#' + TITLE_ID).find('.layui-iconpicker-item .layui-icon').html(icon);
|
||||
}
|
||||
|
||||
$('#' + ICON_BODY).removeClass(selected).addClass(unselect);
|
||||
$(elem).val(icon).attr('value', icon);
|
||||
// 回调
|
||||
if (click) {
|
||||
click({
|
||||
icon: icon
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
return a;
|
||||
},
|
||||
// 监听原始input数值改变
|
||||
inputListen: function(){
|
||||
var el = $(elem);
|
||||
a.event('change', elem, function(){
|
||||
var value = el.val();
|
||||
})
|
||||
// el.change(function(){
|
||||
|
||||
// });
|
||||
return a;
|
||||
},
|
||||
event: function (evt, el, fn) {
|
||||
$(BODY).on(evt, el, fn);
|
||||
}
|
||||
};
|
||||
|
||||
var common = {
|
||||
/**
|
||||
* 加载样式表
|
||||
*/
|
||||
loadCss: function () {
|
||||
var css = '.layui-iconpicker {max-width: 280px;}.layui-iconpicker .layui-anim{display:none;width:280px;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #d2d2d2;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12);box-sizing:border-box;}.layui-iconpicker-item{border:1px solid #e6e6e6;width:90px;height:38px;border-radius:4px;cursor:pointer;position:relative;}.layui-iconpicker-icon{border-right:1px solid #e6e6e6;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:60px;height:100%;float:left;text-align:center;background:#fff;transition:all .3s;}.layui-iconpicker-icon i{line-height:38px;font-size:18px;}.layui-iconpicker-item > .layui-edge{left:70px;}.layui-iconpicker-item:hover{border-color:#D2D2D2!important;}.layui-iconpicker-item:hover .layui-iconpicker-icon{border-color:#D2D2D2!important;}.layui-iconpicker.layui-form-selected .layui-anim{display:block;}.layui-iconpicker-body{padding:6px;}.layui-iconpicker .layui-iconpicker-list{background-color:#fff;border:1px solid #ccc;border-radius:4px;}.layui-iconpicker .layui-iconpicker-icon-item{display:inline-block;width:21.1%;line-height:36px;text-align:center;cursor:pointer;vertical-align:top;height:36px;margin:4px;border:1px solid #ddd;border-radius:2px;transition:300ms;}.layui-iconpicker .layui-iconpicker-icon-item i.layui-icon{font-size:17px;}.layui-iconpicker .layui-iconpicker-icon-item:hover{background-color:#eee;border-color:#ccc;-webkit-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;-moz-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;box-shadow:0 0 2px #aaa,0 0 2px #fff inset;text-shadow:0 0 1px #fff;}.layui-iconpicker-search{position:relative;margin:0 0 6px 0;border:1px solid #e6e6e6;border-radius:2px;transition:300ms;}.layui-iconpicker-search:hover{border-color:#D2D2D2!important;}.layui-iconpicker-search .layui-input{cursor:text;display:inline-block;width:86%;border:none;padding-right:0;margin-top:1px;}.layui-iconpicker-search .layui-icon{position:absolute;top:11px;right:4%;}.layui-iconpicker-tips{text-align:center;padding:8px 0;cursor:not-allowed;}.layui-iconpicker-page{margin-top:6px;margin-bottom:-6px;font-size:12px;padding:0 2px;}.layui-iconpicker-page-count{display:inline-block;}.layui-iconpicker-page-operate{display:inline-block;float:right;cursor:default;}.layui-iconpicker-page-operate .layui-icon{font-size:12px;cursor:pointer;}.layui-iconpicker-body-page .layui-iconpicker-icon-limit{display:none;}.layui-iconpicker-body-page .layui-iconpicker-icon-limit:first-child{display:block;}';
|
||||
var $style = $('head').find('style[iconpicker]');
|
||||
if ($style.length === 0) {
|
||||
$('head').append('<style rel="stylesheet" iconpicker>'+css+'</style>');
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
getData: {
|
||||
fontClass: function () {
|
||||
var arr = ["layui-icon-rate-half","layui-icon-rate","layui-icon-rate-solid","layui-icon-cellphone","layui-icon-vercode","layui-icon-login-wechat","layui-icon-login-qq","layui-icon-login-weibo","layui-icon-password","layui-icon-username","layui-icon-refresh-3","layui-icon-auz","layui-icon-spread-left","layui-icon-shrink-right","layui-icon-snowflake","layui-icon-tips","layui-icon-note","layui-icon-home","layui-icon-senior","layui-icon-refresh","layui-icon-refresh-1","layui-icon-flag","layui-icon-theme","layui-icon-notice","layui-icon-website","layui-icon-console","layui-icon-face-surprised","layui-icon-set","layui-icon-template-1","layui-icon-app","layui-icon-template","layui-icon-praise","layui-icon-tread","layui-icon-male","layui-icon-female","layui-icon-camera","layui-icon-camera-fill","layui-icon-more","layui-icon-more-vertical","layui-icon-rmb","layui-icon-dollar","layui-icon-diamond","layui-icon-fire","layui-icon-return","layui-icon-location","layui-icon-read","layui-icon-survey","layui-icon-face-smile","layui-icon-face-cry","layui-icon-cart-simple","layui-icon-cart","layui-icon-next","layui-icon-prev","layui-icon-upload-drag","layui-icon-upload","layui-icon-download-circle","layui-icon-component","layui-icon-file-b","layui-icon-user","layui-icon-find-fill","layui-icon-loading","layui-icon-loading-1","layui-icon-add-1","layui-icon-play","layui-icon-pause","layui-icon-headset","layui-icon-video","layui-icon-voice","layui-icon-speaker","layui-icon-fonts-del","layui-icon-fonts-code","layui-icon-fonts-html","layui-icon-fonts-strong","layui-icon-unlink","layui-icon-picture","layui-icon-link","layui-icon-face-smile-b","layui-icon-align-left","layui-icon-align-right","layui-icon-align-center","layui-icon-fonts-u","layui-icon-fonts-i","layui-icon-tabs","layui-icon-radio","layui-icon-circle","layui-icon-edit","layui-icon-share","layui-icon-delete","layui-icon-form","layui-icon-cellphone-fine","layui-icon-dialogue","layui-icon-fonts-clear","layui-icon-layer","layui-icon-date","layui-icon-water","layui-icon-code-circle","layui-icon-carousel","layui-icon-prev-circle","layui-icon-layouts","layui-icon-util","layui-icon-templeate-1","layui-icon-upload-circle","layui-icon-tree","layui-icon-table","layui-icon-chart","layui-icon-chart-screen","layui-icon-engine","layui-icon-triangle-d","layui-icon-triangle-r","layui-icon-file","layui-icon-set-sm","layui-icon-add-circle","layui-icon-404","layui-icon-about","layui-icon-up","layui-icon-down","layui-icon-left","layui-icon-right","layui-icon-circle-dot","layui-icon-search","layui-icon-set-fill","layui-icon-group","layui-icon-friends","layui-icon-reply-fill","layui-icon-menu-fill","layui-icon-log","layui-icon-picture-fine","layui-icon-face-smile-fine","layui-icon-list","layui-icon-release","layui-icon-ok","layui-icon-help","layui-icon-chat","layui-icon-top","layui-icon-star","layui-icon-star-fill","layui-icon-close-fill","layui-icon-close","layui-icon-ok-circle","layui-icon-add-circle-fine"];
|
||||
return arr;
|
||||
},
|
||||
unicode: function () {
|
||||
return ["&#xe6c9;","&#xe67b;","&#xe67a;","&#xe678;","&#xe679;","&#xe677;","&#xe676;","&#xe675;","&#xe673;","&#xe66f;","&#xe9aa;","&#xe672;","&#xe66b;","&#xe668;","&#xe6b1;","&#xe702;","&#xe66e;","&#xe68e;","&#xe674;","&#xe669;","&#xe666;","&#xe66c;","&#xe66a;","&#xe667;","&#xe7ae;","&#xe665;","&#xe664;","&#xe716;","&#xe656;","&#xe653;","&#xe663;","&#xe6c6;","&#xe6c5;","&#xe662;","&#xe661;","&#xe660;","&#xe65d;","&#xe65f;","&#xe671;","&#xe65e;","&#xe659;","&#xe735;","&#xe756;","&#xe65c;","&#xe715;","&#xe705;","&#xe6b2;","&#xe6af;","&#xe69c;","&#xe698;","&#xe657;","&#xe65b;","&#xe65a;","&#xe681;","&#xe67c;","&#xe601;","&#xe857;","&#xe655;","&#xe770;","&#xe670;","&#xe63d;","&#xe63e;","&#xe654;","&#xe652;","&#xe651;","&#xe6fc;","&#xe6ed;","&#xe688;","&#xe645;","&#xe64f;","&#xe64e;","&#xe64b;","&#xe62b;","&#xe64d;","&#xe64a;","&#xe64c;","&#xe650;","&#xe649;","&#xe648;","&#xe647;","&#xe646;","&#xe644;","&#xe62a;","&#xe643;","&#xe63f;","&#xe642;","&#xe641;","&#xe640;","&#xe63c;","&#xe63b;","&#xe63a;","&#xe639;","&#xe638;","&#xe637;","&#xe636;","&#xe635;","&#xe634;","&#xe633;","&#xe632;","&#xe631;","&#xe630;","&#xe62f;","&#xe62e;","&#xe62d;","&#xe62c;","&#xe629;","&#xe628;","&#xe625;","&#xe623;","&#xe621;","&#xe620;","&#xe61f;","&#xe61c;","&#xe60b;","&#xe619;","&#xe61a;","&#xe603;","&#xe602;","&#xe617;","&#xe615;","&#xe614;","&#xe613;","&#xe612;","&#xe611;","&#xe60f;","&#xe60e;","&#xe60d;","&#xe60c;","&#xe60a;","&#xe609;","&#xe605;","&#xe607;","&#xe606;","&#xe604;","&#xe600;","&#xe658;","&#x1007;","&#x1006;","&#x1005;","&#xe608;"];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
a.init();
|
||||
return new IconPicker();
|
||||
};
|
||||
|
||||
/**
|
||||
* 选中图标
|
||||
* @param filter lay-filter
|
||||
* @param iconName 图标名称,自动识别fontClass/unicode
|
||||
*/
|
||||
IconPicker.prototype.checkIcon = function (filter, iconName){
|
||||
var el = $('*[lay-filter='+ filter +']'),
|
||||
p = el.next().find('.layui-iconpicker-item .layui-icon'),
|
||||
c = iconName;
|
||||
|
||||
if (c.indexOf('#xe') > 0){
|
||||
p.html(c);
|
||||
} else {
|
||||
p.html('').attr('class', 'layui-icon ' + c);
|
||||
}
|
||||
el.attr('value', c).val(c);
|
||||
};
|
||||
|
||||
var iconPicker = new IconPicker();
|
||||
exports(_MOD, iconPicker);
|
||||
});
|
||||
@@ -277,13 +277,16 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
|
||||
'" class="layui-this layui-nav-item"><a href="#">' + item.title + '</a></li>';
|
||||
menuItem = '<ul pear-id="' + item.id + '" lay-filter="' + option.elem +
|
||||
'" 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>';
|
||||
} 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">';
|
||||
|
||||
|
||||
@@ -56,15 +56,14 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
|
||||
|
||||
function createHtml(option) {
|
||||
|
||||
var notice = '<li class="layui-nav-item" lay-unselect="">' +
|
||||
'<a href="#" class="notice layui-icon layui-icon-notice"><span class="layui-badge-dot"></span></a>' +
|
||||
'<div class="layui-nav-child layui-tab pear-notice" style="margin-top: 0px;;left: -200px;">';
|
||||
|
||||
var count = 0;
|
||||
var noticeTitle = '<ul class="layui-tab-title">';
|
||||
var noticeContent = '<div class="layui-tab-content" style="height:' + option.height + ';overflow-x: hidden;">';
|
||||
|
||||
|
||||
// 根据 data 便利数据
|
||||
$.each(option.data, function(i, item) {
|
||||
|
||||
if (i === 0) {
|
||||
noticeTitle += '<li class="pear-this">' + item.title + '</li>';
|
||||
noticeContent += '<div class="layui-tab-item layui-show">';
|
||||
@@ -76,14 +75,18 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
|
||||
$.each(item.children, function(i, note) {
|
||||
noticeContent += '<div class="pear-notice-item" notice-form="' + note.form + '" notice-context="' + note.context +
|
||||
'" notice-title="' + note.title + '" notice-id="' + note.id + '">' +
|
||||
'<img src="' + note.avatar + '">' +
|
||||
'<span>' + note.title + '</span>' +
|
||||
'<span>' + note.time + '</span>' +
|
||||
'<img src="' + note.avatar + '"/>' +
|
||||
'<div style="display:inline-block;">' + note.title + '</div>'+
|
||||
'<div class="pear-notice-end">' + note.time + '</div>' +
|
||||
'</div>';
|
||||
})
|
||||
noticeContent += '</div>';
|
||||
})
|
||||
|
||||
var notice = '<li class="layui-nav-item" lay-unselect="">' +
|
||||
'<a href="#" class="notice layui-icon layui-icon-notice"><span class="layui-badge-dot"></div></a>' +
|
||||
'<div class="layui-nav-child layui-tab pear-notice" style="margin-top: 0px;;left: -200px;">';
|
||||
|
||||
noticeTitle += '</ul>';
|
||||
noticeContent += '</div>';
|
||||
notice += noticeTitle;
|
||||
|
||||
@@ -13,7 +13,7 @@ layui.define(['jquery', 'element'], function(exports) {
|
||||
var tabDataCurrent = 0;
|
||||
|
||||
pearTab.prototype.render = function(opt) {
|
||||
//默认配置值
|
||||
|
||||
var option = {
|
||||
elem: opt.elem,
|
||||
data: opt.data,
|
||||
@@ -28,9 +28,7 @@ layui.define(['jquery', 'element'], function(exports) {
|
||||
success: opt.success ? opt.success : function(id) {}
|
||||
}
|
||||
|
||||
// 初始化,检索 session 是否开启
|
||||
if (option.session) {
|
||||
// 替换 opt.data 数据
|
||||
if (sessionStorage.getItem(option.elem + "-pear-tab-data") != null) {
|
||||
tabData = JSON.parse(sessionStorage.getItem(option.elem + "-pear-tab-data"));
|
||||
option.data = JSON.parse(sessionStorage.getItem(option.elem + "-pear-tab-data"));
|
||||
@@ -45,7 +43,6 @@ layui.define(['jquery', 'element'], function(exports) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var lastIndex;
|
||||
var tab = createTab(option);
|
||||
$("#" + option.elem).html(tab);
|
||||
@@ -66,7 +63,7 @@ layui.define(['jquery', 'element'], function(exports) {
|
||||
|
||||
option.success(sessionStorage.getItem(option.elem + "-pear-tab-data-current"));
|
||||
|
||||
$("body .layui-tab[lay-filter='" + option.elem + "']").on("contextmenu", "li", function(e) {
|
||||
$("body .layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title").on("contextmenu", "li", function(e) {
|
||||
|
||||
// 获取当前元素位置
|
||||
var top = e.clientY;
|
||||
@@ -302,21 +299,22 @@ layui.define(['jquery', 'element'], function(exports) {
|
||||
sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id);
|
||||
} else {
|
||||
var isData = false;
|
||||
//查询当前选项卡数量
|
||||
if ($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]").length >= this.option.tabMax) {
|
||||
layer.msg("最多打开" + this.option.tabMax + "个标签页", {
|
||||
icon: 2,
|
||||
time: 1000,
|
||||
shift: 6 //抖动效果
|
||||
});
|
||||
return false;
|
||||
}
|
||||
$.each($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]"), function() {
|
||||
if ($(this).attr("lay-id") == opt.id) {
|
||||
isData = true;
|
||||
}
|
||||
})
|
||||
if (isData == false) {
|
||||
|
||||
if ($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]").length >= this.option.tabMax) {
|
||||
layer.msg("最多打开" + this.option.tabMax + "个标签页", {
|
||||
icon: 2,
|
||||
time: 1000,
|
||||
shift: 6
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (time != false && time != 0) {
|
||||
var load = '<div id="pear-tab-loading' + index + '" class="pear-tab-loading">' +
|
||||
'<div class="ball-loader">' +
|
||||
|
||||
@@ -11,7 +11,7 @@ layui.define('jquery', function(exports){
|
||||
DEFAULT_SKIN ='layui-btn layui-btn-primary layui-btn-sm'
|
||||
,tag = function(){
|
||||
this.config = {
|
||||
likeHref:'../../modules/tag.css',
|
||||
likeHref:'../css/module/tag.css',
|
||||
skin: DEFAULT_SKIN,
|
||||
tagText:'+ New Tag'
|
||||
};
|
||||
|
||||
@@ -7,8 +7,9 @@ layui.define(["jquery","layer"], function (exports) {
|
||||
|
||||
theme.changeTheme = function (target, autoHead) {
|
||||
this.autoHead = autoHead;
|
||||
const color = localStorage.getItem("theme-color-context");
|
||||
this.colorSet(color);
|
||||
const color = localStorage.getItem("theme-color-color");
|
||||
const second = localStorage.getItem("theme-color-second");
|
||||
this.colorSet(color, second);
|
||||
if (target.frames.length == 0) return;
|
||||
for (var i = 0; i < target.frames.length; i++) {
|
||||
try {
|
||||
@@ -21,7 +22,7 @@ layui.define(["jquery","layer"], function (exports) {
|
||||
}
|
||||
}
|
||||
|
||||
theme.colorSet = function(color) {
|
||||
theme.colorSet = function(color, second) {
|
||||
|
||||
let style = '';
|
||||
style += '.light-theme .pear-nav-tree .layui-this a:hover,.light-theme .pear-nav-tree .layui-this,.light-theme .pear-nav-tree .layui-this a,.pear-nav-tree .layui-this a,.pear-nav-tree .layui-this{background-color: ' +color + '!important;}';
|
||||
@@ -33,15 +34,12 @@ layui.define(["jquery","layer"], function (exports) {
|
||||
style += '.layui-header .layui-nav-child .layui-this a{background-color:' + color +'!important;color:white!important;}';
|
||||
style += '#preloader{background-color:' + color + '!important;}';
|
||||
style += '.pearone-color .color-content li.layui-this:after, .pearone-color .color-content li:hover:after {border: ' +color + ' 3px solid!important;}';
|
||||
style += '.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{background-color:' + color + '!important}';
|
||||
style += '.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{background-color:' + color + ';color:white;}';
|
||||
style += '.pear-social-entrance {background-color:' + color + '!important}';
|
||||
style += '.pear-admin .pe-collaspe {background-color:' + color + '!important}';
|
||||
style += '.layui-fixbar li {background-color:' + color + '!important}';
|
||||
if(this.autoHead){
|
||||
style += '.pear-admin .layui-header{background-color:' + color + '!important;}.pear-admin .layui-header .layui-nav .layui-nav-item>a{color:white!important;}';
|
||||
}
|
||||
style += '.pear-btn-primary {background-color:' + color + '!important}';
|
||||
style += '.layui-input:focus,.layui-textarea:focus {border-color: '+ color +'!important;}'
|
||||
style += '.layui-input:focus,.layui-textarea:focus {border-color: '+ color +'!important;box-shadow: 0 0 0 3px '+ second +' !important;}'
|
||||
style += '.layui-form-checked[lay-skin=primary] i {border-color: '+ color +'!important;background-color: ' + color + ';}'
|
||||
style += '.layui-form-onswitch { border-color: ' + color + '; background-color: '+color+';}'
|
||||
style += '.layui-form-radio>i:hover, .layui-form-radioed>i {color: ' + color + ';}'
|
||||
@@ -70,10 +68,20 @@ layui.define(["jquery","layer"], function (exports) {
|
||||
style += '.layui-form-checkbox[lay-skin=primary]:hover i{border-color:'+color+'!important}'
|
||||
style += '.pear-tab-menu .item:hover{background-color:'+color+'!important}'
|
||||
style += '.layui-form-danger:focus {border-color:#FF5722 !important}'
|
||||
style += '.pear-admin .user a:hover{color:'+color+'!important}'
|
||||
style += '.pear-admin .user .layui-this a:hover{color:white!important}'
|
||||
style += '.pear-notice .layui-this{color:'+color+'!important}'
|
||||
style += '.layui-form-radio:hover *, .layui-form-radioed, .layui-form-radioed>i{color:' + color + ' !important}';
|
||||
style += '.pear-btn:hover {color: '+color+';background-color: ' + second + ';}'
|
||||
style += '.pear-btn-primary[plain] {color: '+ color +' !important;background: ' + second + ' !important;}'
|
||||
style += '.pear-btn-primary[plain]:hover {background-color: ' + color + '!important}'
|
||||
style += '.light-theme .pear-nav-tree .layui-this a:hover,.light-theme .pear-nav-tree .layui-this,.light-theme .pear-nav-tree .layui-this a {background-color:'+second+'!important;color:'+color+'!important;}'
|
||||
style += '.light-theme .pear-nav-tree .layui-this{ border-right: 3px solid '+color+'!important}'
|
||||
style += '.loader:after {background:'+color+'}'
|
||||
if(this.autoHead === true || this.autoHead === "true"){
|
||||
style += '.pear-admin.banner-layout .layui-header .layui-logo,.pear-admin .layui-header{border:none;background-color:' + color + '!important;}.pear-admin.banner-layout .layui-header .layui-logo .title,.pear-admin .layui-header .layui-nav .layui-nav-item>a{color:whitesmoke!important;}';
|
||||
style += '.pear-admin.banner-layout .layui-header{ box-shadow: 2px 0 6px rgb(0 21 41 / 35%) }'
|
||||
style += '.pear-admin .layui-header .layui-layout-control .layui-this *,.pear-admin.banner-layout .layui-header .layui-layout-control .layui-this *{ background-color: rgba(0,0,0,.1)!important;}'
|
||||
}
|
||||
var colorPane = $("#pear-admin-color");
|
||||
if(colorPane.length>0){
|
||||
colorPane.html(style);
|
||||
|
||||
@@ -112,9 +112,9 @@ layui.define(['jquery'],function (exports) {
|
||||
|
||||
option.quickbars_selection_toolbar = isset(option.quickbars_selection_toolbar) ? option.quickbars_selection_toolbar : 'cut copy | bold italic underline strikethrough '
|
||||
|
||||
option.plugins = isset(option.plugins) ? option.plugins : 'code quickbars print preview searchreplace autolink fullscreen image link media codesample table charmap hr advlist lists wordcount imagetools indent2em';
|
||||
option.plugins = isset(option.plugins) ? option.plugins : 'code kityformula-editor quickbars print preview searchreplace autolink fullscreen image link media codesample table charmap hr advlist lists wordcount imagetools indent2em';
|
||||
|
||||
option.toolbar = isset(option.toolbar) ? option.toolbar : 'code undo redo | forecolor backcolor bold italic underline strikethrough | indent2em alignleft aligncenter alignright alignjustify outdent indent | link bullist numlist image table codesample | formatselect fontselect fontsizeselect';
|
||||
option.toolbar = isset(option.toolbar) ? option.toolbar : 'code undo redo | kityformula-editor forecolor backcolor bold italic underline strikethrough | indent2em alignleft aligncenter alignright alignjustify outdent indent | link bullist numlist image table codesample | formatselect fontselect fontsizeselect';
|
||||
|
||||
option.resize = isset(option.resize) ? option.resize : false;
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
|
||||
<path d="M0.672,33.603c-0.432,0-0.648,0-0.648-0.264c0-0.024,0-0.144,0.24-0.432l12.433-14.569L0,0.96c0-0.264,0-0.72,0.024-0.792 C0.096,0.024,0.12,0,0.672,0h28.371l2.904,6.745h-0.6C30.531,4.8,28.898,3.72,28.298,3.336c-1.896-1.2-3.984-1.608-5.28-1.8 c-0.216-0.048-2.4-0.384-5.617-0.384H4.248l11.185,15.289c0.168,0.24,0.168,0.312,0.168,0.36c0,0.12-0.048,0.192-0.216,0.384 L3.168,31.515h14.474c4.608,0,6.96-0.624,7.464-0.744c2.76-0.72,5.305-2.352,6.241-4.848h0.6l-2.904,7.681H0.672z" fill="black"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 571 B |
@@ -0,0 +1,111 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<link rel="stylesheet" href="kityformula/assets/styles/base.css">
|
||||
<link rel="stylesheet" href="kityformula/assets/styles/ui.css">
|
||||
<link rel="stylesheet" href="kityformula/assets/styles/scrollbar.css">
|
||||
<style>
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.kf-editor {
|
||||
width: 780px;
|
||||
height: 380px;
|
||||
}
|
||||
#loading {
|
||||
height: 32px;
|
||||
width: 340px;
|
||||
line-height: 32px;
|
||||
position: absolute;
|
||||
top: 42%;
|
||||
left: 50%;
|
||||
margin-left: -170px;
|
||||
font-family: arial, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
|
||||
}
|
||||
#loading img {
|
||||
position: absolute;
|
||||
}
|
||||
#loading p {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 40px;
|
||||
top: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="kfEditorContainer" class="kf-editor">
|
||||
<div id="tips" class="tips">
|
||||
sorry! Beta版本仅支持IE9及以上版本的浏览器,正式版本将会支持低版本浏览器,谢谢您的关注!
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="kityformula/js/jquery-3.6.0.min.js"></script>
|
||||
<script src="kityformula/js/kitygraph.all.js"></script>
|
||||
<script src="kityformula/js/kity-formula-render.all.js"></script>
|
||||
<script src="kityformula/js/kity-formula-parser.all.min.js"></script>
|
||||
<script src="kityformula/js/kityformula-editor.all.min.js"></script>
|
||||
<script>
|
||||
//获取url地址栏传参
|
||||
function getQueryVariable(variable){
|
||||
var query = window.location.search.substring(1);
|
||||
var vars = query.split("&");
|
||||
for (var i=0;i<vars.length;i++) {
|
||||
var pair = vars[i].split("=");
|
||||
if(pair[0] == variable){return pair[1];}
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
//处理TinyMCE编辑器的事件
|
||||
window.addEventListener('message', function (event) {
|
||||
var data = event.data;
|
||||
kfe.execCommand('get.image.data', function(data){
|
||||
var latex = kfe.execCommand('get.source');
|
||||
window.parent.postMessage({
|
||||
mceAction: 'insertContent',
|
||||
content: "<img src=\""+data.img+"\" data-latex=\""+latex+"\">"
|
||||
}, '*');
|
||||
window.parent.postMessage({
|
||||
mceAction: 'close'
|
||||
}, '*');
|
||||
});
|
||||
});
|
||||
//实例化编辑器
|
||||
jQuery( function ($) {
|
||||
if ( document.body.addEventListener ) {
|
||||
$( "#tips").html('<div id="loading"><img src="kityformula/loading.gif" alt="loading" /><p>正在加载,请耐心等待...</p></div>' );
|
||||
var factory = kf.EditorFactory.create( $( "#kfEditorContainer" )[ 0 ], {
|
||||
render: {
|
||||
fontsize: 24
|
||||
},
|
||||
resource: {
|
||||
path: "./kityformula/resource/"
|
||||
}
|
||||
} );
|
||||
factory.ready( function ( KFEditor ) {
|
||||
$( "#tips").remove();
|
||||
//处理地址栏的参数并加载到编辑器中
|
||||
var c=getQueryVariable("c")
|
||||
if(c){
|
||||
this.execCommand( "render",decodeURIComponent(c) );
|
||||
}else{
|
||||
this.execCommand( "render","\\placeholder" );
|
||||
};
|
||||
|
||||
this.execCommand( "focus" );
|
||||
window.kfe = this;
|
||||
} );
|
||||
} else {
|
||||
$( "#tips").css( "color", "black" );
|
||||
$( "#tips").css( "padding", "10px" );
|
||||
}
|
||||
} );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 925 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 945 B |
|
After Width: | Height: | Size: 1003 B |
|
After Width: | Height: | Size: 926 B |
|
After Width: | Height: | Size: 926 B |
|
After Width: | Height: | Size: 996 B |
|
After Width: | Height: | Size: 926 B |
|
After Width: | Height: | Size: 938 B |
|
After Width: | Height: | Size: 982 B |
|
After Width: | Height: | Size: 994 B |
|
After Width: | Height: | Size: 941 B |
|
After Width: | Height: | Size: 983 B |
|
After Width: | Height: | Size: 988 B |
|
After Width: | Height: | Size: 559 B |
|
After Width: | Height: | Size: 519 B |
|
After Width: | Height: | Size: 317 B |
|
After Width: | Height: | Size: 874 B |
|
After Width: | Height: | Size: 371 B |
|
After Width: | Height: | Size: 305 B |
|
After Width: | Height: | Size: 467 B |
|
After Width: | Height: | Size: 552 B |
|
After Width: | Height: | Size: 239 B |
|
After Width: | Height: | Size: 492 B |
|
After Width: | Height: | Size: 364 B |
|
After Width: | Height: | Size: 516 B |
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 571 B |
|
After Width: | Height: | Size: 573 B |
|
After Width: | Height: | Size: 546 B |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 524 B |
|
After Width: | Height: | Size: 337 B |
|
After Width: | Height: | Size: 351 B |
|
After Width: | Height: | Size: 347 B |
|
After Width: | Height: | Size: 338 B |
|
After Width: | Height: | Size: 255 B |
|
After Width: | Height: | Size: 268 B |
|
After Width: | Height: | Size: 190 B |
|
After Width: | Height: | Size: 191 B |
|
After Width: | Height: | Size: 252 B |
|
After Width: | Height: | Size: 259 B |
|
After Width: | Height: | Size: 186 B |
|
After Width: | Height: | Size: 187 B |
|
After Width: | Height: | Size: 269 B |
|
After Width: | Height: | Size: 309 B |
|
After Width: | Height: | Size: 294 B |
|
After Width: | Height: | Size: 268 B |
|
After Width: | Height: | Size: 346 B |
|
After Width: | Height: | Size: 269 B |
|
After Width: | Height: | Size: 297 B |
|
After Width: | Height: | Size: 285 B |
|
After Width: | Height: | Size: 332 B |
|
After Width: | Height: | Size: 339 B |
|
After Width: | Height: | Size: 254 B |