普通招生

This commit is contained in:
guochunsi
2026-01-15 19:06:50 +08:00
parent 761fb9bdc3
commit 3cab9fab59
46 changed files with 1561 additions and 1033 deletions

View File

@@ -84,17 +84,40 @@ const checkCollapsibleContent = () => {
}
// 否则,通过检查隐藏的检测元素是否有内容来判断
// 需要等待 DOM 渲染完成
// 需要等待 DOM 渲染完成,可能需要多次尝试以确保数据加载完成
let retryCount = 0
const maxRetries = 5
const check = () => {
nextTick(() => {
setTimeout(() => {
if (detectionWrapperRef.value) {
// 检查检测元素是否有子元素(排除文本节点)
// 检查是否有 el-form-item 元素(因为表单项会被渲染为 el-form-item
const hasContent = detectionWrapperRef.value.children.length > 0 ||
detectionWrapperRef.value.querySelector('.el-form-item') !== null ||
(!!detectionWrapperRef.value.textContent && detectionWrapperRef.value.textContent.trim() !== '')
if (hasContent || retryCount >= maxRetries) {
hasCollapsibleContent.value = hasContent
} else {
// 如果还没检测到内容且未达到最大重试次数,继续重试
retryCount++
setTimeout(check, 100)
}
} else {
if (retryCount < maxRetries) {
retryCount++
setTimeout(check, 100)
} else {
hasCollapsibleContent.value = false
}
}
}, 50)
})
}
check()
}
// 是否有需要折叠的项