add:task.html
parent
c98c52be29
commit
9f96c52458
|
|
@ -26,6 +26,9 @@ layui.define([], function(exprots) {
|
||||||
article: {
|
article: {
|
||||||
list: "https://www.easy-mock.com/mock/5d5d0dd46cfcbd1b8627bf1d/ok-admin-v2.0/article/list"
|
list: "https://www.easy-mock.com/mock/5d5d0dd46cfcbd1b8627bf1d/ok-admin-v2.0/article/list"
|
||||||
},
|
},
|
||||||
|
task: {
|
||||||
|
list: "https://www.easy-mock.com/mock/5d5d0dd46cfcbd1b8627bf1d/ok-admin-v2.0/task/list"
|
||||||
|
},
|
||||||
product: {
|
product: {
|
||||||
list: "https://www.easy-mock.com/mock/5d5d0dd46cfcbd1b8627bf1d/ok-admin-v2.0/product/list"
|
list: "https://www.easy-mock.com/mock/5d5d0dd46cfcbd1b8627bf1d/ok-admin-v2.0/product/list"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
<script src="../../lib/layui/layui.js"></script>
|
<script src="../../lib/layui/layui.js"></script>
|
||||||
<script>
|
<script>
|
||||||
layui.use(["element", "table", "form", "laydate", "okLayer", "okUtils", "okMock"], function () {
|
layui.use(["element", "table", "form", "laydate", "okLayer", "okUtils", "okMock"], function () {
|
||||||
|
var element = layui.element;
|
||||||
var table = layui.table;
|
var table = layui.table;
|
||||||
var form = layui.form;
|
var form = layui.form;
|
||||||
var util = layui.util;
|
var util = layui.util;
|
||||||
|
|
@ -52,7 +53,7 @@
|
||||||
|
|
||||||
var articleTable = table.render({
|
var articleTable = table.render({
|
||||||
elem: "#tableId",
|
elem: "#tableId",
|
||||||
url: okMock.api.article.list,
|
url: okMock.api.task.list,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
page: true,
|
page: true,
|
||||||
even: true,
|
even: true,
|
||||||
|
|
@ -61,16 +62,18 @@
|
||||||
cols: [[
|
cols: [[
|
||||||
{type: "checkbox", fixed: "left"},
|
{type: "checkbox", fixed: "left"},
|
||||||
{field: "guid", title: "GUID", width: 280, sort: true},
|
{field: "guid", title: "GUID", width: 280, sort: true},
|
||||||
{field: "title", title: "标题", width: 350},
|
{field: "name", title: "任务名称", width: 350},
|
||||||
{field: "url", title: "链接", width: 250, templet: "#urlTpl"},
|
{field: "createTime", title: "任务创建时间", width: 150},
|
||||||
{field: "publisher", title: "发布者", width: 100},
|
{field: "startTime", title: "任务开始时间", width: 150},
|
||||||
{field: "readSize", title: "阅读量", width: 80},
|
{field: "endTime", title: "任务结束时间", width: 150},
|
||||||
{field: "isTop", title: "是否置顶", width: 100, align: "center", templet: "#topTpl"},
|
{field: "createUser", title: "任务创建人", width: 100},
|
||||||
{field: "status", title: "发布状态", width: 110, align: "center", templet: "#statusTpl"},
|
{field: "progress", title: "任务进度", width: 200, templet: "#progressTpl"},
|
||||||
|
{field: "status", title: "任务状态", width: 110, align: "center", templet: "#statusTpl"},
|
||||||
{title: "操作", width: 100, align: "center", fixed: "right", templet: "#operationTpl"}
|
{title: "操作", width: 100, align: "center", fixed: "right", templet: "#operationTpl"}
|
||||||
]],
|
]],
|
||||||
done: function (res, curr, count) {
|
done: function (res, curr, count) {
|
||||||
console.log(res, curr, count)
|
console.log(res, curr, count);
|
||||||
|
element.init();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -189,34 +192,26 @@
|
||||||
<button class="layui-btn layui-btn-sm" lay-event="add">添加文章</button>
|
<button class="layui-btn layui-btn-sm" lay-event="add">添加文章</button>
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</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>
|
|
||||||
{{# } }}
|
|
||||||
</script>
|
|
||||||
<!-- 行工具栏模板 -->
|
<!-- 行工具栏模板 -->
|
||||||
<script type="text/html" id="operationTpl">
|
<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="edit"><i class="layui-icon"></i></a>
|
||||||
<a href="javascript:" title="删除" lay-event="del"><i class="layui-icon"></i></a>
|
<a href="javascript:" title="删除" lay-event="del"><i class="layui-icon"></i></a>
|
||||||
</script>
|
</script>
|
||||||
|
<!-- 任务进度 -->
|
||||||
|
<script type="text/html" id="progressTpl">
|
||||||
|
<div class="layui-progress">
|
||||||
|
<div class="layui-progress-bar" lay-percent="{{d.progress}}"></div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
<!-- 任务状态 -->
|
||||||
|
<script type="text/html" id="statusTpl">
|
||||||
|
{{# 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>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue