feat(target-lists): 切换至B方案行内编辑布局

- 名单管理页改为左侧分类导航、右侧宽表格,编辑在对应记录行下展开
- 新增条目按钮触发行内表单,筛选或分页时草稿保留在表格顶部
- 登记模块增加beforeunload保护,区分保存中与未保存状态
- 外观模块增加beforeunload保护并修复偏好拉取的竞态问题
- 地图定位面板调整底部内边距和标题间距
- 更新相关测试脚本适配新交互流程
```
This commit is contained in:
2026-10-23 17:42:17 +08:00
parent 461e2c8e7f
commit 18c5178d8f
14 changed files with 196 additions and 27 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ try{
const nav=page.getByRole('navigation',{name:'模块菜单'});assert.equal(await nav.locator('button:visible').count(),4);assert.equal(await nav.locator('#rt-blacklist-menu').getAttribute('aria-label'),'黑白名单管理');
assert.deepEqual(await nav.locator('button:visible').evaluateAll(es=>es.map(e=>e.getAttribute('aria-label'))),['应用总览','实时工作台','电子围栏','黑白名单管理']);
await page.getByRole('button',{name:'黑白名单管理',exact:true}).click();await page.locator('#rt-list-manager').waitFor();await page.getByRole('heading',{name:'黑白名单管理',exact:true}).waitFor();
const managerTabs=page.getByRole('group',{name:'管理名单分类'});assert.equal(await managerTabs.getByRole('button',{name:/^全部/}).getAttribute('aria-pressed'),'true');await page.locator('.rt-list-row[data-target-id="MENU-BLACK"]').waitFor();assert.equal(await page.locator('.rt-list-row[data-target-id="MENU-WHITE"]').count(),1);assert.equal(await page.locator('#rt-list-entry-kind').inputValue(),'black');
const managerTabs=page.getByRole('group',{name:'管理名单分类'});assert.equal(await managerTabs.getByRole('button',{name:/^全部/}).getAttribute('aria-pressed'),'true');await page.locator('.rt-list-row[data-target-id="MENU-BLACK"]').waitFor();assert.equal(await page.locator('.rt-list-row[data-target-id="MENU-WHITE"]').count(),1);await page.getByRole('button',{name:'新增条目',exact:true}).click();assert.equal(await page.locator('#rt-list-entry-kind').inputValue(),'black');
await page.keyboard.press('Escape');await page.locator('#rt-list-manager').waitFor({state:'hidden'});await page.waitForFunction(()=>document.activeElement.id==='rt-blacklist-menu');assert.equal(await page.locator('#rt-blacklist-menu').getAttribute('aria-current'),null);
await page.getByRole('button',{name:'黑白名单管理',exact:true}).press('Enter');await page.locator('#rt-list-manager').waitFor();await page.getByRole('button',{name:'返回工作区'}).click();await page.locator('#rt-list-manager').waitFor({state:'hidden'});
async function corner(){const result=await page.evaluate(()=>{const root=document.getElementById('rt-layout'),e=root.querySelector('.mc-map-infobar'),r=root.getBoundingClientRect(),b=e.getBoundingClientRect(),scale=r.width/root.clientWidth;return {right:(r.right-b.right)/scale,bottom:(r.bottom-b.bottom)/scale,z:Number(getComputedStyle(e).zIndex),pointer:getComputedStyle(e).pointerEvents,rootOverflow:document.documentElement.scrollWidth>innerWidth}});assert.ok(Math.abs(result.right-16)<1,JSON.stringify(result));assert.ok(Math.abs(result.bottom-16)<1,JSON.stringify(result));assert.ok(result.z>10);assert.equal(result.pointer,'none');assert.equal(result.rootOverflow,false);return result;}