From ad6b9d4f65d59d6ad21ccc096f6fcee7d7864dea Mon Sep 17 00:00:00 2001 From: xzg <4727863@qq.com> Date: Tue, 26 Dec 2023 16:46:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A2=9C=E8=89=B2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/turndelivery/deliveryDiscuss.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/views/distribution/turndelivery/deliveryDiscuss.vue b/src/views/distribution/turndelivery/deliveryDiscuss.vue index b62f492c..1abfc68e 100644 --- a/src/views/distribution/turndelivery/deliveryDiscuss.vue +++ b/src/views/distribution/turndelivery/deliveryDiscuss.vue @@ -320,7 +320,7 @@ align="center" > @@ -1912,13 +1912,14 @@ function scrollToElementWithinTableRow(partialIdString) { tableRows.forEach(function(row) { const cells = row.querySelectorAll('[id]'); cells.forEach(function(cell) { - cell.style.backgroundColor = '#ffffff'; // 移除背景颜色 - cell.style.color = '#000'; // 移除文字颜色 + cell.style.backgroundColor = ''; // 移除背景颜色 + cell.style.color = ''; // 移除文字颜色 }); }); // 将输入的逗号分隔的字符串拆分成数组 const partialIds = partialIdString.split(',').map(id => id.trim()); + // 通过遍历每一行来检查是否每一个partialId都存在 for (let row of tableRows) { // 检查这一行是否包含所有的partialIds @@ -1926,9 +1927,10 @@ function scrollToElementWithinTableRow(partialIdString) { // 如果匹配,设置背景颜色和文字颜色 const cells = row.querySelectorAll('[id]'); cells.forEach(function(cell) { - cell.style.backgroundColor = ''; // 设置背景颜色为红色 - cell.style.color = ''; // 设置文字颜色为白色 + cell.style.backgroundColor = '#ff0000'; // 设置背景颜色为红色 + cell.style.color = '#fff'; // 设置文字颜色为白色 }); + // 将这一行滚动到视野区域 row.scrollIntoView(); break; // 匹配到了就跳出循环