add:链接列表
parent
0df414ae56
commit
a1d40b7f82
|
|
@ -29,6 +29,9 @@ layui.define([], function(exprots) {
|
|||
task: {
|
||||
list: "https://www.easy-mock.com/mock/5d5d0dd46cfcbd1b8627bf1d/ok-admin-v2.0/task/list"
|
||||
},
|
||||
link: {
|
||||
list: "https://www.easy-mock.com/mock/5d5d0dd46cfcbd1b8627bf1d/ok-admin-v2.0/link/list"
|
||||
},
|
||||
product: {
|
||||
list: "https://www.easy-mock.com/mock/5d5d0dd46cfcbd1b8627bf1d/ok-admin-v2.0/product/list"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
var articleTable = table.render({
|
||||
elem: "#tableId",
|
||||
url: okMock.api.article.list,
|
||||
url: okMock.api.link.list,
|
||||
limit: 20,
|
||||
page: true,
|
||||
even: true,
|
||||
|
|
@ -61,12 +61,11 @@
|
|||
cols: [[
|
||||
{type: "checkbox", fixed: "left"},
|
||||
{field: "guid", title: "GUID", width: 280, sort: true},
|
||||
{field: "title", title: "标题", width: 350},
|
||||
{field: "name", title: "名称", width: 350},
|
||||
{field: "remarks", title: "备注", width: 350},
|
||||
{field: "url", title: "链接", width: 250, templet: "#urlTpl"},
|
||||
{field: "publisher", title: "发布者", width: 100},
|
||||
{field: "readSize", title: "阅读量", width: 80},
|
||||
{field: "isTop", title: "是否置顶", width: 100, align: "center", templet: "#topTpl"},
|
||||
{field: "status", title: "发布状态", width: 110, align: "center", templet: "#statusTpl"},
|
||||
{field: "status", title: "状态", width: 110, align: "center", templet: "#statusTpl"},
|
||||
{field: "createTime", title: "创建时间", width: 150},
|
||||
{title: "操作", width: 100, align: "center", fixed: "right", templet: "#operationTpl"}
|
||||
]],
|
||||
done: function (res, curr, count) {
|
||||
|
|
@ -189,34 +188,26 @@
|
|||
<button class="layui-btn layui-btn-sm" lay-event="add">添加文章</button>
|
||||
</div>
|
||||
</script>
|
||||
<!-- 链接模板 -->
|
||||
<!-- 行工具栏模板 -->
|
||||
<script type="text/html" id="operationTpl">
|
||||
<a href="javascript:" title="编辑" lay-event="edit"><i class="layui-icon"></i></a>
|
||||
<a href="javascript:" title="删除" lay-event="del"><i class="layui-icon"></i></a>
|
||||
</script>
|
||||
<!-- 链接 -->
|
||||
<script type="text/html" id="urlTpl">
|
||||
<a href="{{d.url}}" target="_blank">{{d.url}}</a>
|
||||
</script>
|
||||
<!-- 是否指顶模板
|
||||
<input type="checkbox" name="isTop" value="{{d.isTop}}" lay-skin="switch" lay-text="是|否" {{ d.isTop== true ? 'checked' : ''}}>
|
||||
-->
|
||||
<script type="text/html" id="topTpl">
|
||||
{{# if(d.isTop == true){ }}
|
||||
<span class="layui-btn layui-btn-normal layui-btn-xs">已置顶</span>
|
||||
{{# } else if(d.isTop == false) { }}
|
||||
<span class="layui-btn layui-btn-warm layui-btn-xs">未置顶</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
<!-- 发布状态模板
|
||||
<input type="checkbox" name="top" value="{{d.status}}" lay-skin="switch" lay-text="已发布|未发布" {{ d.status== true ? 'checked' : ''}}>
|
||||
-->
|
||||
|
||||
<!-- 发布-->
|
||||
<script type="text/html" id="statusTpl">
|
||||
{{# if(d.status == true){ }}
|
||||
<span class="layui-btn layui-btn-normal layui-btn-xs">已发布</span>
|
||||
{{# } else if(d.status == false) { }}
|
||||
<span class="layui-btn layui-btn-warm layui-btn-xs">未发布</span>
|
||||
{{# if(d.status == 0){ }}
|
||||
<span class="layui-btn layui-btn-normal layui-btn-xs">已显示</span>
|
||||
{{# } else if(d.status == 1) { }}
|
||||
<span class="layui-btn layui-btn-warm layui-btn-xs">未显示</span>
|
||||
{{# } else if(d.status == 2) { }}
|
||||
<span class="layui-btn layui-btn-danger layui-btn-xs">已删除</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
<!-- 行工具栏模板 -->
|
||||
<script type="text/html" id="operationTpl">
|
||||
<a href="javascript:" title="编辑" lay-event="edit"><i class="layui-icon"></i></a>
|
||||
<a href="javascript:" title="删除" lay-event="del"><i class="layui-icon"></i></a>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue