feat(assets): refine compact inventory drilldowns and exact subtotal scopes
This commit is contained in:
@@ -43,7 +43,7 @@ export function InventoryStatisticsSection(props: InventoryStatisticsSectionProp
|
||||
<header className="inventory-heading">
|
||||
<div className="inventory-title">
|
||||
<span className="inventory-title-icon"><Boxes size={20} aria-hidden="true" /></span>
|
||||
<div><h2 id={`${id}-heading`}>库存统计</h2><p>从区域与车型查看库存分布,点击数量查看车辆明细</p></div>
|
||||
<div><h2 id={`${id}-heading`}>库存统计</h2><p>按区域、车型核对库存分布</p></div>
|
||||
</div>
|
||||
<button ref={filterTrigger} className="inventory-control" aria-expanded={filterOpen} aria-controls={`${id}-filters`}
|
||||
onClick={() => { if (!filterOpen) setDraft({ ...filters }); setFilterOpen(!filterOpen); }}>
|
||||
@@ -58,7 +58,7 @@ export function InventoryStatisticsSection(props: InventoryStatisticsSectionProp
|
||||
<span>{activeFilters.length ? '筛选后库存' : '库存总数'}<ArrowUpRight size={16} aria-hidden="true" /></span>
|
||||
<strong>{total.toLocaleString()}<small>台</small></strong>
|
||||
</button>
|
||||
<button className="inventory-metric" disabled={!pending}
|
||||
<button className="inventory-metric inventory-metric-pending" disabled={!pending}
|
||||
onClick={() => select(inventorySelection(filters, '库存统计 · 待交车', { category: 'Pending' }))}>
|
||||
<span>其中待交车<ArrowUpRight size={16} aria-hidden="true" /></span>
|
||||
<strong>{pending.toLocaleString()}<small>台</small></strong>
|
||||
@@ -107,13 +107,13 @@ export function InventoryStatisticsSection(props: InventoryStatisticsSectionProp
|
||||
</div>
|
||||
<div className="inventory-toolbar-actions">
|
||||
<label className="inventory-sort"><span className="sr-only">库存分组排序</span><select value={sort} onChange={event => setSort(event.target.value as typeof sort)}><option value="default">默认排序</option><option value="quantity">库存从多到少</option></select></label>
|
||||
<button className="inventory-text-button" disabled={!groups.length} onClick={() => groups.forEach(group => { if (expanded.has(group.name) === allExpanded) toggle(group.name); })}>
|
||||
<button className="inventory-text-button inventory-expand-all" disabled={!groups.length} onClick={() => groups.forEach(group => { if (expanded.has(group.name) === allExpanded) toggle(group.name); })}>
|
||||
{allExpanded ? <ChevronsDownUp size={16} aria-hidden="true" /> : <ChevronsUpDown size={16} aria-hidden="true" />}{allExpanded ? '收起全部' : '展开全部'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{groups.length ? <><InventoryDesktopTable {...listProps} /><InventoryMobileList {...listProps} /></> :
|
||||
{groups.length ? <><InventoryDesktopTable {...listProps} /><InventoryMobileList key={JSON.stringify([tab, filters])} {...listProps} /></> :
|
||||
<div className="inventory-empty"><SearchX size={32} aria-hidden="true" /><h3>{activeFilters.length ? '没有符合条件的库存' : '暂无库存数据'}</h3><p>{activeFilters.length ? '试试减少筛选条件,或清除筛选查看全部库存。' : '当前所属公司范围内暂无库存记录。'}</p>{activeFilters.length > 0 && <button className="inventory-control" onClick={resetFilters}>清除筛选</button>}</div>}
|
||||
<footer className="inventory-footer"><span role="status" aria-live="polite">共 {groups.length} 个{tab === 'region' ? '区域' : '车型'} · {rows.length} 条记录 · {total.toLocaleString()} 台库存</span><span>占比基于当前筛选结果 · 单位:台</span></footer>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user