From d8afca21b4b46672a58fda8adee8902a26675ebf Mon Sep 17 00:00:00 2001 From: huangjinysf Date: Sun, 4 Jan 2026 13:33:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(RealTimeInventory):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E6=82=AC=E5=81=9C=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加getCellTooltip方法用于显示单元格的机台信息和完成度百分比 --- src/views/plan/RealTimeInventory.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/views/plan/RealTimeInventory.vue b/src/views/plan/RealTimeInventory.vue index d71d7c2..42552be 100644 --- a/src/views/plan/RealTimeInventory.vue +++ b/src/views/plan/RealTimeInventory.vue @@ -53,6 +53,7 @@ padding: '8px 0', transition: 'background-color 0.3s ease' }" + :title="getCellTooltip(scope.row.specification, column.prop)" > {{ scope.row[column.prop] || '-' }} @@ -507,6 +508,19 @@ const getEquipmentCodeColor = (specification, columnProp) => { return status.equipment_color; }; +// 方法:获取单元格悬停提示 +const getCellTooltip = (specification, columnProp) => { + // 构建包含规格的key + const keyWithSpec = `${columnProp}::${specification}`; + + if (!uidProductionStatusMap.value.has(keyWithSpec)) { + return ''; + } + + const status = uidProductionStatusMap.value.get(keyWithSpec); + return `机台: ${status.equipment_code}\n完成度: ${(status.wight_completion/100).toFixed(2)}%`; +}; + // 方法:刷新数据 const refreshData = () => { fetchData();