Explorar o código

style(web): 重排本方对账摘要与台账布局

sy hai 2 días
pai
achega
fa83cc8a24

+ 27 - 26
web-scaffold/src/pages/PartyViewPages.tsx

@@ -20,7 +20,7 @@
  */
 import { useCallback, useEffect, useRef, useState } from "react";
 import { PageIntro } from "../components/PageIntro";
-import { ArrowDown, ArrowRight, Download, Info, Search, X } from "lucide-react";
+import { ArrowDown, ArrowRight, CalendarDays, Download, Info, Search, X } from "lucide-react";
 import { Link, useLocation, useParams } from "react-router";
 import { detailBack, detailLinkState } from "../lib/detail-navigation";
 import { ServerListPager } from "../components/ListPager";
@@ -294,29 +294,26 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
       {notice && <OpsNotice message={notice} onClose={() => setNotice("")} />}
       {wiring && <p className="ops-import-note" role="status">{VIEW_WIRING_NOTE}</p>}
 
-      {teamView && showLedger && <>
-        <dl className="team-recon-config" aria-label="本方对账配置">
-          <div><dt>本方对账日</dt><dd>{reconDay}</dd></div>
-          <div><dt>付款周期</dt><dd>{payCycle}</dd></div>
-          <div><dt>{CARD1_TITLE}</dt><dd>{settlementRule}</dd></div>
-        </dl>
-        <section className="team-recon-snapshot" aria-labelledby="team-recon-snapshot-title">
-          <header>
-            <h2 id="team-recon-snapshot-title">{CARD_SNAPSHOT_TITLE}</h2>
-            <span>账期 {month || ALL_PERIODS_LABEL}</span>
-          </header>
-          <div className="statement-totals">
-            <div data-total="share">
-              <span>本方分成合计</span>
-              <strong className={wiring || data?.share_sum == null ? "statement-total-empty" : undefined}>{shareTotal}</strong>
-              <small>{allShares}</small>
-            </div>
-            <div><span>本方对账清单</span><strong>{batchTotal}</strong>{!wiring && <small>当前显示 {data?.batch_shown ?? 0} 批</small>}</div>
-            <div><span>本方账单明细</span><strong>{detailTotal}</strong>{!wiring && <small>当前显示 {data?.detail_shown ?? 0} 条</small>}</div>
-          </div>
-        </section>
-      </>}
-      {teamView ? <div className="ops-list-shell team-recon-filters">{filters}</div> : filters}
+      {teamView ? <div className="ops-list-shell team-recon-filters">
+        {showLedger && <div className="team-recon-overview">
+          <section className="team-recon-snapshot" aria-labelledby="team-recon-snapshot-title">
+            <header>
+              <h2 id="team-recon-snapshot-title">{CARD_SNAPSHOT_TITLE}</h2>
+              <span><CalendarDays size={13} aria-hidden="true" />{month || ALL_PERIODS_LABEL}</span>
+            </header>
+            <dl className="team-recon-amounts">
+              <div><dt>当前筛选分成合计</dt><dd className={wiring || data?.share_sum == null ? "is-unavailable" : undefined}>{shareTotal}</dd></div>
+              <div><dt>本方全部分成合计</dt><dd className={wiring || data?.share_sum_all == null ? "is-unavailable" : undefined}>{wiring ? BACKEND_NOT_WIRED : moneyCell(data?.share_sum_all ?? null)}</dd></div>
+            </dl>
+          </section>
+          <dl className="team-recon-config" aria-label="本方对账配置">
+            <div><dt>本方对账日</dt><dd>{reconDay}</dd></div>
+            <div><dt>付款周期</dt><dd>{payCycle}</dd></div>
+            <div><dt>{CARD1_TITLE}</dt><dd>{settlementRule}</dd></div>
+          </dl>
+        </div>}
+        {filters}
+      </div> : filters}
       {teamView && fetchState.loading && !data && !fail && <p className="ops-list-shell team-recon-loading" role="status">正在读取本方对账…</p>}
 
       {/* 整页态:KLT-O20701(⛔ 重试)/KLT-O20703(筛选条保留,①—⑥ 全替换,⛔ 渲染空表)/KLT-P301。 */}
@@ -380,7 +377,10 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
 
           {/* ⑤ 表 1 本方对账清单(出账状态与批次状态两维度两列并排)。 */}
           <div className={teamView ? "ops-list-shell team-recon-ledger" : "reconcile-ledger list-shell-fill"}>
-            {teamView && <header className="team-recon-ledger-heading"><h2 id="team-recon-batches">对账清单</h2></header>}
+            {teamView && <header className="team-recon-ledger-heading">
+              <h2 id="team-recon-batches">对账清单</h2>
+              {!wiring && <span>共 {batchTotal},当前显示 {data?.batch_shown} 批</span>}
+            </header>}
             <div className="ops-table-wrap" role={teamView ? "region" : undefined} aria-labelledby={teamView ? "team-recon-batches" : undefined} tabIndex={teamView ? 0 : undefined}>
               <table className="ops-table" aria-labelledby={teamView ? "team-recon-batches" : undefined} aria-busy={teamView ? fetchState.loading : undefined}>
                 {teamView && <OpsTableColumns widths={[210, 102, 112, 112, 100, 145, 286]} />}
@@ -401,7 +401,7 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
                           {/* 无明细 ⇒ 导出按钮整块不渲染(⚠️ 不是禁用,总则§16.9;KLT-H205xx 仅直调防护)。 */}
                           {row.has_detail && (
                             <button type="button" className="ops-table-action" onClick={() => exportBatch(row.batch_no)}>
-                              <Download size={14} aria-hidden="true" /> 导出本批账单明细
+                              <Download size={14} aria-hidden="true" /> {teamView ? "导出明细" : "导出本批账单明细"}
                             </button>
                           )}{" "}
                           <button type="button" className="ops-table-action" onClick={() => drillBatch(row.batch_no)}>查看明细{teamView && <ArrowDown size={14} aria-hidden="true" />}</button>
@@ -432,6 +432,7 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
           <div className={teamView ? "ops-list-shell team-recon-ledger team-recon-details" : "reconcile-ledger list-shell-fill"} ref={detailRef} tabIndex={teamView ? -1 : undefined}>
             {teamView ? <header className="team-recon-ledger-heading">
               <h2 id="team-recon-bills">账单明细</h2>
+              {!wiring && <span>共 {detailTotal},当前显示 {data?.detail_shown} 条</span>}
               <p className="team-recon-detail-note" role="note"><Info size={14} aria-hidden="true" />{VIEW_DETAIL_ONLY_SETTLED}</p>
             </header> : <p className="ops-import-note" role="note">{VIEW_DETAIL_ONLY_SETTLED}</p>}
             <div className="ops-table-wrap" role={teamView ? "region" : undefined} aria-labelledby={teamView ? "team-recon-bills" : undefined} tabIndex={teamView ? 0 : undefined}>

+ 35 - 37
web-scaffold/src/styles/settlement-records.css

@@ -31,58 +31,56 @@
 .statement-totals small { color: var(--muted-foreground); font-size: var(--type-meta); line-height: 1.5; }
 
 .team-recon-view { grid-template-columns: minmax(0, 1fr); }
-.team-recon-config {
+.team-recon-overview {
   display: grid;
-  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.5fr);
-  gap: 1px;
-  margin: 0;
-  overflow: hidden;
-  border: 1px solid var(--border);
-  border-radius: var(--radius-card);
-  background: var(--border-subtle);
+  grid-template-columns: minmax(0, 1.6fr) minmax(295px, 1fr);
+  border-bottom: 1px solid var(--border-subtle);
 }
