From ee7daf9ad1cba1e6aaf8fba09e3d0a19582103e7 Mon Sep 17 00:00:00 2001 From: hxuanyu <2252193204@qq.com> Date: Wed, 2 Apr 2025 15:04:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=BF=80=E6=B4=BB=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=9B=B4=E6=96=B0=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84=E8=B0=83=E8=AF=95=E6=97=A5?= =?UTF-8?q?=E5=BF=97=EF=BC=8C=E6=8F=90=E5=8D=87=E4=BB=A3=E7=A0=81=E5=8F=AF?= =?UTF-8?q?=E8=AF=BB=E6=80=A7=E5=92=8C=E7=BB=B4=E6=8A=A4=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/static/js/main.js | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/web/static/js/main.js b/src/web/static/js/main.js index 357b784..aed0d17 100644 --- a/src/web/static/js/main.js +++ b/src/web/static/js/main.js @@ -542,33 +542,24 @@ function updateActiveStatus(results) { // 收集所有被激活的羁绊和棋子 const activeSynergies = new Set(); - const activeSynergyNames = new Set(); // 添加名称集合 + const activeSynergyNames = new Set(); const activeChess = new Set(); - const activeChessNames = new Set(); // 添加名称集合 - - console.log('更新激活状态:', results); + const activeChessNames = new Set(); results.forEach(result => { // 添加激活的羁绊 result.active_synergies.forEach(synergy => { - console.log('激活羁绊:', synergy); - if (synergy.id) activeSynergies.add(String(synergy.id)); // 确保ID是字符串 - if (synergy.name) activeSynergyNames.add(synergy.name); // 添加名称 + if (synergy.id) activeSynergies.add(String(synergy.id)); + if (synergy.name) activeSynergyNames.add(synergy.name); }); // 添加激活的棋子 result.chess_list.forEach(chess => { - console.log('激活棋子:', chess); - if (chess.id) activeChess.add(String(chess.id)); // 确保ID是字符串 - if (chess.name) activeChessNames.add(chess.name); // 添加名称 + if (chess.id) activeChess.add(String(chess.id)); + if (chess.name) activeChessNames.add(chess.name); }); }); - console.log('所有激活的羁绊ID:', Array.from(activeSynergies)); - console.log('所有激活的羁绊名称:', Array.from(activeSynergyNames)); - console.log('所有激活的棋子ID:', Array.from(activeChess)); - console.log('所有激活的棋子名称:', Array.from(activeChessNames)); - // 处理羁绊激活状态 $('.synergy-weight-item').each(function() { const $item = $(this); @@ -580,7 +571,6 @@ function updateActiveStatus(results) { activeSynergyNames.has(synergyName) || activeSynergyNames.has(synergyName.toLowerCase())) { $item.addClass('active'); - console.log('激活羁绊:', synergyId, synergyName); } }); @@ -595,14 +585,9 @@ function updateActiveStatus(results) { activeChessNames.has(chessName) || activeChessNames.has(chessName.toLowerCase())) { $item.addClass('active'); - console.log('激活棋子:', chessId, chessName); } }); - // 记录激活项目数量统计 - console.log('成功激活的羁绊数量:', $('.synergy-weight-item.active').length); - console.log('成功激活的棋子数量:', $('.chess-weight-item.active').length); - // 根据当前复选框状态更新显示 const showOnlyActiveSynergies = $('#show-only-active').is(':checked'); const showOnlyActiveChess = $('#show-only-active-chess').is(':checked');