zzwy2/view/manager/content/article.html

176 lines
9.8 KiB
HTML
Executable File

{php}
use app\service\Image as CImage;
use app\model\Category as VCategory;
{/php}
{layout name="manager/layout" /}
<div class="layui-card layui-col-md12">
<div class="layui-card-body">
<div class="layui-col-xs12 between-center">
<div class="layui-inline">
{php} if(!VCategory::hasChildren($category['id'])):{/php}
<a id="add-article" class="layui-btn layui-btn-normal" data-href="{:url('manager.article/add',['category_id'=>$category['id']])}" title="添加" data-width="1300"><i class="layui-icon layui-icon-add-1"></i>添加内容</a>
{php}endif;{/php}
<!-- <a class="layui-btn layui-btn-primary batch_all" data-url="{:url('manager.article/attribute')}" title="批量属性"><i class="layui-icon layui-icon-batch"></i>批量属性</a>-->
<button class="layui-btn layui-btn-danger delAll" data-url="{:url('manager.article/batchDel')}"><i class="layui-icon layui-icon-delete"></i>批量删除</button>
</div>
<form class="layui-form search-form" action="{:url('manager.content/article')}" method="get">
<input type="hidden" name="__token__" value="{$_token}" />
<input type="hidden" value="{$category['id']}" name="category_id">
<div class="layui-row">
<!-- <div class="layui-inline">-->
<!-- <div class="layui-select newStyle">-->
<!-- <em>请选择</em>-->
<!-- <div class="top_box"></div>-->
<!-- <div class="lower_box">-->
<!-- <ul>-->
<!-- <li data-id="" data-val="置顶" data-checkbox="top">置顶</li>-->
<!-- <li data-id="" data-val="热门" data-checkbox="hot">热门</li>-->
<!-- <li data-id="" data-val="推荐" data-checkbox="recommend">推荐</li>-->
<!-- </ul>-->
<!-- </div>-->
<!-- <input type="hidden" class="parameter" name="" value="" />-->
<!-- <div class="checkbox_list">-->
<!-- <input type="hidden" name="param[]" data-val="置顶" value="{if in_array('top',$param)}top{/if}" />-->
<!-- <input type="hidden" name="param[]" data-val="热门" value="{if in_array('hot',$param)}hot{/if}" />-->
<!-- <input type="hidden" name="param[]" data-val="推荐" value="{if in_array('recommend',$param)}recommend{/if}" />-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="layui-inline">
<div class="layui-inline" >
<div class="layui-input-inline">
<select name="is_prev">
<option value="" >全部</option>
<option value="1" {if $Request.param.is_prev == 1}selected{/if}>活动预告</option>
<option value="0" {if $Request.param.is_prev == 0}selected{/if}>非活动预告</option>
</select>
</div>
</div>
<div class="layui-inline" >
<div class="layui-input-inline">
<input type="text" name="keyword" value="{$keyword??''}" class="layui-input search-input" placeholder="请输入关键字"/>
</div>
</div>
<div class="layui-inline" >
<div class="layui-input-inline" style="width:auto">
<input type="submit" class="layui-btn layui-btn-normal" value="搜索" />
</div>
</div>
</div>
</div>
</form>
</div>
<div class="layui-clear"></div>
<hr style="margin: 20px 0;">
<table class="layui-table layui-form layui-table-nobrder" id="check_box">
<colgroup>
<col width="15px" >
{if !in_array($category.id, [5, 37])}
<col width="75px">
{/if}
{if !in_array($category.id, [42, 37])}
<col width="75px">
{/if}
<col >
<!-- <col width="75px">-->
{if in_array($category.id, [37])}
<col width="">
{/if}
<col width="145px">
<col width="75px">
{if !empty($attributeList)}
<col width="150px">
{/if}
<col width="75px">
<col width="75px">
<col width="">
</colgroup>
<thead>
<td><input type="checkbox" lay-skin="primary" lay-filter="parents-table" title=""/></td>
{if !in_array($category.id, [5, 37])}
<td>封面</td>
{/if}
{if !in_array($category.id, [42, 37])}
<td>手机封面</td>
{/if}
{switch $category.id}
{case 37}<td>年份</td>{/case}
{default /}<td>标题</td>
{/switch}
{if in_array($category.id, [37])}
<td>月份</td>
{/if}
<!-- <td>点击量</td>-->
<td>创建日期</td>
<td>排序</td>
{if !empty($attributeList)}
<td>属性</td>
{/if}
<td>状态</td>
{if $category.id == 39}
<td>活动预告</td>
{/if}
<td>操作</td>
</thead>
{foreach name="list" item="item"}
<tr class="select_box table-lv1" data-id="{$item.id}" data-category-id="{$category.id}" data-url="{:url('manager.article/sort', ['category_id'=>$category['id']])}">
<td><input type="checkbox" name="checkbox" value="{$item.id}" lay-skin="primary" lay-filter="childrens-table"/></td>
{if !in_array($category.id, [5, 37])}
<td class="layer-photos">
{if !empty($item['src']) && file_exists('.' . $item['src'])}
<img src="{:CImage::getThumb($item.src, 50, 50)}" layer-src="{$item.src}" width="50" />
{/if}
</td>
{/if}
{if !in_array($category.id, [42, 37])}
<td class="layer-photos">
{if !empty($item['src_mobile']) && file_exists('.' . $item['src_mobile'])}
<img src="{:CImage::getThumb($item.src_mobile, 50, 50)}" layer-src="{$item.src_mobile}" width="50" />
{/if}
</td>
{/if}
<td><a class="layui-btn layui-btn-title" data-state="edit" data-href="{:url('manager.article/edit',['id' => $item['id']])}" title="编辑">{$item.title}</a></td>
{if in_array($category.id, [37])}
<td>{$item.sub_title}</td>
{/if}
<!-- <td>{$item.views}</td>-->
<td>{$item.create_time|date='Y-m-d'}</td>
<td>{$item.sort}</td>
{if !empty($attributeList)}
<td style="color: #2887fc;">{$item.top == 1 ? '置顶 ' : ''}{$item.hot == 1 ? '热门 ' : ''}{$item.recommend == 1 ? '推荐 ' : ''}</td>
{/if}
<td>
{$item.status ? '<span class="text-green">正常</span>':'<span class="text-warning">隐藏</span>'}
</td>
{if $category.id == 39}
<td>{$item.is_prev == 1 ? '是' : '否'}</td>
{/if}
<td>
<div style="width: 340px;">
{if !empty($attributeList)}
<a class="layui-btn layui-btn-primary layui-btn-xs batch_btn" data-id="{$item.id}" data-url="{:url('manager.article/attribute')}"
data-top="{$item.top?'top':''}" data-hot="{$item.hot?'hot':''}" data-recommend="{$item.recommend?'recommend':''}" title="属性选择">
<i class=""></i>属性
</a>
{/if}
<a class="sort layui-btn layui-btn-primary layui-btn-xs" data-url="{:url('manager.article/sort', ['category_id'=>$category['id']])}" data-sort="up" data-id="{$item['id']}" href="javascript:void(0)">
<i class=""></i>向上
</a>
<a class="sort layui-btn layui-btn-primary layui-btn-xs" data-url="{:url('manager.article/sort', ['category_id'=>$category['id']])}" data-sort="down" data-id="{$item['id']}" href="javascript:void(0)">
<i class=""></i>向下
</a>
<a class="layui-btn layui-btn-warm layui-btn-xs" data-state="edit" data-href="{:url('manager.article/edit',['id' => $item['id']])}" title="编辑" data-width="1300">
<i class=""></i>编辑
</a>
<a class="del layui-btn layui-btn-danger layui-btn-xs" data-url="{:url('manager.article/del')}" data-id="{$item['id']}" href="javascript:void(0);">
<i class=""></i>删除
</a>
</div>
</td>
</tr>
{/foreach}
</table>
<div class="page top30">{$list->render()|raw}</div>
</div>
</div>