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; // 匹配到了就跳出循环