From 059c59b002dbeb2ff2294ec5042851cba8e9c146 Mon Sep 17 00:00:00 2001 From: sakurayinfei <970412446@qq.com> Date: Thu, 6 Nov 2025 19:39:41 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix(table):=20=E4=BD=BF=E7=94=A8=E5=AA=92?= =?UTF-8?q?=E4=BD=93=E6=9F=A5=E8=AF=A2=E5=88=87=E6=8D=A2=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/opendesign/src/table/OTable.vue | 11 +++++------ packages/opendesign/src/table/style/style.scss | 12 +++++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/opendesign/src/table/OTable.vue b/packages/opendesign/src/table/OTable.vue index 217a20991..eeeca9b71 100644 --- a/packages/opendesign/src/table/OTable.vue +++ b/packages/opendesign/src/table/OTable.vue @@ -47,8 +47,7 @@ const highlightedDoms: Array = []; let highlightTrigger: HTMLTableCellElement | null = null; const clearHighlight = () => { highlightedDoms.forEach((cell) => { - cell.classList.remove('o-table-hover'); - cell.classList.remove('o-table-active'); + cell.classList.remove('o-table-highlight'); }); highlightedDoms.length = 0; highlightTrigger = null; @@ -57,7 +56,7 @@ const applyHighlight = (dom: HTMLTableRowElement | HTMLTableCellElement, classNa highlightedDoms.push(dom); dom.classList.add(className); }; -const highlightTable = (cell: HTMLTableCellElement, type: 'hover' | 'active') => { +const highlightTable = (cell: HTMLTableCellElement) => { if (highlightTrigger === cell) { // 避免重复添加高亮样式 return; @@ -71,7 +70,7 @@ const highlightTable = (cell: HTMLTableCellElement, type: 'hover' | 'active') => const section = cellMeta.section; const rowEl = section.rows[cellMeta.rowStart]; const rowSpan = cellMeta.el.rowSpan; - const className = `o-table-${type}`; + const className = 'o-table-highlight'; applyHighlight(rowEl, className); if (rowSpan === 1) { const rows = section.data[cellMeta.rowStart]; @@ -104,14 +103,14 @@ const handleMouseOver = (e: MouseEvent) => { if (!target || !isHoverDevice) { return; } - highlightTable(target, 'hover'); + highlightTable(target); }; const handleTouchStart = (e: TouchEvent) => { const target = getTdEl(e.target); if (!target) { return; } - highlightTable(target, 'active'); + highlightTable(target); };