feat(client): 库存表格列头排序 UI——DsSortHeader 点击循环 升/降/无
- 新组件 DsSortHeader(原型 thead .sh 对照,L1 已登记):未排序淡箭头暗示 可排,激活 primary + 方向箭头(↑升/↓降) - 库存屏 5 列(库存/成本价/总价/生产日期/入库时间)接线,排序走服务端 全局生效(跨分页),点击循环 无→升→降→无 - 原型 inventory.html COLS sort:true + toggleSort 交互 + atoms .sh 样式登记 - 桌面库存 golden 重录 ×3(列头带排序箭头) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
@@ -479,6 +479,50 @@ class _DsTableState extends State<DsTable> {
|
||||
}
|
||||
}
|
||||
|
||||
/// 原型 thead th .sh 排序列头(2026-07-07 登记):label + 方向箭头。
|
||||
/// 未排序 = 淡 chevron-down 暗示可排;激活整体 primary,asc=↑ / desc=↓。
|
||||
/// 点击由调用方循环 无→升→降→无(服务端全局排序)。
|
||||
class DsSortHeader extends StatelessWidget {
|
||||
final String label;
|
||||
|
||||
/// null = 未按本列排序;true = 升序;false = 降序
|
||||
final bool? ascending;
|
||||
final VoidCallback onTap;
|
||||
const DsSortHeader(
|
||||
{super.key, required this.label, this.ascending, required this.onTap});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final t = context.tokens;
|
||||
final on = ascending != null;
|
||||
final color = on ? t.primary : t.muted;
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(label,
|
||||
style: TextStyle(
|
||||
fontSize: AppDims.fsSm,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: color)),
|
||||
const SizedBox(width: 4),
|
||||
Opacity(
|
||||
opacity: on ? 1 : .45,
|
||||
child: Icon(
|
||||
ascending == true
|
||||
? LucideIcons.chevronUp
|
||||
: LucideIcons.chevronDown,
|
||||
size: 12,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 原型 thead th .fh 漏斗列头:label + funnel(12, sw1.6),有筛选值时整体 primary。
|
||||
/// 点击回调携带列头自身 BuildContext(供 showDsMenu 锚定)。
|
||||
class DsFilterHeader extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user