瀏覽代碼

style: move support summary cards above filters

彭峰 7 小時之前
父節點
當前提交
ec3ae73bc0

+ 8 - 7
projects/xiaoshu-admin/src/app/pages/support-requests.component.html

@@ -1,7 +1,14 @@
 <header class="page-header">
   <div><h1>意见反馈与休假申请</h1><p>集中查看学生与老师提交的意见和申请</p></div>
-  <button class="ui-button" type="button" (click)="load()" [disabled]="loading()">刷新</button>
 </header>
+@if (data(); as d) {
+  <section class="summary-grid" aria-label="当前筛选统计">
+    <article class="summary-card"><span>当前筛选 · 共计</span><strong>{{d.total}}</strong></article>
+    <article class="summary-card"><span>意见反馈</span><strong>{{d.summary.feedback}}</strong></article>
+    <article class="summary-card"><span>休假申请</span><strong>{{d.summary.leave}}</strong></article>
+    <article class="summary-card"><span>历史未分类</span><strong>{{d.summary.legacy}}</strong></article>
+  </section>
+}
 <form class="toolbar request-filters" (ngSubmit)="apply()">
   <label class="search-field">搜索<input name="search" [(ngModel)]="search" maxlength="200" placeholder="姓名、用户编号或内容" /></label>
   <label>提交身份<select aria-label="提交身份" name="role" [(ngModel)]="role"><option value="">全部身份</option><option value="student">学生</option><option value="teacher">老师</option><option value="other">其他 / 未匹配</option></select></label>
@@ -15,12 +22,6 @@
 @if (error()) { <div class="notice error" role="alert">{{error()}} <button class="ui-button" type="button" (click)="load()" [disabled]="loading()">重新加载</button></div> }
 @if (message()) { <p class="notice" role="status">{{message()}}</p> }
 @if (data(); as d) {
-  <section class="summary-grid" aria-label="当前筛选统计">
-    <article class="summary-card"><span>当前筛选 · 共计</span><strong>{{d.total}}</strong></article>
-    <article class="summary-card"><span>意见反馈</span><strong>{{d.summary.feedback}}</strong></article>
-    <article class="summary-card"><span>休假申请</span><strong>{{d.summary.leave}}</strong></article>
-    <article class="summary-card"><span>历史未分类</span><strong>{{d.summary.legacy}}</strong></article>
-  </section>
   <p class="history-note">历史表单未区分类型,统一保留在“历史未分类”中。身份按提交账号的当前资料显示;提交申请不代表已获准休假。</p>
   <section class="content-card request-list" aria-label="反馈与申请列表">
     <header><strong>提交记录</strong><small>更新于 {{d.refreshedAt | date:'MM-dd HH:mm':'+0800'}} · 北京时间</small></header>

+ 1 - 1
scripts/check-support-requests-browser.mjs

@@ -35,7 +35,7 @@ try{
  assert.equal(calls.at(-1).page,1);assert.ok((await page.locator('.request-meta').allTextContents()).every(t=>t.includes('老师')&&t.includes('休假申请')));checks.push('身份与类型组合筛选,查询回到第一页');
  await page.getByLabel('搜索',{exact:true}).fill('不存在的内容');await page.getByRole('button',{name:'查询',exact:true}).click();await page.getByText('暂无符合条件的反馈或申请').waitFor();
  await page.getByRole('button',{name:'重置',exact:true}).click();await page.locator('.request-row').first().waitFor();
- fail=true;await page.getByRole('button',{name:'刷新',exact:true}).click();await page.getByRole('alert').filter({hasText:'模拟读取失败'}).waitFor();assert.equal(await page.locator('.request-row').count(),0);
+ fail=true;await page.getByRole('button',{name:'查询',exact:true}).click();await page.getByRole('alert').filter({hasText:'模拟读取失败'}).waitFor();assert.equal(await page.locator('.request-row').count(),0);
  fail=false;await page.getByRole('button',{name:'重新加载',exact:true}).click();await page.locator('.request-row').first().waitFor();checks.push('空状态、失败不伪装为空记录、重试恢复');
  for(const width of [768,390]){await page.setViewportSize({width,height:900});assert.ok(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+1));await page.screenshot({path:output+'/admin-'+width+'.png',fullPage:true});}checks.push('1440/768/390宽度布局');
  for(const [index,decision,comment] of [[0,'approved','已同意休假,请提前完成交接。'],[3,'rejected','当天已有排课,请另行选择时间。'],[1,'processed','提醒设置已调整,感谢反馈。']]){