-.team-recon-config > div { min-width: 0; padding: 10px 18px; background: var(--card); }
-.team-recon-config dt { color: var(--muted-foreground); font-size: var(--type-meta); }
-.team-recon-config dd { margin: 3px 0 0; color: var(--foreground); font-size: var(--type-body); font-weight: 550; overflow-wrap: anywhere; }
-.team-recon-snapshot { min-width: 0; }
-.team-recon-snapshot > header, .team-recon-ledger-heading {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  flex-wrap: wrap;
-  gap: 7px 14px;
+.team-recon-snapshot {
+  display: grid;
+  align-content: center;
+  gap: 18px;
+  padding: 20px 24px;
+  background: linear-gradient(100deg, var(--primary-soft), var(--card));
 }
-.team-recon-snapshot > header { margin: 0 0 8px; }
-.team-recon-snapshot h2, .team-recon-ledger-heading h2 { margin: 0; color: var(--foreground); font-size: var(--type-body); font-weight: 650; }
-.team-recon-snapshot header > span { color: var(--text-secondary); font-size: var(--type-support); }
-.team-recon-snapshot .statement-totals { grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); }
+.team-recon-snapshot header, .team-recon-ledger-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 14px; }
+.team-recon-snapshot h2, .team-recon-ledger-heading h2 { margin: 0; color: var(--foreground); font-size: var(--type-comfort); font-weight: 600; }
+.team-recon-snapshot header span { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: var(--type-meta); }
+.team-recon-amounts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px clamp(22px, 4vw, 72px); margin: 0; }
+.team-recon-overview dt, .team-recon-ledger-heading > span { color: var(--muted-foreground); font-size: var(--type-meta); }
+.team-recon-amounts dd { margin: 4px 0 0; color: var(--text-secondary); font-size: var(--type-section); line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
+.team-recon-amounts > div:first-child dd { color: var(--primary); font-size: clamp(22px, 2vw, 30px); font-weight: 600; }
+.team-recon-amounts dd.is-unavailable, .team-recon-amounts > div:first-child dd.is-unavailable { color: var(--muted-foreground); font-size: var(--type-body); }
+.team-recon-config { display: grid; align-content: center; gap: 7px; margin: 0; padding: 18px 24px; border-inline-start: 1px solid var(--border-subtle); }
+.team-recon-config > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
+.team-recon-config dt { flex-shrink: 0; }
+.team-recon-config dd { margin: 0; color: var(--text-secondary); font-size: var(--type-body); font-weight: 500; text-align: end; overflow-wrap: anywhere; }
 .team-recon-toolbar > .ops-search { flex: 1 1 230px; }
 .team-recon-filter-hint, .team-recon-detail-note { display: flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: var(--type-meta); }
-.team-recon-filter-hint { margin-inline-start: auto; }
+.team-recon-filter-hint, .team-recon-detail-note { margin-inline-start: auto; }
 :is(.team-recon-filter-hint, .team-recon-detail-note) > svg { flex: none; }
 .team-recon-filters > .ops-import-note { margin: 0 24px 12px; }
 .team-recon-loading { display: block; margin: 0; padding: 38px 20px; color: var(--muted-foreground); text-align: center; font-size: var(--type-support); }
-.team-recon-ledger-heading { padding: 12px 24px; }
-.team-recon-detail-note { margin: 0; padding: 5px 8px; border-radius: 5px; background: var(--surface-subtle); }
+.team-recon-ledger-heading { padding: 14px 24px; }
+.team-recon-detail-note { margin-block: 0; padding: 4px 8px; border-radius: 5px; background: var(--surface-subtle); }
 .team-recon-details { scroll-margin-block-start: calc(4rem + 14px); }
 .team-recon-ledger > .ops-table-wrap { max-height: clamp(200px, 44dvh, 420px); overflow: auto; }
-.team-recon-ledger .ops-table { min-width: 980px; table-layout: fixed; }
+.team-recon-ledger .ops-table { min-width: 900px; table-layout: fixed; }
 .team-recon-ledger .ops-table th { position: sticky; inset-block-start: 0; z-index: 1; }
 .team-recon-ledger .ops-table td.ops-mono { overflow: hidden; text-overflow: ellipsis; }
-.team-recon-ledger .ops-table td .reconcile-money { color: var(--primary); font-size: var(--type-comfort); font-weight: 550; }
+.team-recon-ledger .ops-table td:first-child:not([colspan]) { color: var(--text-secondary); font-size: var(--type-support); font-weight: 500; }
+.team-recon-ledger .ops-table td .reconcile-money { color: var(--primary); font-size: var(--type-comfort); font-weight: 500; }
 .team-recon-ledger .ops-table td .table-cell-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; white-space: normal; overflow-wrap: anywhere; }
-.team-recon-ledger .ops-table :is(th:last-child, td:last-child:not([colspan])) { text-align: end; }
+.team-recon-ledger .ops-table :is(th:last-child, td:last-child:not([colspan])),
+.team-recon-ledger:not(.team-recon-details) .ops-table :is(th, td):is(:nth-child(5), :nth-child(6)),
+.team-recon-details .ops-table :is(th, td):nth-child(5) { text-align: end; }
 .team-recon-ledger .ops-table td:last-child:not([colspan]) { white-space: normal; }
 .team-recon-ledger :is(.ops-table-wrap, .ops-table-action):focus-visible, .team-recon-details:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
-@media (max-width: 700px) {
-  .team-recon-filter-hint { flex-basis: 100%; margin-inline-start: 0; }
-}
-@media (max-width: 599px) {
-  .team-recon-config { grid-template-columns: repeat(2, minmax(0, 1fr)); }
-  .team-recon-config > div:last-child, .team-recon-snapshot .statement-totals > [data-total="share"] { grid-column: 1 / -1; }
-  .team-recon-config > div, .team-recon-ledger-heading { padding-inline: 14px; }
-  .team-recon-snapshot .statement-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
-  .team-recon-snapshot .statement-totals > div:last-child { border-inline-start: 1px solid var(--border-subtle); }
+@media (max-width: 760px) {
+  .team-recon-overview { grid-template-columns: minmax(0, 1fr); }
+  .team-recon-snapshot, .team-recon-config, .team-recon-ledger-heading { padding: 14px 18px; }
+  .team-recon-config { border-inline-start: 0; border-block-start: 1px solid var(--border-subtle); }
+  .team-recon-filter-hint, .team-recon-detail-note { margin-inline-start: 0; }
   .team-recon-filters > .ops-import-note { margin-inline: 18px; }
 }