mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-06 01:52:48 +08:00
新增loading操作;
This commit is contained in:
30
public/static/common/js/app.js
Normal file
30
public/static/common/js/app.js
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
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 () {
|
||||
|
||||
loading.showCount--;
|
||||
|
||||
if (loading.showCount < 0) {
|
||||
loading.showCount = 0;
|
||||
}
|
||||
|
||||
if (loading.showCount == 0) {
|
||||
layer.close(loading.index);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user