Files
jiu/client/lib/widgets/ds/status_icon_map.dart
T
wangjia 65c672b4ad feat(client): 库存三态 UI——抽屉挂售 switch + 三态徽章/筛选/已售 KPI 卡
- 新组件 DsSwitch(原型 atoms .switch 对照,L1 已登记:38×22 pill,on=primary)
- 商品抽屉状态行:三态徽章后跟挂售 switch(在售⇄库存 即时生效,已售只读,
  readonly 禁用),桌面 drawer / 移动 sheet 同组件
- 列表状态列/卡片徽章三态化(在售绿/库存蓝/已售灰,icons BADGE_ICON 补两词);
  状态筛选改「全部/在售/库存/已售」走服务端;预警缺货退出状态维度由数量染色承担
- KPI 第四卡「缺货预警」→「已售」(sold_count,点击筛选已售)
- 原型同步:atoms/index 登记 switch 与 b-库存/b-已售、inventory 两屏三态数据、
  抽屉状态行 switch;12 道 ds 闸 + L1 同源闸全过
- golden 重录 ×9(三态徽章 + 已售卡形态)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-07 13:35:19 +08:00

53 lines
2.2 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// widgets/ds/status_icon_map.dart — 状态词 → 徽章图标映射。
// 单一真相源镜像:原型 icons.js 的 BADGE_ICON2026-07-04 拍板:全系统圆点→代表图标),
// 逐词转录为 LucideIcons。新增状态先在原型 icons.js 登记,再同步到此表。
import 'package:flutter/widgets.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
const Map<String, IconData> kStatusIcons = {
// 库存状态(三态落库 2026-07-07:在售/库存/已售;预警/缺货为数量派生提示)
'在售': LucideIcons.shoppingCart, // i-cart
'库存': LucideIcons.box, // i-box
'已售': LucideIcons.check, // i-check
'预警': LucideIcons.triangleAlert, // i-alert
'缺货': LucideIcons.x, // i-close
// 单据状态
'草稿': LucideIcons.fileText, // i-ic06
'待审核': LucideIcons.clock, // i-ic04
'已审核': LucideIcons.check, // i-check
'已拒绝': LucideIcons.x, // i-close
'已通过': LucideIcons.check, // i-check
'已驳回': LucideIcons.x, // i-close
'部分退单': LucideIcons.undo2, // i-undo
'已退单': LucideIcons.undo2, // i-undo
'待定价': LucideIcons.japaneseYen, // i-yen
// 通用启停 / 往来类型
'启用': LucideIcons.check, // i-check
'停用': LucideIcons.x, // i-close
'供应商': LucideIcons.box, // i-box
'客户': LucideIcons.user, // i-ic37
'两者': LucideIcons.refreshCw, // i-refresh
// 角色
'管理员': LucideIcons.shield, // i-shield-2
'普通': LucideIcons.user, // i-ic37
'只读': LucideIcons.eye, // i-eye
// 设备 / 会话
'在线': LucideIcons.wifi, // i-wifi
'离线': LucideIcons.wifiOff, // i-wifi-off
// 盘点
'进行中': LucideIcons.clock, // i-ic04
'已完成': LucideIcons.check, // i-check
// 兑换券
'未使用': LucideIcons.tag, // i-tag
'已兑换': LucideIcons.check, // i-check
'作废': LucideIcons.x, // i-close
// 财务
'未结清': LucideIcons.clock, // i-ic04
'已结清': LucideIcons.check, // i-check
'收款': LucideIcons.download, // i-download
'付款': LucideIcons.upload, // i-upload
};
/// 查状态词对应图标;未登记返回 null(调用方回退圆点形态)。
IconData? statusIcon(String label) => kStatusIcons[label];