78 lines
3.2 KiB
HTML

{extend name='main'}
{block name="button"}
{if auth("admin/queue/remove")}
<button data-action='{:url("remove")}' data-confirm="确定要删除这些任务吗?" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除任务</button>
{/if}
{/block}
{block name="content"}
<div class="think-box-shadow">
{include file='queue/index_search'}
<table class="layui-table margin-top-15" lay-skin="line">
{notempty name='list'}
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'>
</th>
<th class='text-left nowrap'>任务信息</th>
<th class='text-left nowrap'>任务时间</th>
<th class='text-left nowrap'>任务状态</th>
</tr>
</thead>
{/notempty}
<tbody>
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td think-checkbox'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'>
</td>
<td class='text-left nowrap'>
任务名称:{$vo.title}<br>
<span class="color-desc">任务指令:{$vo.preload}</span>
</td>
<td class='text-left nowrap'>
创建时间:{$vo.create_at|format_datetime|raw}<br>
跟进时间:{$vo.end_at|format_datetime|raw}
</td>
<td class='text-left nowrap'>
任务状态:{eq name='vo.double' value='1'}
<span class="layui-badge layui-bg-green margin-right-5"></span>
{else}
<span class="layui-badge layui-bg-blue margin-right-5"></span>
{/eq}
{eq name='vo.status' value='1'}
<span class="layui-badge layui-bg-black">待处理</span>
{elseif $vo.status eq 2}
<span class="layui-badge layui-bg-green">处理中</span>
{elseif $vo.status eq 3}
<span class="layui-badge layui-bg-blue">处理完成</span>
{elseif $vo.status eq 4}
<span class="layui-badge layui-bg-red margin-right-5">处理失败</span>
<a class="layui-badge layui-bg-green" data-tips-text="重置该任务" data-action="{:url('redo')}" data-value="id#{$vo.id}">
<i class="layui-icon font-s12">&#xe669;</i>
</a>
{/eq}
{if auth("admin/queue/remove") and in_array($vo.status,[1,3,4])}
<a data-action='{:url("remove")}' data-confirm="确定要删除该任务吗?" data-value="id#{$vo.id}" data-tips-text="删除该任务" class='layui-badge layui-bg-red margin-left-5'>
<i class="layui-icon">&#xe640;</i>
</a>
{/if}
<br>
状态描述:<span class="color-desc">{$vo.status_desc|raw|default="没有获取到状态描述"}</span>
</td>
</tr>
{/foreach}
</tbody>
</table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}