mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-03 08:22:48 +08:00
40 lines
636 B
PHP
40 lines
636 B
PHP
|
|
const loading = {};
|
|
loading.index = 0;
|
|
loading.showCount = 0;
|
|
loading.show = function (count) {
|
|
|
|
if (typeof count == 'undefined') {
|
|
count = 1;
|
|
}
|
|
|
|
if (loading.showCount == 0) {
|
|
loading.index = layer.load()
|
|
}
|
|
|
|
loading.showCount += count;
|
|
}
|
|
|
|
loading.hide = function (count) {
|
|
|
|
|
|
if (typeof count == undefined) {
|
|
count = 1;
|
|
}
|
|
|
|
if (count === true) {
|
|
count = 1;
|
|
loading.showCount = 0;
|
|
}
|
|
|
|
loading.showCount -= 1;
|
|
|
|
if (loading.showCount < 0) {
|
|
loading.showCount = 0;
|
|
}
|
|
|
|
if (loading.showCount == 0) {
|
|
layer.close(loading.index);
|
|
}
|
|
|
|
} |