|
54 | 54 | const RETRY_DELAY = 3000; // 重试延迟(毫秒) |
55 | 55 | const CONCURRENT_ENABLED = true; // 是否启用并发抢课 |
56 | 56 | const CLICK2EXPEND_ENABLED = true; // 用户设置: 是否在 jQuery 后自动展开目标课程信息,用于时间筛选和教师筛选 |
57 | | - |
| 57 | + |
58 | 58 | let click2expend_enabled = true; // 用于脚本自动关闭 |
59 | 59 |
|
60 | 60 | // ========== 过滤器配置 ========== |
|
185 | 185 | const kcmcLink = kcmcSpan.querySelector('a'); |
186 | 186 | if (kcmcLink) { |
187 | 187 | const courseName = kcmcLink.textContent.trim(); |
188 | | - // 精确匹配或包含匹配 |
189 | | - if (courseName === input || courseName.includes(input)) { |
| 188 | + // 宽松匹配:只要a元素内容包含用户输入就匹配(不区分大小写) |
| 189 | + if (courseName.toLowerCase().includes(input.toLowerCase())) { |
190 | 190 | matched = true; |
191 | 191 | } |
192 | 192 | } |
193 | 193 | } |
194 | 194 | } |
| 195 | + /* |
| 196 | + <div class="panel-heading kc_head" onclick="loadJxbxxZzxk(this)" |
| 197 | + style="background-color:#C1FFC1;"> |
| 198 | + <h3 class="panel-title"><span class="kcmc" id="kcmc_23005523">(23005523)<a |
| 199 | + href="javascript:void(0);" |
| 200 | + onclick="showCourseInfo('23005523')">质量管理</a><i class="l-kc-xf" |
| 201 | + style="display: inline;"> - <i id="xf_23005523">5.0</i> |
| 202 | + 学分</i></span><span>教学班个数:<font class="jxbgsxx">4</font></span><span |
| 203 | + id="zt_txt_23005523">状态:<b>已选</b></span></h3><input type="hidden" |
| 204 | + name="kch_id" value="23005523"><input type="hidden" name="kcxzzt" |
| 205 | + id="kcxzzt_23005523" value="1"><input type="hidden" name="cxbj" |
| 206 | + id="cxbj_23005523" value="0"><input type="hidden" name="fxbj" id="fxbj_23005523" |
| 207 | + value="0"><input type="hidden" name="xxkbj" id="xxkbj_23005523" value="0"><input |
| 208 | + type="hidden" name="czzt" value="0"><a href="javascript:void(0);" |
| 209 | + class="expand_close expand1">展开关闭</a> |
| 210 | + </div> |
| 211 | + */ |
195 | 212 |
|
196 | 213 | if (matched) { |
197 | 214 | // 直接触发 click(等价于用户点击) |
|
383 | 400 |
|
384 | 401 | // 方法1:直接遍历所有教学班行,按课程号或课程名称匹配 |
385 | 402 | const allRows = document.querySelectorAll('table tbody tr.body_tr'); |
386 | | - |
| 403 | + |
387 | 404 | for (let row of allRows) { |
388 | 405 | if (isRowMatchingCourse(row, input)) { |
389 | 406 | const selectButton = row.querySelector('button, a, input[type="button"]'); |
|
0 commit comments