diff --git a/static/js/afterbody.js b/static/js/afterbody.js index 7d32ebf..55daaa1 100644 --- a/static/js/afterbody.js +++ b/static/js/afterbody.js @@ -1,19 +1,7 @@ //公式相关 -function toggleAccordion(header) { - const content = header.nextElementSibling; - const isOpen = content.style.maxHeight !== '0px' && content.style.maxHeight !== ''; - - // 关闭所有其他面板 - document.querySelectorAll('.accordion-content').forEach(item => { - item.style.maxHeight = '0px'; - }); - - // 切换当前面板 - if (!isOpen) { - content.style.maxHeight = content.scrollHeight + 'px'; - } -} +const BASE_WIND_COUNT = 10; +const SPOT_CHECK_COUNT = 5; // 展开或者关闭公式 function toggleFormula(element) { @@ -36,11 +24,7 @@ document.addEventListener('DOMContentLoaded', function() { // 确保数据已加载 if (window.weatherData) { - // 获取页面中的版本号元素 const versionElement = document.querySelector('.version'); - - // 【修改点】直接使用 window.weatherData.version - // 使用 || 'v1.0' 作为默认值,防止数据库版本为空时显示 undefined const dbVersion = window.weatherData.version || 'default'; // 更新页面显示 @@ -48,7 +32,6 @@ document.addEventListener('DOMContentLoaded', function() { versionElement.textContent = `版本号: ${dbVersion}`; } - // 【修改点】调用 downloadpdf,只传 data,不再传那个空的 version 变量 downloadpdf(window.weatherData); } else { console.error("错误:window.weatherData 未定义"); @@ -63,8 +46,7 @@ function downloadpdf(data) { rural: "农村", }; - // 假设你的HTML字符串是这样的 - var htmlString = ` + const htmlString = `
@@ -252,38 +234,35 @@ function downloadpdf(data) {