mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改后台任务
This commit is contained in:
parent
033f49a495
commit
097497f87a
@ -1,13 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | ThinkAdmin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 版权所有 2014~2020 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 官方网站: http://demo.thinkadmin.top
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 开源协议 ( https://mit-license.org )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
namespace app\admin\controller\api;
|
namespace app\admin\controller\api;
|
||||||
|
|
||||||
use think\admin\Controller;
|
use think\admin\Controller;
|
||||||
use think\admin\service\QueueService;
|
use think\admin\service\QueueService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台任务通用接口
|
||||||
|
* Class Queue
|
||||||
|
* @package app\admin\controller\api
|
||||||
|
*/
|
||||||
class Queue extends Controller
|
class Queue extends Controller
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 任务进度查询
|
||||||
|
* @login true
|
||||||
|
*/
|
||||||
public function progress()
|
public function progress()
|
||||||
{
|
{
|
||||||
$input = $this->_vali(['code.require' => '任务编号不能为空!']);
|
$input = $this->_vali(['code.require' => '任务编号不能为空!']);
|
||||||
|
@ -788,8 +788,10 @@ $(function () {
|
|||||||
this.lines = [];
|
this.lines = [];
|
||||||
for (this.i in lines) {
|
for (this.i in lines) {
|
||||||
this.line = lines[this.i], this.percent = '[ ' + this.line.progress + '% ] ';
|
this.line = lines[this.i], this.percent = '[ ' + this.line.progress + '% ] ';
|
||||||
|
if (this.line.message.indexOf('javascript:') === -1) {
|
||||||
this.lines.push(this.line.message.indexOf('>>>') > -1 ? this.line.message : this.percent + this.line.message);
|
this.lines.push(this.line.message.indexOf('>>>') > -1 ? this.line.message : this.percent + this.line.message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
that.$area.val(this.lines.join("\n")), that.$area.animate({scrollTop: that.$area[0].scrollHeight + 'px'}, 200);
|
that.$area.val(this.lines.join("\n")), that.$area.animate({scrollTop: that.$area[0].scrollHeight + 'px'}, 200);
|
||||||
})(ret.data.history);
|
})(ret.data.history);
|
||||||
that.$percent.attr('lay-percent', (ret.data.progress || '0.00') + '%'), layui.element.render();
|
that.$percent.attr('lay-percent', (ret.data.progress || '0.00') + '%'), layui.element.render();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user