From bdef1ebb6d96dd60c6c5f500b16090f83bf1a48d Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 27 Jan 2026 13:47:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engineeringSafetyAnalysis.js | 12 ++- .../resourceRateAnalysis.js | 29 +++++-- .../engineeringSafetyAnalysis.html | 80 +++++++++++++++++-- 3 files changed, 108 insertions(+), 13 deletions(-) diff --git a/js/pages/dataAnalysisOctober/engineeringSafetyAnalysis.js b/js/pages/dataAnalysisOctober/engineeringSafetyAnalysis.js index a22b60d..4f12dcd 100644 --- a/js/pages/dataAnalysisOctober/engineeringSafetyAnalysis.js +++ b/js/pages/dataAnalysisOctober/engineeringSafetyAnalysis.js @@ -634,7 +634,17 @@ function initEnvironmentRecordTable() { return '查看'; } }, - { field: 'analysis', title: '分析改进', width: '6%', align: 'center' }, + { + field: 'analysis', + title: '分析改进', + width: '18%', + align: 'left', + fixed: 'right', + templet: function (d) { + const text = d.analysis || ''; + return '
' + text + '
'; + } + }, // { // title: '分析改进', width: '8%', align: 'center', templet: function (d) { // return '分析与改进'; diff --git a/js/pages/dataAnalysisOctober/resourceRateAnalysis.js b/js/pages/dataAnalysisOctober/resourceRateAnalysis.js index 41a66f1..4fd209e 100644 --- a/js/pages/dataAnalysisOctober/resourceRateAnalysis.js +++ b/js/pages/dataAnalysisOctober/resourceRateAnalysis.js @@ -107,7 +107,7 @@ function getTeamUtilizationList() { console.log(result, '班组人员利用率排名列表'); if (result && Array.isArray(result)) { // 如果返回的是数组,直接使用 - updateTeamTable(result); + updateTeamTable(result.data); } else if (result && result.data && Array.isArray(result.data)) { // 如果返回的是对象,取data字段 updateTeamTable(result.data); @@ -358,13 +358,20 @@ function updateTeamTable(data) { return; } - // 映射数据字段 + // 调试:打印第一条数据查看字段名 + if (data.length > 0) { + console.log('第一条数据字段:', data[0]); + } + + // 映射数据字段(尝试多个可能的字段名) const tableData = data.map(item => ({ workType: item.workType || '', teamName: item.teamName || '', teamLeader: item.teamLeader || '', - totalPeople: item.totalPeople || 0, - todayDuty: item.dutyNum || 0, + // 尝试多个可能的字段名:peopleNum, totalPeople, teamPeople + teamPeople: item.peopleNum || item.totalPeople || item.teamPeople || 0, + // dutyNum 应该是正确的字段名 + dutyPeople: item.dutyNum || 0, utilizationRate: item.userRate || '0.00%' })); @@ -460,8 +467,18 @@ function initTeamTable() { { field: 'workType', title: '专业', width: '16%', align: 'center' }, { field: 'teamName', title: '班组', width: '18%', align: 'center' }, { field: 'teamLeader', title: '班组负责人', width: '16%', align: 'center' }, - { field: 'totalPeople', title: '班组人数', width: '14%', align: 'center' }, - { field: 'todayDuty', title: '当日到岗', width: '14%', align: 'center' }, + { + field: 'teamPeople', title: '班组人数', width: '14%', align: 'center', + templet: function (d) { + return '' + (d.teamPeople || 0) + ''; + } + }, + { + field: 'dutyPeople', title: '当日到岗', width: '14%', align: 'center', + templet: function (d) { + return '' + (d.dutyPeople || 0) + ''; + } + }, { field: 'utilizationRate', title: '利用率', diff --git a/pages/dataAnalysisOctober/engineeringSafetyAnalysis.html b/pages/dataAnalysisOctober/engineeringSafetyAnalysis.html index 2955855..591cc09 100644 --- a/pages/dataAnalysisOctober/engineeringSafetyAnalysis.html +++ b/pages/dataAnalysisOctober/engineeringSafetyAnalysis.html @@ -298,7 +298,7 @@ .table-container { flex: 1; overflow-y: auto; - overflow-x: hidden; + overflow-x: auto; position: relative; min-height: 0; padding: 0 10px; @@ -310,35 +310,62 @@ } .table-module .layui-table thead tr { - background-color: rgba(13, 34, 37, 0.8) !important; + background-color: rgba(13, 34, 37, 0.6) !important; } .table-module .layui-table thead th { - background-color: transparent !important; + background-color: rgba(13, 34, 37, 0.6) !important; color: #FFFFFF !important; border-color: rgba(6, 189, 221, 0.3) !important; font-weight: bold; } .table-module .layui-table tbody tr { - background-color: rgba(25, 62, 68, 0.3) !important; + background-color: rgba(25, 62, 68, 0.2) !important; } .table-module .layui-table tbody tr:hover { - background-color: rgba(25, 62, 68, 0.6) !important; + background-color: rgba(25, 62, 68, 0.4) !important; } .table-module .layui-table tbody td { + background-color: rgba(25, 62, 68, 0.2) !important; color: #FFFFFF !important; border-color: rgba(6, 189, 221, 0.2) !important; } .table-module .layui-table-page { - background-color: transparent !important; + background-color: rgba(13, 34, 37, 0.5) !important; border-top: 1px solid rgba(6, 189, 221, 0.3) !important; padding: 10px 0 !important; } + /* 确保表格主体有滚动条 */ + .table-module .layui-table-body { + overflow-y: auto !important; + overflow-x: auto !important; + } + + /* 表格主体滚动条样式 */ + .table-module .layui-table-body::-webkit-scrollbar { + width: 8px; + height: 8px; + } + + .table-module .layui-table-body::-webkit-scrollbar-track { + background: rgba(13, 34, 37, 0.5); + border-radius: 4px; + } + + .table-module .layui-table-body::-webkit-scrollbar-thumb { + background: rgba(6, 189, 221, 0.6); + border-radius: 4px; + } + + .table-module .layui-table-body::-webkit-scrollbar-thumb:hover { + background: rgba(6, 189, 221, 0.8); + } + .table-module .layui-table-page .layui-laypage { margin: 0 !important; } @@ -492,6 +519,47 @@ height: 100%; object-fit: contain; } + + /* 分析改进列文本样式 - 限制最多显示2行 */ + .analysis-text-cell { + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + text-overflow: ellipsis; + word-break: break-word; + line-height: 1.5; + max-height: 3em; + /* 2行的高度,1.5行高 * 2 */ + padding: 4px 8px; + color: #FFFFFF; + background-color: #16BAAA; + } + + /* 确保固定列样式正确 */ + .table-module .layui-table-fixed-r { + box-shadow: -2px 0 6px rgba(0, 0, 0, 0.3); + background-color: rgba(13, 34, 37, 0.7) !important; + } + + /* 固定列表头背景 */ + .table-module .layui-table-fixed-r .layui-table-header { + background-color: rgba(13, 34, 37, 0.6) !important; + } + + /* 固定列单元格背景 */ + .table-module .layui-table-fixed-r .layui-table-body td { + background-color: rgba(25, 62, 68, 1) !important; + } + + .table-module .layui-table-fixed-r .layui-table-body tr:hover td { + background-color: rgba(25, 62, 68, 0.4) !important; + } + + /* 分析改进列单元格背景 */ + .table-module .layui-table tbody td .analysis-text-cell { + background-color: transparent !important; + }