Update admin.js

This commit is contained in:
Anyon 2020-03-23 18:06:07 +08:00
parent 8cbbbbbc9c
commit 0e8770f902

View File

@ -736,22 +736,16 @@ $(function () {
}); });
/*! 异步任务状态监听与展示 */ /*! 异步任务状态监听与展示 */
$body.on('click', '[data-queue]', function () { $body.on('click', '[data-queue]', function (action) {
var action = this.getAttribute('data-queue') || ''; action = this.getAttribute('data-queue') || '';
if (action.length < 1) return $.msg.tips('任务地址不能为空!'); if (action.length < 1) return $.msg.tips('任务地址不能为空!');
this.loading = function (index) { this.loading = function (index) {
$.form.load(action, {}, 'post', function (ret) { $.form.load(action, {}, 'post', function (ret) {
if (typeof ret.data === 'string' && ret.data.indexOf('Q') === 0) { if (typeof ret.data === 'string' && ret.data.indexOf('Q') === 0) return $.loadQueue(ret.data), false;
return $.loadQueue(ret.data), false;
}
}); });
$.msg.close(index); $.msg.close(index);
}; };
if ($(this).attr('data-confirm')) { $(this).attr('data-confirm') ? $.msg.confirm($(this).attr('data-confirm'), this.loading) : this.loading(0);
return $.msg.confirm($(this).attr('data-confirm'), this.loading);
} else {
this.loading();
}
}); });
$.loadQueue = function (code) { $.loadQueue = function (code) {
layer.open({ layer.open({