mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-22 06:49:15 +08:00
修改模板文件
This commit is contained in:
parent
96f2c438a2
commit
f71819fc16
@ -32,8 +32,8 @@ class Item extends Controller
|
||||
$this->title = '文章内容管理';
|
||||
$this->marks = DataNewsMark::items();
|
||||
}, function (QueryHelper $query) {
|
||||
$query->like('code,name')->like('mark', ',')->dateBetween('create_at');
|
||||
$query->where(['status' => intval($this->type === 'index'), 'deleted' => 0]);
|
||||
$query->like('name')->like('mark', ',')->dateBetween('create_at');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<!--{notempty name='marks'}-->
|
||||
<div class="layui-form-item label-required-prev">
|
||||
<span class="help-label"><b>资讯标签</b>News Mark</span>
|
||||
<span class="help-label"><b>文章标签</b>News Mark</span>
|
||||
<div class="layui-textarea help-checks">
|
||||
{foreach $marks as $tag}{if isset($vo.mark) && is_array($vo.mark) && in_array($tag.name, $vo.mark)}
|
||||
<label class="think-checkbox notselect"><input checked lay-ignore name="mark[]" type="checkbox" value="{$tag.name}"> {$tag.name}</label>
|
||||
@ -18,22 +18,22 @@
|
||||
<!--{/notempty}-->
|
||||
|
||||
<div class="layui-form-item label-required-prev">
|
||||
<span class="help-label"><b>资讯封面</b>News Conver</span>
|
||||
<span class="help-label"><b>文章封面</b>News Conver</span>
|
||||
<div class="relative block label-required-null">
|
||||
<input class="layui-input think-bg-gray" name="cover" placeholder="请上传资讯封面" readonly required value='{$vo.cover|default=""}'>
|
||||
<input class="layui-input think-bg-gray" name="cover" placeholder="请上传文章封面" readonly required value='{$vo.cover|default=""}'>
|
||||
<a class="layui-icon layui-icon-upload input-right-icon" data-file data-field="cover" data-type="gif,png,jpg,jpeg"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="layui-form-item relative block">
|
||||
<span class="help-label"><b>资讯标题</b>News Title</span>
|
||||
<input class="layui-input" name="name" placeholder="请输入资讯标题" required value='{$vo.name|default=""}'>
|
||||
<span class="help-label"><b>文章标题</b>News Title</span>
|
||||
<input class="layui-input" name="name" placeholder="请输入文章标题" required value='{$vo.name|default=""}'>
|
||||
</label>
|
||||
|
||||
<div class="layui-form-item label-required-prev">
|
||||
<span class="help-label"><b>资讯内容</b>News Content</span>
|
||||
<span class="help-label"><b>文章内容</b>News Content</span>
|
||||
<label class="relative block">
|
||||
<textarea class="layui-hide" name="content" placeholder="请输入资讯内容">{$vo.content|default=''}</textarea>
|
||||
<textarea class="layui-hide" name="content" placeholder="请输入文章内容">{$vo.content|default=''}</textarea>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
@ -2,18 +2,18 @@
|
||||
|
||||
{block name="button"}
|
||||
<!--{if auth("add")}-->
|
||||
<button data-open='{:url("add")}' class='layui-btn layui-btn-sm layui-btn-primary'>添加资讯</button>
|
||||
<button data-open='{:url("add")}' class='layui-btn layui-btn-sm layui-btn-primary'>添加文章</button>
|
||||
<!--{/if}-->
|
||||
|
||||
<!--{if auth("remove")}-->
|
||||
<button data-action='{:url("remove")}' data-table-id="NewsTable" data-rule="id#{id}" data-confirm="确定要批量删除资讯吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
|
||||
<button data-action='{:url("remove")}' data-table-id="NewsTable" data-rule="id#{id}" data-confirm="确定要批量删除文章吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
|
||||
<!--{/if}-->
|
||||
{/block}
|
||||
|
||||
{block name="content"}
|
||||
<div class="layui-tab layui-tab-card">
|
||||
<ul class="layui-tab-title">
|
||||
{foreach ['index'=>'资讯管理','recycle'=>'回 收 站'] as $k=>$v}{if isset($type) and $type eq $k}
|
||||
{foreach ['index'=>'文章管理','recycle'=>'回 收 站'] as $k=>$v}{if isset($type) and $type eq $k}
|
||||
<li data-open="{:url('index')}?type={$k}" class="layui-this color-green">{$v}</li>
|
||||
{else}
|
||||
<li data-open="{:url('index')}?type={$k}">{$v}</li>
|
||||
@ -40,14 +40,14 @@
|
||||
{field: 'id', title: 'ID', align: "left", width: 80},
|
||||
/* {notempty name='marks'} */
|
||||
{
|
||||
field: 'mark', title: '资讯标签', align: 'left', minWidth: 100, templet: function (d) {
|
||||
field: 'mark', title: '文章标签', align: 'left', minWidth: 100, templet: function (d) {
|
||||
return (d.html = ''), d.mark.forEach(function (val) {
|
||||
d.html += '<span class="layui-badge layui-bg-blue">' + val + '</span>';
|
||||
}), d.html;
|
||||
}
|
||||
},
|
||||
/* {/marks} */
|
||||
{field: 'name', title: '资讯标题', align: 'left', minWidth: 140},
|
||||
{field: 'name', title: '文章标题', align: 'left', minWidth: 140},
|
||||
{field: 'num_read', title: '阅读数', align: 'center', minWidth: 80, sort: true, style: 'color:blue;font-size:16px'},
|
||||
{field: 'status', title: '状态', align: 'center', minWidth: 110, templet: '#StatusSwitchTpl'},
|
||||
{field: 'create_at', title: '创建时间', align: 'center', minWidth: 170, sort: true},
|
||||
@ -92,7 +92,7 @@
|
||||
<!--{/if}-->
|
||||
|
||||
<!--{if auth("remove") and isset($type) and $type neq 'index'}-->
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm" data-action="{:url('remove')}" data-value="id#{{d.id}}" data-confirm="确定要删除资讯吗?">删 除</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm" data-action="{:url('remove')}" data-value="id#{{d.id}}" data-confirm="确定要删除文章吗?">删 除</a>
|
||||
<!--{/if}-->
|
||||
</script>
|
||||
{/block}
|
@ -4,10 +4,10 @@
|
||||
|
||||
<!-- {notempty name='marks'} -->
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">资讯标签</label>
|
||||
<label class="layui-form-label">文章标签</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="mark" lay-search class="layui-select">
|
||||
<option value=''>-- 资讯标签 --</option>
|
||||
<option value=''>-- 文章标签 --</option>
|
||||
{foreach $marks as $mark}{if isset($get.mark) and $mark eq $get.mark}
|
||||
<option selected value="{$mark.name}">{$mark.name}</option>
|
||||
{else}
|
||||
@ -19,25 +19,17 @@
|
||||
<!-- {/notempty} -->
|
||||
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">资讯标题</label>
|
||||
<label class="layui-form-label">文章编号</label>
|
||||
<label class="layui-input-inline">
|
||||
<input class="layui-input" name="name" placeholder="请输入资讯标题" value="{$get.name|default=''}">
|
||||
<input class="layui-input" name="code" placeholder="请输入文章编号" value="{$get.code|default=''}">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">使用状态</label>
|
||||
<div class="layui-input-inline">
|
||||
<select class="layui-select" name="status">
|
||||
<option value=''>-- 全部 --</option>
|
||||
{foreach ['显示禁用的资讯', '显示正常的资讯'] as $k=>$v}
|
||||
{if isset($get.status) and $get.status eq $k.''}
|
||||
<option selected value="{$k}">{$v}</option>
|
||||
{else}
|
||||
<option value="{$k}">{$v}</option>
|
||||
{/if}{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<label class="layui-form-label">文章标题</label>
|
||||
<label class="layui-input-inline">
|
||||
<input class="layui-input" name="name" placeholder="请输入文章标题" value="{$get.name|default=''}">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-inline">
|
||||
|
@ -5,10 +5,10 @@
|
||||
<form action="{:sysuri()}" id="NewsTableSearch" autocomplete="off" class="layui-form layui-form-pane form-search" method="get" onsubmit="return false">
|
||||
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">资讯标签</label>
|
||||
<label class="layui-form-label">文章标签</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="mark" class="layui-select" lay-search>
|
||||
<option value=''>-- 资讯标签 --</option>
|
||||
<option value=''>-- 文章标签 --</option>
|
||||
{foreach $marks as $mark}{if isset($get.mark) and $mark.code eq $get.mark}
|
||||
<option selected value="{$mark.code}">{$mark.name} ( {$mark.code} )</option>
|
||||
{else}
|
||||
@ -19,9 +19,9 @@
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">资讯标题</label>
|
||||
<label class="layui-form-label">文章标题</label>
|
||||
<label class="layui-input-inline">
|
||||
<input class="layui-input" name="name" placeholder="请输入资讯标题" value="{$get.name|default=''}">
|
||||
<input class="layui-input" name="name" placeholder="请输入文章标题" value="{$get.name|default=''}">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@ -50,8 +50,8 @@
|
||||
sort: {field: 'sort desc,id', type: 'desc'},
|
||||
cols: [[
|
||||
{field: 'id', title: 'ID', align: 'center', width: 60, sort: true},
|
||||
{field: 'mark', title: '资讯标签', align: 'center', width: 100},
|
||||
{field: 'name', title: '资讯标题', align: 'left', minWidth: 140},
|
||||
{field: 'mark', title: '文章标签', align: 'center', width: 100},
|
||||
{field: 'name', title: '文章标题', align: 'left', minWidth: 140},
|
||||
{field: 'num_read', title: '阅读数', align: 'center', width: 80, sort: true, style: 'color:blue;font-size:16px'},
|
||||
{field: 'status', title: '状态', align: 'center', width: 80, templet: '#StatusSwitchTpl'},
|
||||
{field: 'create_at', title: '创建时间', align: 'center', width: 170, sort: true},
|
||||
|
Loading…
x
Reference in New Issue
Block a user