From b3d33f4368aa55905d66e7b8d8d6922bb4b9cb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Mon, 27 Apr 2026 14:38:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=80=80=E7=81=AB=E6=A8=A1=E5=9D=97):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=80=E7=81=AB=E6=8A=A5=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=B9=B6=E4=BC=98=E5=8C=96=E7=8E=B0=E6=9C=89=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增退火报表页面,支持按时间、炉号等条件查询统计信息 优化退火计划和性能页面,增加当前钢卷号和逻辑库区筛选 改进KLPTable浮层组件,支持嵌套属性访问和更智能的定位 重构退火计划控制页面布局和交互,提升用户体验 --- .../KLPUI/KLPTable/FloatLayer/index.vue | 79 +++-- .../views/wms/anneal/performance/index.vue | 45 ++- .../views/wms/anneal/performance/report.vue | 147 ++++++++ klp-ui/src/views/wms/anneal/plan/ctrl.vue | 263 +++++++------- klp-ui/src/views/wms/anneal/plan/index.vue | 330 ++++++++---------- 5 files changed, 537 insertions(+), 327 deletions(-) create mode 100644 klp-ui/src/views/wms/anneal/performance/report.vue diff --git a/klp-ui/src/components/KLPUI/KLPTable/FloatLayer/index.vue b/klp-ui/src/components/KLPUI/KLPTable/FloatLayer/index.vue index 893e7c90..ea5665e9 100644 --- a/klp-ui/src/components/KLPUI/KLPTable/FloatLayer/index.vue +++ b/klp-ui/src/components/KLPUI/KLPTable/FloatLayer/index.vue @@ -41,7 +41,20 @@ export default { computed: { // 一个列要同时有用 label 和 prop 才显示在浮层中, 并且prop有值时才显示 visibleColumns() { - return this.columns.filter(field => field.label && field.prop && this.data[field.prop]) + // 辅助函数:递归/迭代获取多层嵌套的属性值 + const getNestedValue = (obj, path) => { + if (!obj || !path) return undefined; + const pathArr = Array.isArray(path) ? path : path.split('.'); + return pathArr.reduce((current, key) => { + return current === null || current === undefined ? undefined : current[key]; + }, obj); + }; + + return this.columns.filter(field => { + if (!field.label || !field.prop) return false; + const value = getNestedValue(this.data, field.prop); + return value !== null && value !== undefined && value !== ''; + }) }, // 修正后的tooltipStyle / 其实tooltipStyle只包含两个属性:top, left, 当在屏幕中无法完全展示时,需要根据实际情况调整位置 adjustedTooltipStyle() { @@ -51,31 +64,44 @@ export default { let adjustedTop = parseInt(top); let adjustedLeft = parseInt(left); - const offset = 16; + const offset = 20; + const scrollY = window.pageYOffset || document.documentElement.scrollTop; + + // 考虑页面滚动的影响 + adjustedTop += scrollY; - // 检查是否超出底部边界 - 如果超出,将浮层显示在鼠标上方 - if (adjustedTop + tooltipRect.height > window.innerHeight) { - adjustedTop = adjustedTop - tooltipRect.height - offset; + // 先尝试显示在右下方 + let finalTop = adjustedTop; + let finalLeft = adjustedLeft; + + // 检查是否超出右边界,如果超出则显示在左方 + if (finalLeft + tooltipRect.width > window.innerWidth + (window.pageXOffset || 0)) { + finalLeft = adjustedLeft - tooltipRect.width - offset; } - // 检查是否超出右侧边界 - 如果超出,将浮层显示在鼠标左侧 - if (adjustedLeft + tooltipRect.width > window.innerWidth) { - adjustedLeft = adjustedLeft - tooltipRect.width - offset; + // 检查是否超出下边界,如果超出则显示在上方 + if (finalTop + tooltipRect.height > window.innerHeight + scrollY) { + finalTop = adjustedTop - tooltipRect.height - offset; } - // 检查是否超出顶部边界 - if (adjustedTop < 0) { - adjustedTop = offset; + // 确保浮层不会超出上边界 + if (finalTop < scrollY) { + finalTop = scrollY + offset; } - // 检查是否超出左侧边界 - if (adjustedLeft < 0) { - adjustedLeft = offset; + // 确保浮层不会超出左边界 + if (finalLeft < 0) { + finalLeft = offset; + } + + // 再次检查并调整右边界 + if (finalLeft + tooltipRect.width > window.innerWidth + (window.pageXOffset || 0)) { + finalLeft = Math.max(offset, (window.innerWidth - tooltipRect.width) / 2); } return { - top: `${adjustedTop}px`, - left: `${adjustedLeft}px` + top: `${finalTop}px`, + left: `${finalLeft}px` }; } }, @@ -117,32 +143,39 @@ export default { position: absolute; background: #ffffff; border: 1px solid #dcdcdc; - border-radius: 4px; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); - padding: 12px 14px; + border-radius: 8px; + box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); + padding: 16px 18px; pointer-events: none; z-index: 9999; overflow: auto; - transition: all 0.3s ease-in-out; + transition: all 0.25s ease-out; + max-height: 75vh; + min-width: 420px; } .tooltip-list { display: grid; - gap: 8px; + gap: 10px 16px; + grid-template-columns: repeat(2, 1fr); } .tooltip-item { display: flex; align-items: flex-start; + line-height: 1.5; } .tooltip-item .label { flex-shrink: 0; - color: #666; + color: #909399; + font-weight: 500; + min-width: 90px; } .tooltip-item .value { - color: #333; + color: #303133; word-break: break-word; + flex: 1; } \ No newline at end of file diff --git a/klp-ui/src/views/wms/anneal/performance/index.vue b/klp-ui/src/views/wms/anneal/performance/index.vue index 2e09a570..aac5b45d 100644 --- a/klp-ui/src/views/wms/anneal/performance/index.vue +++ b/klp-ui/src/views/wms/anneal/performance/index.vue @@ -21,6 +21,12 @@ + + + + + + 查询 重置 @@ -57,16 +63,31 @@ + + + + + + + + + diff --git a/klp-ui/src/views/wms/anneal/plan/ctrl.vue b/klp-ui/src/views/wms/anneal/plan/ctrl.vue index 9972180f..7ea5ccb3 100644 --- a/klp-ui/src/views/wms/anneal/plan/ctrl.vue +++ b/klp-ui/src/views/wms/anneal/plan/ctrl.vue @@ -1,6 +1,6 @@