projectmanager/app/product/view/index/index.html
2025-06-25 10:53:11 +08:00

72 lines
3.0 KiB
HTML

{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="breadcrumb"}
<span class="layui-breadcrumb">
<a href="http://www.meteteme.com/" target="_blank">江苏美天科技</a>
<a><cite>产品中心</cite></a>
</span>
{/block}
{block name="body"}
<div class="table-content p-3">
<div class="layui-form-bar border-t border-x">
<button class="layui-btn layui-btn-sm add-new">+ 新建产品</button>
</div>
<table class="layui-hide" id="product" lay-filter="product"></table>
</div>
{/block}
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','gouguEdit','gouguComment'];
function gouguInit() {
var table = layui.table, tool = layui.tool;
layui.pageTable = table.render({
elem: '#product',
title: '产品列表',
cellMinWidth: 80,
url: "/product/index/index", //数据接口
page: true, //开启分页
limit: 20,
height: 'full-130',
cols: [[
{
field: 'id', title: '产品编号', width: 100, align: 'center', fixed: 'left', rowspan: 2, templet: function (d) {
return 'P' + d.id;
}
}
, {
field: 'status', title: '状态', align: 'center', width: 100, rowspan: 2, templet: function (d) {
var html = '<span class="layui-btn layui-btn-xs bg-status-' + d.status + '">' + d.status_name + '</span>';
return html;
}
}
, {
field: 'name', title: '产品名称', align: 'center', rowspan: 2, templet: function (d) {
var className = d.is_own == 1 ? 'ziyan' : 'feiziyan';
var text = d.is_own == 1 ? '自研' : '非自研';
var html = '<div style="display:grid;justify-content:center"><a class="open-a" data-href="/product/index/view/id/' + d.id + '" style="display: flex;justify-content: center;align-items: center;"><span class="' + className + '" style="float:left">' + text + '</span>' + '<p style="float:left">' + d.name + '</p>' + '</a></div>';
return html;
}
}
, { field: 'director_name', title: '负责人', align: 'center', width: 80, rowspan: 2 }
, { field: 'admin_name', title: '创建人', align: 'center', width: 80, rowspan: 2 }
, { field: 'projects', title: '关联项目', align: 'center', width: 100, rowspan: 2 }
, { align: 'center', title: '关联任务', colspan: 3 }
, { align: 'center', title: 'BUG缺陷', colspan: 3 }
], [
{ field: 'tasks_a_unfinish', align: 'center', style: 'color: #91CC75;', width: 80, 'title': '进行中' }
, { field: 'tasks_a_finish', align: 'center', style: 'color: #FAC858;', width: 80, 'title': '已完成' }
, { field: 'tasks_a_pensent', align: 'center', style: 'color: #EE6666;', width: 80, 'title': '完成率' }
, { field: 'tasks_b_unfinish', align: 'center', style: 'color: #91CC75;', width: 80, 'title': '进行中' }
, { field: 'tasks_b_finish', align: 'center', style: 'color: #FAC858;', width: 80, 'title': '已完成' }
, { field: 'tasks_b_pensent', align: 'center', style: 'color: #EE6666;', width: 80, 'title': '修复率' }
]]
});
$('.add-new').on('click', function () {
tool.open('/product/index/add');
});
}
</script>
{/block}