const sleep = ms => new Promise(r=>setTimeout(r,ms)); const propsOf = el => { for (const k of Object.keys(el)) if (k.startsWith('__reactProps$')) return el[k]; return null; }; const fire = (el) => { let t = el; for (let i=0;i<8&&t;i++){const q=propsOf(t); if(q&&typeof q.onClick==='function'){q.onClick({target:t,currentTarget:t,stopPropagation(){},preventDefault(){},nativeEvent:{},button:0,detail:1});return true;} t=t.parentElement;} return false; }; const fsLayer = Array.from(document.querySelectorAll('fieldset')).find(x=>(x.querySelector('legend')||{}).textContent==='布线图层'); if(!fsLayer) return {err:'no layer fieldset'}; const state = () => Array.from(fsLayer.querySelectorAll('tr')).map(tr => ({ txt: (tr.innerText||'').trim().slice(0,10), on: !!tr.querySelector('i[class*="active_"]') })); const before = state(); const hit = []; for (const name of ['内层1','内层2']) { const tr = Array.from(fsLayer.querySelectorAll('tr')).find(t=>(t.innerText||'').trim()===name); if(!tr) { hit.push(name+':norow'); continue; } const cb = tr.querySelector('i[class*="checkbox_"]'); if(!cb) { hit.push(name+':nocb'); continue; } hit.push(name+':'+fire(cb)); await sleep(400); } return {before, hit, after: state()};