71 lines
2.3 KiB
HTML
71 lines
2.3 KiB
HTML
{extend name="../../base/view/common/base" /}
|
|
<!-- 主体 -->
|
|
{block name="body"}
|
|
<div class="p-3">
|
|
<table class="layui-hide" id="projectList" lay-filter="project"></table>
|
|
</div>
|
|
<script type="text/html" id="toolbarDemo">
|
|
<div class="layui-btn-container">
|
|
<button class="layui-btn layui-btn-sm" lay-event="add">+ 新建项目</button>
|
|
</div>
|
|
</script>
|
|
{/block}
|
|
<!-- /主体 -->
|
|
|
|
<!-- 脚本 -->
|
|
{block name="script"}
|
|
<script>
|
|
const moduleInit = ['tool'];
|
|
function gouguInit() {
|
|
var table = layui.table, form = layui.form, tool = layui.tool;
|
|
layui.pageTable = table.render({
|
|
elem: '#projectList',
|
|
toolbar: '#toolbarDemo',
|
|
title: '项目列表',
|
|
cellMinWidth: 220,
|
|
page: true, //开启分页
|
|
limit: 20,
|
|
url: "/project/index/index", //数据接口
|
|
cols: [[
|
|
{
|
|
field: 'id', title: '项目编号', width: 80, align: 'center', fixed: 'left', rowspan: 2, templet: function (d) {
|
|
return 'P' + d.id;
|
|
}
|
|
}
|
|
, {
|
|
field: 'status', title: '状态', align: 'center', width: 70, rowspan: 2, templet: function (d) {
|
|
var html = '<span class="layui-btn layui-btn-xs layui-bg-' + d.status + '">' + d.status_name + '</span>';
|
|
return html;
|
|
}
|
|
}
|
|
, {
|
|
field: 'name', title: '项目名称', rowspan: 2, templet: function (d) {
|
|
var html = '<a class="side-a" data-href="/project/index/view/id/' + d.id + '">' + d.name + '</a>';
|
|
return html;
|
|
}
|
|
}
|
|
, { field: 'plan_time', title: '项目周期', align: 'center', width: 190, rowspan: 2 }
|
|
,{field: 'step',title: '当前阶段及负责人',align: 'center',width: 140,rowspan: 2 }
|
|
, { align: 'center', title: '关联任务', colspan: 3 }
|
|
, { field: 'director_name', fixed: 'right', title: '负责人', align: 'center', width: 80, rowspan: 2 }
|
|
], [
|
|
{ field: 'tasks_unfinish', align: 'center', style: 'color: #91CC75;', width: 72, 'title': '进行中' }
|
|
, { field: 'tasks_finish', align: 'center', style: 'color: #FAC858;', width: 70, 'title': '已完成' }
|
|
, { field: 'tasks_pensent', align: 'center', style: 'color: #EE6666;', width: 72, 'title': '完成率' }
|
|
]]
|
|
});
|
|
|
|
|
|
//触发事件
|
|
table.on('toolbar(project)', function(obj){
|
|
var checkStatus = table.checkStatus(obj.config.id);
|
|
switch(obj.event){
|
|
case 'add':
|
|
tool.side('/project/index/add');
|
|
break;
|
|
};
|
|
});
|
|
}
|
|
</script>
|
|
{/block}
|
|
<!-- /脚本 --> |