parent
76c6e6943e
commit
3b75c8b5ad
@ -1,10 +1,37 @@
|
||||
{
|
||||
"status":{"code":200,"message":"操作成功"},
|
||||
"data": [
|
||||
{"id":"001","title": "湖南省","checkArr": "0","parentId": "0"},
|
||||
{"id":"002","title": "湖北省","checkArr": "0","parentId": "0"},
|
||||
{"id":"003","title": "广东省","checkArr": "0","parentId": "0"},
|
||||
{"id":"004","title": "浙江省","checkArr": "0","parentId": "0"},
|
||||
{"id":"005","title": "福建省","checkArr": "0","parentId": "0"}
|
||||
]
|
||||
}
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "操作成功"
|
||||
},
|
||||
"data": [{
|
||||
"id": "001",
|
||||
"title": "湖南省",
|
||||
"checkArr": "0",
|
||||
"parentId": "0"
|
||||
},
|
||||
{
|
||||
"id": "002",
|
||||
"title": "湖北省",
|
||||
"checkArr": "0",
|
||||
"parentId": "0"
|
||||
},
|
||||
{
|
||||
"id": "003",
|
||||
"title": "广东省",
|
||||
"checkArr": "0",
|
||||
"parentId": "0"
|
||||
},
|
||||
{
|
||||
"id": "004",
|
||||
"title": "浙江省",
|
||||
"checkArr": "0",
|
||||
"parentId": "0"
|
||||
},
|
||||
{
|
||||
"id": "005",
|
||||
"title": "福建省",
|
||||
"checkArr": "0",
|
||||
"parentId": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,181 +1,181 @@
|
||||
{
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "操作成功"
|
||||
},
|
||||
"data": [{
|
||||
"id": "001",
|
||||
"title": "湖南省",
|
||||
"parentId": "0",
|
||||
"children": [{
|
||||
"id": "001001",
|
||||
"title": "长沙市",
|
||||
"last": true,
|
||||
"parentId": "001"
|
||||
},
|
||||
{
|
||||
"id": "001002",
|
||||
"title": "株洲市",
|
||||
"last": true,
|
||||
"parentId": "001"
|
||||
},
|
||||
{
|
||||
"id": "001003",
|
||||
"title": "湘潭市",
|
||||
"last": true,
|
||||
"parentId": "001"
|
||||
},
|
||||
{
|
||||
"id": "001004",
|
||||
"title": "衡阳市",
|
||||
"last": true,
|
||||
"parentId": "001"
|
||||
},
|
||||
{
|
||||
"id": "001005",
|
||||
"title": "郴州市",
|
||||
"last": true,
|
||||
"parentId": "001"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "002",
|
||||
"title": "湖北省",
|
||||
"parentId": "0",
|
||||
"children": [{
|
||||
"id": "002001",
|
||||
"title": "武汉市",
|
||||
"last": true,
|
||||
"parentId": "002"
|
||||
},
|
||||
{
|
||||
"id": "002002",
|
||||
"title": "黄冈市",
|
||||
"last": true,
|
||||
"parentId": "002"
|
||||
},
|
||||
{
|
||||
"id": "002003",
|
||||
"title": "潜江市",
|
||||
"last": true,
|
||||
"parentId": "002"
|
||||
},
|
||||
{
|
||||
"id": "002004",
|
||||
"title": "荆州市",
|
||||
"last": true,
|
||||
"parentId": "002"
|
||||
},
|
||||
{
|
||||
"id": "002005",
|
||||
"title": "襄阳市",
|
||||
"last": true,
|
||||
"parentId": "002"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "003",
|
||||
"title": "广东省",
|
||||
"parentId": "0",
|
||||
"children": [{
|
||||
"id": "003001",
|
||||
"title": "广州市",
|
||||
"last": false,
|
||||
"parentId": "003",
|
||||
"children": [{
|
||||
"id": "003001001",
|
||||
"title": "天河区",
|
||||
"last": true,
|
||||
"parentId": "003001"
|
||||
},
|
||||
{
|
||||
"id": "003001002",
|
||||
"title": "花都区",
|
||||
"last": true,
|
||||
"parentId": "003001"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "003002",
|
||||
"title": "深圳市",
|
||||
"last": true,
|
||||
"parentId": "003"
|
||||
},
|
||||
{
|
||||
"id": "003003",
|
||||
"title": "中山市",
|
||||
"last": true,
|
||||
"parentId": "003"
|
||||
},
|
||||
{
|
||||
"id": "003004",
|
||||
"title": "东莞市",
|
||||
"last": true,
|
||||
"parentId": "003"
|
||||
},
|
||||
{
|
||||
"id": "003005",
|
||||
"title": "珠海市",
|
||||
"last": true,
|
||||
"parentId": "003"
|
||||
},
|
||||
{
|
||||
"id": "003006",
|
||||
"title": "韶关市",
|
||||
"last": true,
|
||||
"parentId": "003"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "004",
|
||||
"title": "浙江省",
|
||||
"parentId": "0",
|
||||
"children": [{
|
||||
"id": "004001",
|
||||
"title": "杭州市",
|
||||
"last": true,
|
||||
"parentId": "004"
|
||||
},
|
||||
{
|
||||
"id": "004002",
|
||||
"title": "温州市",
|
||||
"last": true,
|
||||
"parentId": "004"
|
||||
},
|
||||
{
|
||||
"id": "004003",
|
||||
"title": "绍兴市",
|
||||
"last": true,
|
||||
"parentId": "004"
|
||||
},
|
||||
{
|
||||
"id": "004004",
|
||||
"title": "金华市",
|
||||
"last": true,
|
||||
"parentId": "004"
|
||||
},
|
||||
{
|
||||
"id": "004005",
|
||||
"title": "义乌市",
|
||||
"last": true,
|
||||
"parentId": "004"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "005",
|
||||
"title": "福建省",
|
||||
"parentId": "0",
|
||||
"children": [{
|
||||
"id": "005001",
|
||||
"title": "厦门市",
|
||||
"last": true,
|
||||
"parentId": "005"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
"status": {
|
||||
"code": 200,
|
||||
"message": "操作成功"
|
||||
},
|
||||
"data": [{
|
||||
"id": "001",
|
||||
"title": "湖南省",
|
||||
"parentId": "0",
|
||||
"children": [{
|
||||
"id": "001001",
|
||||
"title": "长沙市",
|
||||
"last": true,
|
||||
"parentId": "001"
|
||||
},
|
||||
{
|
||||
"id": "001002",
|
||||
"title": "株洲市",
|
||||
"last": true,
|
||||
"parentId": "001"
|
||||
},
|
||||
{
|
||||
"id": "001003",
|
||||
"title": "湘潭市",
|
||||
"last": true,
|
||||
"parentId": "001"
|
||||
},
|
||||
{
|
||||
"id": "001004",
|
||||
"title": "衡阳市",
|
||||
"last": true,
|
||||
"parentId": "001"
|
||||
},
|
||||
{
|
||||
"id": "001005",
|
||||
"title": "郴州市",
|
||||
"last": true,
|
||||
"parentId": "001"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "002",
|
||||
"title": "湖北省",
|
||||
"parentId": "0",
|
||||
"children": [{
|
||||
"id": "002001",
|
||||
"title": "武汉市",
|
||||
"last": true,
|
||||
"parentId": "002"
|
||||
},
|
||||
{
|
||||
"id": "002002",
|
||||
"title": "黄冈市",
|
||||
"last": true,
|
||||
"parentId": "002"
|
||||
},
|
||||
{
|
||||
"id": "002003",
|
||||
"title": "潜江市",
|
||||
"last": true,
|
||||
"parentId": "002"
|
||||
},
|
||||
{
|
||||
"id": "002004",
|
||||
"title": "荆州市",
|
||||
"last": true,
|
||||
"parentId": "002"
|
||||
},
|
||||
{
|
||||
"id": "002005",
|
||||
"title": "襄阳市",
|
||||
"last": true,
|
||||
"parentId": "002"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "003",
|
||||
"title": "广东省",
|
||||
"parentId": "0",
|
||||
"children": [{
|
||||
"id": "003001",
|
||||
"title": "广州市",
|
||||
"last": false,
|
||||
"parentId": "003",
|
||||
"children": [{
|
||||
"id": "003001001",
|
||||
"title": "天河区",
|
||||
"last": true,
|
||||
"parentId": "003001"
|
||||
},
|
||||
{
|
||||
"id": "003001002",
|
||||
"title": "花都区",
|
||||
"last": true,
|
||||
"parentId": "003001"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "003002",
|
||||
"title": "深圳市",
|
||||
"last": true,
|
||||
"parentId": "003"
|
||||
},
|
||||
{
|
||||
"id": "003003",
|
||||
"title": "中山市",
|
||||
"last": true,
|
||||
"parentId": "003"
|
||||
},
|
||||
{
|
||||
"id": "003004",
|
||||
"title": "东莞市",
|
||||
"last": true,
|
||||
"parentId": "003"
|
||||
},
|
||||
{
|
||||
"id": "003005",
|
||||
"title": "珠海市",
|
||||
"last": true,
|
||||
"parentId": "003"
|
||||
},
|
||||
{
|
||||
"id": "003006",
|
||||
"title": "韶关市",
|
||||
"last": true,
|
||||
"parentId": "003"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "004",
|
||||
"title": "浙江省",
|
||||
"parentId": "0",
|
||||
"children": [{
|
||||
"id": "004001",
|
||||
"title": "杭州市",
|
||||
"last": true,
|
||||
"parentId": "004"
|
||||
},
|
||||
{
|
||||
"id": "004002",
|
||||
"title": "温州市",
|
||||
"last": true,
|
||||
"parentId": "004"
|
||||
},
|
||||
{
|
||||
"id": "004003",
|
||||
"title": "绍兴市",
|
||||
"last": true,
|
||||
"parentId": "004"
|
||||
},
|
||||
{
|
||||
"id": "004004",
|
||||
"title": "金华市",
|
||||
"last": true,
|
||||
"parentId": "004"
|
||||
},
|
||||
{
|
||||
"id": "004005",
|
||||
"title": "义乌市",
|
||||
"last": true,
|
||||
"parentId": "004"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "005",
|
||||
"title": "福建省",
|
||||
"parentId": "0",
|
||||
"children": [{
|
||||
"id": "005001",
|
||||
"title": "厦门市",
|
||||
"last": true,
|
||||
"parentId": "005"
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 26 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-view{display:block;position:relative;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#fafafa;color:#333;font-family:Courier New;font-size:13px}.layui-code-title{position:relative;padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee;font-size:12px}.layui-code-title>.layui-code-about{position:absolute;right:10px;top:0;color:#b7b7b7}.layui-code-about>a{padding-left:10px}.layui-code-view>.layui-code-ol,.layui-code-view>.layui-code-ul{position:relative;overflow:auto}.layui-code-view>.layui-code-ol>li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view>.layui-code-ol>li:first-child,.layui-code-view>.layui-code-ul>li:first-child{padding-top:10px}.layui-code-view>.layui-code-ol>li:last-child,.layui-code-view>.layui-code-ul>li:last-child{padding-bottom:10px}.layui-code-view>.layui-code-ul>li{position:relative;line-height:20px;padding:0 10px;list-style-type:none;*list-style-type:none;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-dark{border:1px solid #0c0c0c;border-left-color:#3f3f3f;background-color:#0c0c0c;color:#c2be9e}.layui-code-dark>.layui-code-title{border-bottom:none}.layui-code-dark>.layui-code-ol>li,.layui-code-dark>.layui-code-ul>li{background-color:#3f3f3f;border-left:none}.layui-code-dark>.layui-code-ul>li{margin-left:6px}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view .layui-code-ol li:first-child{padding-top:10px}.layui-code-view .layui-code-ol li:last-child{padding-bottom:10px}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 299 KiB After Width: | Height: | Size: 316 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,131 @@
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.block {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.sliderContainer {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
background: #f7f9fa;
|
||||
color: #45494c;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.sliderbg {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
background-color: #f7f9fa;
|
||||
height: 40px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #e6e8eb;
|
||||
}
|
||||
|
||||
.sliderContainer_active .slider {
|
||||
top: -1px;
|
||||
border: 1px solid #1991FA;
|
||||
}
|
||||
|
||||
.sliderContainer_active .sliderMask {
|
||||
border-width: 1px 0 1px 1px;
|
||||
}
|
||||
|
||||
.sliderContainer_success .slider {
|
||||
top: -1px;
|
||||
border: 1px solid #52CCBA;
|
||||
background-color: #52CCBA !important;
|
||||
}
|
||||
|
||||
.sliderContainer_success .sliderMask {
|
||||
border: 1px solid #52CCBA;
|
||||
border-width: 1px 0 1px 1px;
|
||||
background-color: #D2F4EF;
|
||||
}
|
||||
|
||||
.sliderContainer_success .sliderIcon:before {
|
||||
content: "\f00c";
|
||||
}
|
||||
|
||||
.sliderContainer_fail .slider {
|
||||
top: -1px;
|
||||
border: 1px solid #f57a7a;
|
||||
background-color: #f57a7a !important;
|
||||
}
|
||||
|
||||
.sliderContainer_fail .sliderMask {
|
||||
border: 1px solid #f57a7a;
|
||||
background-color: #fce1e1;
|
||||
border-width: 1px 0 1px 1px;
|
||||
}
|
||||
|
||||
.sliderContainer_fail .sliderIcon:before {
|
||||
content: "\f00d";
|
||||
}
|
||||
.sliderContainer_active .sliderText, .sliderContainer_success .sliderText, .sliderContainer_fail .sliderText {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sliderMask {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 40px;
|
||||
border: 0 solid #1991FA;
|
||||
background: #D1E9FE;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.slider {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #fff;
|
||||
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
|
||||
cursor: pointer;
|
||||
transition: background .2s linear;
|
||||
border-radius: 2px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.slider:hover {
|
||||
background: #1991FA;
|
||||
}
|
||||
|
||||
.slider:hover .sliderIcon {
|
||||
background-position: 0 -13px;
|
||||
}
|
||||
|
||||
.sliderText {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sliderIcon {
|
||||
|
||||
}
|
||||
|
||||
.refreshIcon {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
cursor: pointer;
|
||||
margin: 6px;
|
||||
color: rgba(0,0,0,.25);
|
||||
font-size: 1rem;
|
||||
z-index: 5;
|
||||
transition: color .3s linear;
|
||||
}
|
||||
|
||||
.refreshIcon:hover {
|
||||
color: #6c757d;
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,22 @@
|
||||
html:-moz-full-screen {
|
||||
background: grey;
|
||||
}
|
||||
html:-webkit-full-screen {
|
||||
background: grey;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
html:fullscreen{
|
||||
background: grey;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
:not(:root):fullscreen::backdrop{
|
||||
background:whitesmoke;
|
||||
}
|
||||
|
||||
.pear-full-screen {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -1,67 +1,71 @@
|
||||
layui.define(['jquery', 'element'], function (exports) {
|
||||
layui.define(['jquery', 'element'], function(exports) {
|
||||
"use strict";
|
||||
|
||||
var $ = layui.jquery;
|
||||
|
||||
var pearFrame = function (opt) {
|
||||
var frame = function(opt) {
|
||||
this.option = opt;
|
||||
};
|
||||
|
||||
pearFrame.prototype.render = function (opt) {
|
||||
frame.prototype.render = function(opt) {
|
||||
var option = {
|
||||
elem: opt.elem,
|
||||
url: opt.url,
|
||||
title: opt.title,
|
||||
width: opt.width,
|
||||
height: opt.height,
|
||||
done: opt.done ? opt.done : function () { console.log("菜单渲染成功"); }
|
||||
done: opt.done ? opt.done : function() {
|
||||
console.log("菜单渲染成功");
|
||||
}
|
||||
}
|
||||
createFrameHTML(option);
|
||||
renderContent(option);
|
||||
$("#" + option.elem).width(option.width);
|
||||
$("#" + option.elem).height(option.height);
|
||||
return new pearFrame(option);
|
||||
return new frame(option);
|
||||
}
|
||||
|
||||
pearFrame.prototype.changePage = function (url, loading) {
|
||||
frame.prototype.changePage = function(url, loading) {
|
||||
var $frameLoad = $("#" + this.option.elem).find(".pear-frame-loading");
|
||||
var $frame = $("#" + this.option.elem + " iframe");
|
||||
$frame.attr("src", url);
|
||||
frameLoading($frame, $frameLoad, loading);
|
||||
renderContentLoading($frame, $frameLoad, loading);
|
||||
}
|
||||
|
||||
pearFrame.prototype.changePageByElement = function (elem, url, title, loading) {
|
||||
frame.prototype.changePageByElement = function(elem, url, title, loading) {
|
||||
var $frameLoad = $("#" + elem).find(".pear-frame-loading");
|
||||
var $frame = $("#" + elem + " iframe");
|
||||
$frame.attr("src", url);
|
||||
$("#" + elem + " .title").html(title);
|
||||
frameLoading($frame, $frameLoad, loading);
|
||||
renderContentLoading($frame, $frameLoad, loading);
|
||||
}
|
||||
|
||||
pearFrame.prototype.refresh = function (loading) {
|
||||
frame.prototype.refresh = function(loading) {
|
||||
var $frameLoad = $("#" + this.option.elem).find(".pear-frame-loading");
|
||||
var $frame = $("#" + this.option.elem).find("iframe");
|
||||
$frame.attr("src", $frame.attr("src"));
|
||||
frameLoading($frame, $frameLoad, loading);
|
||||
renderContentLoading($frame, $frameLoad, loading);
|
||||
}
|
||||
|
||||
function createFrameHTML(option) {
|
||||
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>';
|
||||
function renderContent(option) {
|
||||
var iframe = `<iframe class='pear-frame-content' style='width:100%;height:100%;' scrolling='auto' frameborder='0' src='${option.url}' allowfullscreen='true' ></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'>" + iframe + loading + "</div>");
|
||||
}
|
||||
|
||||
function frameLoading(iframeEl, loadingEl, isLoading) {
|
||||
|
||||
function renderContentLoading (iframeEl, loadingEl, isLoading) {
|
||||
if (isLoading) {
|
||||
loadingEl.css({ display: 'block' });
|
||||
iframeEl.load(function () {
|
||||
loadingEl.css({
|
||||
display: 'block'
|
||||
});
|
||||
$(iframeEl).on('load', function() {
|
||||
loadingEl.fadeOut(1000);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
exports('frame', new pearFrame());
|
||||
exports('frame', new frame());
|
||||
});
|
||||
|
@ -0,0 +1,54 @@
|
||||
layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'frame', 'theme', 'convert'],
|
||||
function(exports) {
|
||||
"use strict";
|
||||
var $ = layui.jquery;
|
||||
var defer = $.Deferred();
|
||||
var fullScreen = new function() {
|
||||
this.func = null;
|
||||
this.onFullchange = function(func){
|
||||
this.func = func;
|
||||
var evts = ['fullscreenchange','webkitfullscreenchange','mozfullscreenchange','MSFullscreenChange'];
|
||||
for(var i=0;i<evts.length && func;i++) {
|
||||
window.addEventListener(evts[i], this.func);
|
||||
}
|
||||
}
|
||||
this.fullScreen = function(dom){
|
||||
var docElm = dom && document.querySelector(dom) || document.documentElement;
|
||||
if (docElm.requestFullscreen) {
|
||||
docElm.requestFullscreen();
|
||||
} else if (docElm.mozRequestFullScreen) {
|
||||
docElm.mozRequestFullScreen();
|
||||
} else if (docElm.webkitRequestFullScreen) {
|
||||
docElm.webkitRequestFullScreen();
|
||||
} else if (docElm.msRequestFullscreen) {
|
||||
docElm.msRequestFullscreen();
|
||||
}else{
|
||||
defer.reject("");
|
||||
}
|
||||
defer.resolve("返回值");
|
||||
return defer.promise();
|
||||
}
|
||||
this.fullClose = function(){
|
||||
if(this.isFullscreen()) {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
}
|
||||
defer.resolve("返回值");
|
||||
return defer.promise();
|
||||
}
|
||||
this.isFullscreen = function(){
|
||||
return document.fullscreenElement ||
|
||||
document.msFullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.webkitFullscreenElement || false;
|
||||
}
|
||||
};
|
||||
exports('fullscreen', fullScreen);
|
||||
})
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,224 @@
|
||||
/* global Watermark */
|
||||
layui.define(['jquery', 'element'], function(exports) {
|
||||
var $=layui.$;
|
||||
var _parentEle;
|
||||
var _wmContainer;
|
||||
var _wmObserver;
|
||||
var _wmParentObserver;
|
||||
var _resizeHandler;
|
||||
var _windowsWidth = window.outerWidth;
|
||||
var _windowsHeight = window.outerHeight;
|
||||
|
||||
var _left = 0;
|
||||
var _top = 0;
|
||||
|
||||
/**
|
||||
* Create DOM of watermark's container
|
||||
* @param {Watermark} watermark
|
||||
*/
|
||||
var _createContainer = function (watermark) {
|
||||
watermark._container = document.createElement('div');
|
||||
watermark._container.classList.add('cell-watermark-container');
|
||||
watermark._container.style.cssText = 'display: block; pointer-events: none;';
|
||||
watermark._container.setAttribute('aria-hidden', true);
|
||||
_parentEle = document.querySelector(watermark.options.appendTo) || document.body;
|
||||
//获取页面最大宽度
|
||||
_windowsWidth = Math.min(_parentEle.scrollWidth, _parentEle.clientWidth);
|
||||
//获取页面最大高度
|
||||
_windowsHeight = Math.min(_parentEle.scrollHeight, _parentEle.clientHeight);
|
||||
_parentEle.appendChild(watermark._container);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create watermark's DOM
|
||||
* @param {Watermark} watermark
|
||||
* @param {Object} options
|
||||
*/
|
||||
var _createWatermark = function (watermark, options) {
|
||||
options.rowSpacing = options.rowSpacing || 60;
|
||||
options.colSpacing = options.colSpacing || 30;
|
||||
options.width = options.width || 150;
|
||||
options.height = options.height || 20;
|
||||
|
||||
let rows = parseInt(_windowsHeight / (options.height + options.rowSpacing));
|
||||
let cols = parseInt(_windowsWidth / (options.width + options.colSpacing));
|
||||
let offsetLeft =_left+ (_windowsWidth - options.width * cols - options.colSpacing * (cols - 1)) / 2;
|
||||
let offsetTop = _top+(_windowsHeight - options.height * rows - options.rowSpacing * (rows - 1)) / 2;
|
||||
let watermarkBase = document.createElement('div');
|
||||
watermarkBase.classList.add('cell-watermark');
|
||||
watermarkBase.style.cssText =
|
||||
'transform: rotate(15deg); opacity: 0.1; font-size: 0.85rem; text-align: center;' +
|
||||
'position: absolute; user-select: none; word-break: break-all; overflow: hidden; z-index: 999999;';
|
||||
for (let row = 0; row < rows; row++) {
|
||||
let top = offsetTop + (options.rowSpacing + options.height) * row;
|
||||
let tempCols = cols;
|
||||
row % 2 !== 0 && tempCols++;
|
||||
for (let col = 0; col < tempCols; col++) {
|
||||
let left = offsetLeft + (options.colSpacing + options.width) * col;
|
||||
tempCols !== cols && (left -= (options.colSpacing + options.width) / 2);
|
||||
let watermarkEle = watermarkBase.cloneNode();
|
||||
watermarkEle.style.cssText += `left: ${left}px; top: ${top}px; width: ${options.width}px; height: ${options.height}px`;
|
||||
watermarkEle.style.transform = `rotate(${options.rotate}deg)`;
|
||||
watermarkEle.style.opacity = options.opacity;
|
||||
watermarkEle.style.fontSize = `${options.fontSize}rem`;
|
||||
watermarkEle.style.fontFamily = options.fontFamily;
|
||||
watermarkEle.innerHTML = options.content;
|
||||
watermark._container.appendChild(watermarkEle);
|
||||
}
|
||||
}
|
||||
//Backup for recover the watermark's container when the its DOM is removed
|
||||
_wmContainer = watermark._container;
|
||||
};
|
||||
|
||||
/**
|
||||
* Rerender watermark
|
||||
* @param {Watermark} watermark
|
||||
* @param {Object} options
|
||||
*/
|
||||
var _render = function (watermark, options) {
|
||||
_wmObserver.disconnect();
|
||||
watermark._container.innerHTML = '';
|
||||
_createWatermark(watermark, options);
|
||||
_wmObserver.observe(watermark._container, {
|
||||
attributes: true,
|
||||
childList: true,
|
||||
characterData: true,
|
||||
subtree: true
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Observe watermark and watermark's parentNode mutations
|
||||
* @param {Watermark} watermark
|
||||
*/
|
||||
var _addObserve = function (watermark) {
|
||||
//Observe watermark element and its child element
|
||||
_wmObserver = new MutationObserver(function (mutations, observer) {
|
||||
_render(watermark, watermark.options);
|
||||
});
|
||||
_wmObserver.observe(watermark._container, {
|
||||
attributes: true,
|
||||
childList: true,
|
||||
characterData: true,
|
||||
subtree: true
|
||||
});
|
||||
//Observe parent element, recreate if the element is deleted
|
||||
_wmParentObserver = new MutationObserver(function (mutations) {
|
||||
for (let m of mutations) {
|
||||
if (
|
||||
m.type === 'childList' &&
|
||||
m.removedNodes.length > 0 &&
|
||||
document.querySelectorAll('.cell-watermark-container').length === 0
|
||||
) {
|
||||
_parentEle.appendChild(_wmContainer);
|
||||
}
|
||||
}
|
||||
});
|
||||
_wmParentObserver.observe(watermark._container.parentNode, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Window's resize listener
|
||||
* @param {Watermark} watermark
|
||||
*/
|
||||
var _addResizeListener = function (watermark) {
|
||||
_resizeHandler = function () {
|
||||
|
||||
//获取页面最大宽度
|
||||
var _windowsWidth_n = Math.max(_parentEle.scrollWidth, _parentEle.clientWidth);
|
||||
//获取页面最大高度
|
||||
var _windowsHeight_n = Math.max(_parentEle.scrollHeight, _parentEle.clientHeight);
|
||||
|
||||
|
||||
/*if (window.outerHeight !== _windowsHeight || window.outerWidth !== _windowsWidth) {
|
||||
_windowsHeight = window.outerHeight;
|
||||
_windowsWidth = window.outerWidth;
|
||||
_render(watermark, watermark.options);
|
||||
}*/
|
||||
if (_windowsHeight_n !== _windowsHeight || _windowsWidth_n !== _windowsWidth) {
|
||||
_windowsHeight = _windowsHeight_n;
|
||||
_windowsWidth = _windowsWidth_n;
|
||||
_render(watermark, watermark.options);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
window.addEventListener('resize', _resizeHandler);
|
||||
};
|
||||
|
||||
/**
|
||||
* Watermark.
|
||||
* Create watermark for webpage and automatic adjust when windows resize.
|
||||
* @param {Object} options
|
||||
* @param {String} [options.content] watermark's text
|
||||
* @param {String} [options.appendTo='body'] parent of watermark's container
|
||||
* @param {Number} [options.width=150] watermark's width. unit: px
|
||||
* @param {Number} [options.height=20] watermark's height. unit: px
|
||||
* @param {Number} [options.rowSpacing=60] row spacing of watermarks. unit: px
|
||||
* @param {Number} [options.colSpacing=30] col spacing of watermarks. unit: px
|
||||
* @param {Number} [options.rotate=15] watermark's tangent angle. unit: deg
|
||||
* @param {Number} [options.opacity=0.1] watermark's transparency
|
||||
* @param {Number} [options.fontSize=0.85] watermark's fontSize. unit: rem
|
||||
* @param {Number} [options.fontFamily='inherit'] watermark's fontFamily.
|
||||
* @namespace Watermark
|
||||
* @class Watermark
|
||||
* @version 1.0.3
|
||||
* @author @Lruihao https://lruihao.cn
|
||||
*/
|
||||
function Watermark(options = {}) {
|
||||
var _proto = Watermark.prototype;
|
||||
this.options = options;
|
||||
_createContainer(this);
|
||||
_createWatermark(this, this.options);
|
||||
_addObserve(this);
|
||||
_addResizeListener(this);
|
||||
|
||||
/**
|
||||
* Upload watermark's text content
|
||||
* @param {String} content watermark's text
|
||||
*/
|
||||
_proto.upload = function (content) {
|
||||
if (!content) {
|
||||
return;
|
||||
}
|
||||
_wmParentObserver.disconnect();
|
||||
_wmObserver.disconnect();
|
||||
this.options.content = content;
|
||||
for (const watermark of this._container.querySelectorAll('.cell-watermark')) {
|
||||
watermark.innerHTML = content;
|
||||
}
|
||||
_wmParentObserver.observe(this._container.parentNode, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
_wmObserver.observe(this._container, {
|
||||
attributes: true,
|
||||
childList: true,
|
||||
characterData: true,
|
||||
subtree: true
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Rerender watermark
|
||||
* @param {Object} options
|
||||
*/
|
||||
_proto.render = function (options = {}) {
|
||||
_render(this, Object.assign(this.options, options));
|
||||
};
|
||||
|
||||
/**
|
||||
* Force destroy watermark
|
||||
*/
|
||||
_proto.destroy = function () {
|
||||
_wmObserver.disconnect();
|
||||
_wmParentObserver.disconnect();
|
||||
window.removeEventListener('resize', _resizeHandler);
|
||||
this._container.parentNode.removeChild(this._container);
|
||||
};
|
||||
}
|
||||
exports("watermark",Watermark);
|
||||
})
|
@ -0,0 +1,70 @@
|
||||
{
|
||||
"logo": {
|
||||
"title": "Pear Admin",
|
||||
"image": "admin/images/logo.png"
|
||||
},
|
||||
"menu": {
|
||||
"data": "admin/data/menu.json",
|
||||
"method": "GET",
|
||||
"accordion": true,
|
||||
"collapse": false,
|
||||
"control": false,
|
||||
"controlWidth": 500,
|
||||
"select": "10",
|
||||
"async": true
|
||||
},
|
||||
"tab": {
|
||||
"enable": true,
|
||||
"keepState": true,
|
||||
"session": true,
|
||||
"preload": false,
|
||||
"max": "30",
|
||||
"index": {
|
||||
"id": "10",
|
||||
"href": "view/console/console1.html",
|
||||
"title": "首页"
|
||||
}
|
||||
},
|
||||
"theme": {
|
||||
"defaultColor": "2",
|
||||
"defaultMenu": "dark-theme",
|
||||
"defaultHeader": "light-theme",
|
||||
"allowCustom": true,
|
||||
"banner": false
|
||||
},
|
||||
"colors": [
|
||||
{
|
||||
"id": "1",
|
||||
"color": "#2d8cf0",
|
||||
"second": "#ecf5ff"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"color": "#36b368",
|
||||
"second": "#f0f9eb"
|
||||
},
|
||||
{
|
||||
"id": "3",
|
||||
"color": "#f6ad55",
|
||||
"second": "#fdf6ec"
|
||||
},
|
||||
{
|
||||
"id": "4",
|
||||
"color": "#f56c6c",
|
||||
"second": "#fef0f0"
|
||||
},
|
||||
{
|
||||
"id": "5",
|
||||
"color": "#3963bc",
|
||||
"second": "#ecf5ff"
|
||||
}
|
||||
],
|
||||
"other": {
|
||||
"keepLoad": "1200",
|
||||
"autoHead": false,
|
||||
"footer": false
|
||||
},
|
||||
"header": {
|
||||
"message": "admin/data/message.json"
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue