|
|
|
@ -320,7 +320,7 @@
|
|
|
|
|
align="center" |
|
|
|
|
> |
|
|
|
|
<template #default="props"> |
|
|
|
|
<span :id="props.row[item.prop]" :class="props.row[item.prop] == 'state' ? '.static-class' : ''">{{ |
|
|
|
|
<span :id="props.row[item.prop]" :class="props.row[item.prop] == multifunctional ? 'static-class' : ''">{{ |
|
|
|
|
props.row[item.prop] ? props.row[item.prop] : '/' |
|
|
|
|
}}</span> |
|
|
|
|
</template> |
|
|
|
@ -1886,14 +1886,44 @@ const soclear=()=>{
|
|
|
|
|
|
|
|
|
|
SearchFu() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function scrollToElementWithPartialId(partialId) { |
|
|
|
|
// 首先清空之前所有元素的颜色样式 |
|
|
|
|
document.querySelectorAll('[id]').forEach(function(el) { |
|
|
|
|
el.style.backgroundColor = ''; // 移除背景颜色 |
|
|
|
|
el.style.color = ''; // 移除文字颜色 |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 现在开始搜索含有 partialId 的元素 |
|
|
|
|
const allElements = document.querySelectorAll(`[id*="${partialId}"]`); |
|
|
|
|
if (allElements.length > 0) { |
|
|
|
|
// 获取第一个匹配的元素 |
|
|
|
|
const targetElement = allElements[0]; |
|
|
|
|
// 添加背景颜色和文字颜色 |
|
|
|
|
targetElement.style.backgroundColor = '#ff0000'; // 设置背景颜色为红色 |
|
|
|
|
targetElement.style.color = '#fff'; // 设置文字颜色为白色 |
|
|
|
|
// 将匹配元素滚动到视野区域 |
|
|
|
|
targetElement.scrollIntoView(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 编辑多功能搜索 |
|
|
|
|
const SearchFu = () => { |
|
|
|
|
if(multifunctional.value){ |
|
|
|
|
scrollToElementWithPartialId(multifunctional.value) |
|
|
|
|
}else{ |
|
|
|
|
document.querySelectorAll('[id]').forEach(function(el) { |
|
|
|
|
el.style.backgroundColor = ''; // 移除背景颜色 |
|
|
|
|
el.style.color = ''; // 移除文字颜色 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
if(multifunctional.value){ |
|
|
|
|
document.getElementById(multifunctional.value).scrollIntoView() |
|
|
|
|
} |
|
|
|
|
return |
|
|
|
|
console.log(soInpuState.value, '当前搜索状态'); |
|
|
|
|
|
|
|
|
|
if (!multifunctional.value && !dataInfoTemp.value.length) { |
|
|
|
|
soInpuState.value = false; //重置搜索状态 |
|
|
|
|
ElMessage({ |
|
|
|
@ -3050,7 +3080,12 @@ const SubmitCommercial = () => {
|
|
|
|
|
width: 100px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.static-class { |
|
|
|
|
background-color: seagreen; |
|
|
|
|
padding: 0 4px; |
|
|
|
|
scroll-behavior: smooth; |
|
|
|
|
background-color: #ff0000; |
|
|
|
|
color: #fff; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
|