整理部分源码
parent
f235c29fc9
commit
84a3a14e29
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,5 @@
|
|||
@import url("../../layui/css/layui.css");
|
||||
@import url("../font/iconfont.css");
|
||||
|
||||
@import url("pear-module/dtree/font/dtreefont.css");
|
||||
@import url("pear-module/icon/iconfont.css");
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
|
@ -1,36 +1,45 @@
|
|||
layui.define(['jquery', 'element', 'util'], function(exports) {
|
||||
layui.define(['jquery'], function(exports) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Button component
|
||||
* */
|
||||
var MOD_NAME = 'button',
|
||||
$ = layui.jquery,
|
||||
util = layui.util,
|
||||
element = layui.element;
|
||||
$ = layui.jquery;
|
||||
|
||||
var button = function(opt) {
|
||||
this.option = opt;
|
||||
};
|
||||
|
||||
/**
|
||||
* Button start loading
|
||||
* */
|
||||
button.prototype.load = function(opt) {
|
||||
//默认配置值
|
||||
|
||||
var option = {
|
||||
elem: opt.elem,
|
||||
time: opt.time ? opt.time : false,
|
||||
done: opt.done ? opt.done : function(){}
|
||||
}
|
||||
var load = $(option.elem).text();
|
||||
var text = $(option.elem).text();
|
||||
|
||||
$(option.elem).html("<i class='layui-anim layui-anim-rotate layui-icon layui-anim-loop layui-icon-loading'/>");
|
||||
|
||||
var buttons = $(option.elem);
|
||||
if (option.time == "") {
|
||||
} else {
|
||||
|
||||
if (option.time != "" || option.time !=false) {
|
||||
setTimeout(function() {
|
||||
buttons.html(load);
|
||||
buttons.html(text);
|
||||
option.done();
|
||||
}, option.time);
|
||||
}
|
||||
option.text = load;
|
||||
option.text = text;
|
||||
return new button(option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Button stop loaded
|
||||
* */
|
||||
button.prototype.stop = function(success) {
|
||||
$(this.option.elem).html(this.option.text);
|
||||
success();
|
||||
|
|
@ -38,7 +38,7 @@ layui.define(['table', 'laypage','jquery', 'element'], function(exports) {
|
|||
|
||||
$(option.elem).html(html);
|
||||
|
||||
// 初始化分页组件
|
||||
// 初始化分页组件
|
||||
laypage.render({
|
||||
elem: 'cardpage'
|
||||
,count: 100
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
layui.define(['jquery', 'element'], function(exports) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* 数 字 滚 动 组 件
|
||||
* */
|
||||
var MOD_NAME = 'count',
|
||||
$ = layui.jquery,
|
||||
element = layui.element;
|
||||
|
|
@ -12,25 +15,20 @@ layui.define(['jquery', 'element'], function(exports) {
|
|||
options = options || {};
|
||||
|
||||
var $this = document.getElementById(targetEle),
|
||||
time = options.time, //总时间--毫秒为单位
|
||||
finalNum = options.num, //要显示的真实数值
|
||||
regulator = options.regulator, //调速器,改变regulator的数值可以调节数字改变的速度
|
||||
time = options.time,
|
||||
finalNum = options.num,
|
||||
regulator = options.regulator,
|
||||
step = finalNum / (time / regulator),
|
||||
count = 0.00,
|
||||
initial = 0;
|
||||
|
||||
|
||||
var timer = setInterval(function() {
|
||||
count = count + step;
|
||||
|
||||
if (count >= finalNum) {
|
||||
clearInterval(timer);
|
||||
count = finalNum;
|
||||
}
|
||||
//t未发生改变的话就直接返回
|
||||
//避免调用text函数,提高DOM性能
|
||||
var t = count.toFixed(options.bit?options.bit:0);;
|
||||
|
||||
if (t == initial) return;
|
||||
initial = t;
|
||||
$this.innerHTML = initial;
|
||||
|
|
@ -1,14 +1,20 @@
|
|||
layui.define(['jquery', 'element'], function(exports) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Drawer component
|
||||
* */
|
||||
var MOD_NAME = 'drawer',
|
||||
$ = layui.jquery,
|
||||
element = layui.element;
|
||||
|
||||
var drawer = new function() {
|
||||
|
||||
/**
|
||||
* open drawer
|
||||
* */
|
||||
this.open = function(option) {
|
||||
var _right = new mSlider({
|
||||
var obj = new mSlider({
|
||||
dom: option.dom,
|
||||
direction: option.direction,
|
||||
distance: option.distance,
|
||||
|
|
@ -16,15 +22,17 @@ layui.define(['jquery', 'element'], function(exports) {
|
|||
maskClose:option.maskClose,
|
||||
callback:option.success
|
||||
});
|
||||
_right.open();
|
||||
|
||||
return _right;
|
||||
obj.open();
|
||||
return obj;
|
||||
}
|
||||
|
||||
}
|
||||
exports(MOD_NAME,drawer);
|
||||
});
|
||||
|
||||
/**
|
||||
* 源码
|
||||
* */
|
||||
(function(b, c) {
|
||||
function a(d) {
|
||||
this.opts = {
|
||||
|
|
@ -20,7 +20,6 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
|||
done:opt.done ? opt.done: function(){ console.log("菜单渲染成功");}
|
||||
}
|
||||
|
||||
|
||||
createFrameHTML(option);
|
||||
|
||||
$("#"+option.elem).width(option.width);
|
||||
|
|
@ -236,11 +236,9 @@ layui.define(['laypage', 'form'], function (exports) {
|
|||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
$('#' + ICON_BODY).find('.layui-anim').find('.' + LIST_BOX).html('').append(listHtml).append(pageHtml);
|
||||
return a;
|
||||
},
|
||||
// 阻止Layui的一些默认事件
|
||||
preventEvent: function() {
|
||||
var item = '#' + ICON_BODY + ' .layui-anim';
|
||||
a.event('click', item, function (e) {
|
||||
|
|
@ -248,7 +246,6 @@ layui.define(['laypage', 'form'], function (exports) {
|
|||
});
|
||||
return a;
|
||||
},
|
||||
// 分页
|
||||
page: function () {
|
||||
var icon = '#' + PAGE_ID + ' .layui-iconpicker-page-operate .layui-icon';
|
||||
|
||||
|
|
@ -35,13 +35,10 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
|||
,option.msg);
|
||||
}
|
||||
else if(option.type==5){
|
||||
|
||||
|
||||
Notiflix.Block.Dots(
|
||||
option.elem
|
||||
,option.msg);
|
||||
}
|
||||
|
||||
else if(option.type==6){
|
||||
Notiflix.Block.Pulse(
|
||||
option.elem
|
||||
|
|
@ -88,7 +85,6 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
this.confirm = function(option){
|
||||
Notiflix.Confirm.Show(
|
||||
option.title,
|
||||
|
|
@ -109,7 +105,6 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
|
|||
_right.open();
|
||||
}
|
||||
|
||||
|
||||
this.loadRemove = function(time){
|
||||
Notiflix.Loading.Remove(time);
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
|
|||
};
|
||||
|
||||
pearMenu.prototype.render = function(opt) {
|
||||
//默认配置值
|
||||
|
||||
var option = {
|
||||
elem: opt.elem,
|
||||
async: opt.async,
|
||||
|
|
@ -103,7 +103,6 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
|
|||
$("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents(".layui-nav-item").addClass("layui-nav-itemed");
|
||||
$("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents("dd").addClass("layui-nav-itemed");
|
||||
}
|
||||
|
||||
$("#" + this.option.elem + " a[menu-id='" + pearId + "']").parent().addClass("layui-this");
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +127,6 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
|
|||
width: "60px"
|
||||
}, 400);
|
||||
isHoverMenu(true, config);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -34,8 +34,6 @@
|
|||
|
||||
return toastr;
|
||||
|
||||
////////////////
|
||||
|
||||
function error(message, title, optionsOverride) {
|
||||
return notify({
|
||||
type: toastType.error,
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue