From 5843898e590428cdcce93f3db018220e9432e1f5 Mon Sep 17 00:00:00 2001 From: mzl92 Date: Thu, 27 Aug 2026 15:49:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=94=B9=E5=8F=8C=E7=BB=84?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E8=AE=BE=E8=AE=A1:=20=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=BB=84=C3=97=E7=BA=A7=E5=88=AB=E7=BB=84=E8=87=AA=E7=94=B1?= =?UTF-8?q?=E7=BB=84=E5=90=88(=E4=BB=8A=E6=97=A5+=E6=8E=A8=E8=8D=90/?= =?UTF-8?q?=E6=9C=89=E6=95=88=E7=AD=89),=20=E4=BA=92=E4=B8=8D=E9=A1=B6?= =?UTF-8?q?=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 35 +++++++++++++++++++++-------------- scripts/smoke.js | 19 +++++++++++++------ 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/public/index.html b/public/index.html index 915e5ec..25716f4 100644 --- a/public/index.html +++ b/public/index.html @@ -111,13 +111,19 @@ tr.today:hover td{background:#fde68a!important}

候选人

-
- - - - - - +
+ 时间: + + + 或选日期区间 ↓ +
+
+ 级别: + + + + +
@@ -275,16 +281,17 @@ function renderCharts(s){ } window.addEventListener('resize',()=>charts.forEach(c=>c.resize())); let qToday=0; -function quickTab(which){ - qToday=which==='today'?1:0; - $('q_level').value=which==='valid'?'有效':(which==='rec'?'推荐':(which==='maybe'?'待定':'')); - $('q_greeted').value=which==='greeted'?'1':''; - if(which!==''){$('q_from').value='';$('q_to').value=''} +function timeTab(t){qToday=t==='today'?1:0;if(qToday){$('q_from').value='';$('q_to').value=''}loadList(1)} +function levelTab(l){ + $('q_level').value=l==='valid'?'有效':(l==='rec'?'推荐':(l==='maybe'?'待定':'')); + $('q_greeted').value=l==='greeted'?'1':''; loadList(1); } function syncTabs(){ - const which=qToday?'today':($('q_level').value==='有效'?'valid':$('q_level').value==='推荐'?'rec':$('q_level').value==='待定'?'maybe':($('q_greeted').value==='1'?'greeted':'')); - document.querySelectorAll('#quickTabs .tab').forEach(b=>b.classList.toggle('on',b.dataset.q===which)); + document.querySelectorAll('#timeTabs .tab').forEach(b=>b.classList.toggle('on',(b.dataset.q==='today')===!!qToday)); + const lv=$('q_level').value,gr=$('q_greeted').value; + const which=gr==='1'?'greeted':(lv==='有效'?'valid':(lv==='推荐'?'rec':(lv==='待定'?'maybe':''))); + document.querySelectorAll('#levelTabs .tab').forEach(b=>b.classList.toggle('on',b.dataset.q===which)); } function qs(){return `?level=${$('q_level').value}&greeted=${$('q_greeted').value}&account=${$('q_account').value}&today=${qToday}&date_from=${$('q_from').value}&date_to=${$('q_to').value}&q=${encodeURIComponent($('q_kw').value.trim())}`} async function loadList(p){ diff --git a/scripts/smoke.js b/scripts/smoke.js index d573b04..6b7771a 100644 --- a/scripts/smoke.js +++ b/scripts/smoke.js @@ -61,16 +61,23 @@ const sleep = (ms) => new Promise(r => setTimeout(r, ms)); const kwOk = await p.evaluate(() => document.querySelectorAll('#tbody tr').length >= 0); ok('关键词筛选不报错', kwOk); - console.log('== 4b. 快捷标签页 =='); - await p.evaluate(() => quickTab('valid')); await sleep(700); + console.log('== 4b. 组合标签(时间×级别) =='); + await p.evaluate(() => levelTab('valid')); await sleep(700); const validOk = await p.evaluate(() => { const rows = [...document.querySelectorAll('#tbody tr')]; return rows.length > 0 && rows.every(tr => tr.textContent.includes('推荐') || tr.textContent.includes('待定')); }); - ok('"有效人员"页全部为推荐/待定', validOk); - const todayRows = await p.evaluate(async () => { quickTab('today'); await new Promise(r => setTimeout(r, 600)); return document.querySelectorAll('#tbody tr.today').length; }); - ok(`"今日"页当天高亮行(${todayRows})`, todayRows >= 0); - await p.evaluate(() => quickTab('')); await sleep(500); + ok('"有效人员"全部为推荐/待定', validOk); + await p.evaluate(() => timeTab('today')); await sleep(700); + const combo = await p.evaluate(() => { + const rows = [...document.querySelectorAll('#tbody tr')]; + const allToday = rows.every(tr => tr.classList.contains('today')); + const allValid = rows.every(tr => tr.textContent.includes('推荐') || tr.textContent.includes('待定')); + const tabs = [document.querySelector('#timeTabs .tab.on')?.dataset.q, document.querySelector('#levelTabs .tab.on')?.dataset.q]; + return { n: rows.length, allToday, allValid, tabs: tabs.join('+') }; + }); + ok(`组合"今日+有效"正确(${combo.n}行, 标签=${combo.tabs})`, (combo.n === 0 || combo.allToday) && (combo.n === 0 || combo.allValid) && combo.tabs === 'today+valid'); + await p.evaluate(() => { timeTab(''); levelTab(''); }); await sleep(500); console.log('== 5. 候选人详情弹窗 =='); await p.evaluate(() => document.querySelector('#tbody tr')?.click()); await sleep(800);