@teamix-evo/skills 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/manifest.json +3 -2
- package/package.json +2 -2
- package/src/teamix-evo-code-opentrek/SKILL.md +12 -10
- package/src/teamix-evo-code-opentrek/api-layering.md +8 -5
- package/src/teamix-evo-code-opentrek/checklist.md +2 -0
- package/src/teamix-evo-code-opentrek/error-and-loading.md +38 -25
- package/src/teamix-evo-code-opentrek/file-structure.md +63 -54
- package/src/teamix-evo-code-opentrek/forms-and-validation.md +14 -12
- package/src/teamix-evo-code-opentrek/reuse-first.md +2 -0
- package/src/teamix-evo-code-opentrek/routing-and-codesplit.md +23 -21
- package/src/teamix-evo-code-opentrek/testing.md +32 -28
- package/src/teamix-evo-code-uni-manager/SKILL.md +12 -10
- package/src/teamix-evo-code-uni-manager/api-layering.md +2 -0
- package/src/teamix-evo-code-uni-manager/checklist.md +2 -0
- package/src/teamix-evo-code-uni-manager/error-and-loading.md +3 -1
- package/src/teamix-evo-code-uni-manager/file-structure.md +2 -0
- package/src/teamix-evo-code-uni-manager/forms-and-validation.md +2 -0
- package/src/teamix-evo-code-uni-manager/reuse-first.md +3 -1
- package/src/teamix-evo-code-uni-manager/routing-and-codesplit.md +3 -1
- package/src/teamix-evo-code-uni-manager/testing.md +2 -0
- package/src/teamix-evo-design-opentrek/SKILL.md +213 -52
- package/src/teamix-evo-design-opentrek/boundaries.md +25 -5
- package/src/teamix-evo-design-opentrek/brand.md +7 -7
- package/src/teamix-evo-design-opentrek/checklist.md +15 -13
- package/src/teamix-evo-design-opentrek/components.md +89 -39
- package/src/teamix-evo-design-opentrek/examples/detail-ai-gateway-1.html +1069 -0
- package/src/teamix-evo-design-opentrek/examples/detail-ai-gateway-instance.html +941 -0
- package/src/teamix-evo-design-opentrek/examples/detail-page-api-doc.html +906 -0
- package/src/teamix-evo-design-opentrek/examples/detail-page-config.html +993 -0
- package/src/teamix-evo-design-opentrek/examples/detail-page-monitor.html +1339 -0
- package/src/teamix-evo-design-opentrek/examples/detail-page.html +933 -0
- package/src/teamix-evo-design-opentrek/examples/settings-page.html +1119 -0
- package/src/teamix-evo-design-opentrek/examples/standard-card-list.html +1094 -0
- package/src/teamix-evo-design-opentrek/examples/standard-table-list.html +1361 -0
- package/src/teamix-evo-design-opentrek/examples/wizard-form-page.html +877 -0
- package/src/teamix-evo-design-opentrek/flows.md +85 -12
- package/src/teamix-evo-design-opentrek/foundations.md +12 -9
- package/src/teamix-evo-design-opentrek/generation-flow.md +84 -14
- package/src/teamix-evo-design-opentrek/pages/detail-page/SKILL.md +260 -0
- package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/api-doc-detail.md +163 -0
- package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/comparison-detail.md +100 -0
- package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/monitor-detail.md +190 -0
- package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/resource-detail.md +148 -0
- package/src/teamix-evo-design-opentrek/pages/form-page/SKILL.md +362 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/SKILL.md +286 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/_shared/action-column-spec.md +60 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/_shared/column-meta-rules.md +117 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/_shared/search-combo-spec.md +194 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/_shared/state-action-pattern.md +51 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/advanced-filter-list.md +94 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/card-list.md +558 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/drawer-list.md +76 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/expandable-list.md +70 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/l2-sidebar-list.md +73 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/standard-list.md +198 -0
- package/src/teamix-evo-design-opentrek/patterns/color-mapping.md +96 -0
- package/src/teamix-evo-design-opentrek/patterns/dashboard.md +2 -0
- package/src/teamix-evo-design-opentrek/patterns/detail-page.md +218 -152
- package/src/teamix-evo-design-opentrek/patterns/form-page.md +437 -228
- package/src/teamix-evo-design-opentrek/patterns/list-page.md +221 -260
- package/src/teamix-evo-design-opentrek/patterns/page-types.md +40 -125
- package/src/teamix-evo-design-opentrek/philosophy.md +7 -5
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_AGENT RUNTIME.svg +1 -0
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_AI GATEWAY.svg +1 -0
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_AI STUDIO.svg +1 -0
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_DEV-2.svg +1 -0
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_LOGO.svg +1 -0
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_OPS.svg +1 -0
- package/src/teamix-evo-design-opentrek/rules/boundaries.rules.json +3 -3
- package/src/teamix-evo-design-opentrek/rules/business-mapping.json +124 -0
- package/src/teamix-evo-design-opentrek/rules/common-components.json +924 -0
- package/src/teamix-evo-design-opentrek/rules/component-specs.json +1083 -0
- package/src/teamix-evo-design-opentrek/rules/design-tokens.css +433 -0
- package/src/teamix-evo-design-opentrek/rules/design-tokens.json +2798 -0
- package/src/teamix-evo-design-opentrek/rules/layout-rules.json +218 -0
- package/src/teamix-evo-design-opentrek/rules/page-flow.json +351 -0
- package/src/teamix-evo-design-opentrek/rules/page-frame.json +241 -0
- package/src/teamix-evo-design-opentrek/rules/page-header-spec.md +123 -0
- package/src/teamix-evo-design-opentrek/rules/page-types.json +206 -0
- package/src/teamix-evo-design-opentrek/rules/sidebar-spec.md +217 -0
- package/src/teamix-evo-design-opentrek/rules/styling.json +188 -0
- package/src/teamix-evo-design-opentrek/rules/token-mapping.md +284 -0
- package/src/teamix-evo-design-uni-manager/SKILL.md +18 -27
- package/src/teamix-evo-design-uni-manager/boundaries.md +7 -4
- package/src/teamix-evo-design-uni-manager/brand.md +1 -1
- package/src/teamix-evo-design-uni-manager/components.md +33 -28
- package/src/teamix-evo-design-uni-manager/foundations.md +24 -21
- package/src/teamix-evo-design-uni-manager/generation-flow.md +46 -8
- package/src/teamix-evo-design-uni-manager/patterns/dashboard.md +3 -1
- package/src/teamix-evo-design-uni-manager/patterns/detail-page.md +42 -13
- package/src/teamix-evo-design-uni-manager/patterns/form-page.md +67 -30
- package/src/teamix-evo-design-uni-manager/patterns/list-page.md +73 -40
- package/src/teamix-evo-design-uni-manager/patterns/page-types.md +14 -12
- package/src/teamix-evo-design-uni-manager/philosophy.md +4 -2
- package/src/teamix-evo-design-uni-manager/rules/boundaries.rules.json +3 -3
- package/src/teamix-evo-manage/SKILL.md +74 -66
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
# 卡片视图列表页 (card-list)
|
|
2
|
+
|
|
3
|
+
> 路由自 `../SKILL.md`
|
|
4
|
+
> 覆盖三种卡片视图子类型:**pure-card** / **standard-card** / **view-toggle**
|
|
5
|
+
> 核心组件:**CardGrid** > **ItemCard** × N → **CardActionBar**
|
|
6
|
+
> 全局规则继承:[L1 框架](../../../rules/page-frame.json) / [布局模式](../../../rules/layout-rules.json) / [CRUD 流转](../../../rules/page-flow.json) / [SearchCombo](../_shared/search-combo-spec.md)
|
|
7
|
+
> **本文件为业务卡片三件套(ItemCard/CardGrid/CardActionBar)的唯一规范来源**(v7.3 起:`rules/card-component.json` 已废止,所有规格下沉至此 §9)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 0. 术语区分(强制)
|
|
12
|
+
|
|
13
|
+
| 术语 | 定位 | 别名 | 规范来源 |
|
|
14
|
+
|------|------|------|------|
|
|
15
|
+
| **ContentCard** | 页面主内容**白色容器**,padding 24px,每页**单例** | 白卡容器 / shadcn-Card | `rules/component-specs.json` C7-Card |
|
|
16
|
+
| **ItemCard** | CardGrid 内的**单个数据项卡片**,可重复 N 次 | 业务卡片 / 卡片视图列表项 | 本文件 §9.1 |
|
|
17
|
+
|
|
18
|
+
> **规则**:本 pattern 及任何引用本 pattern 的文档,禁止只写 "Card",必须显式使用 `ContentCard` 或 `ItemCard` 区分。
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. 子类型差异矩阵【唯一真相源】
|
|
23
|
+
|
|
24
|
+
| 维度 | pure-card | standard-card | view-toggle |
|
|
25
|
+
|------|-----------|---------------|-------------|
|
|
26
|
+
| 触发关键词 | "纯卡片"/"卡片管理"/"智能体列表" | "卡片列表"/"分类卡片"/"资源卡片" | "视图切换"/"列表卡片切换" |
|
|
27
|
+
| layout.type | SINGLE_COL | TWO_COL | TWO_COL |
|
|
28
|
+
| layout 模式 | 模式A-CARD | 模式D-CARD | 模式D + ViewToggle |
|
|
29
|
+
| Sidebar | 无 | **有 (240px)** | **有 (240px)** |
|
|
30
|
+
| ViewToggle (ToggleGroup 复用) | 无 | 无 | **必需,ActionToolbar 右侧 Tab 样式** |
|
|
31
|
+
| ItemCard.density | minimal / standard / complex(按信息量选) | 同 pure-card | 仅 **standard** |
|
|
32
|
+
| ItemCard.iconStyle | **avatar**(32×32 圆角) | **avatar** | **tile**(40×40 大方块) |
|
|
33
|
+
| ItemCard 标题字号 | 14px / 500 | 14px / 500 | 16px / 500 |
|
|
34
|
+
| CardGrid.preset | compact / standard / feature | compact / standard / feature | **comfortable** |
|
|
35
|
+
| CardActionBar.mode | density 默认(hover-fade / hover-slidebar) | 同 pure-card | **always-visible**(覆写 density 默认) |
|
|
36
|
+
| Pagination 默认条数 | 12 | 12 | 10(卡片)/ 10(列表) |
|
|
37
|
+
| 其他特殊 | ToggleGroup 胶囊筛选位于 ActionToolbar 右侧 | 同 pure-card | DataTable + BulkActionBar 与 CardGrid 同级,由 ViewToggle 切换可见 |
|
|
38
|
+
|
|
39
|
+
> **density / iconStyle / cardGridPreset / actionBarMode 的详细规格见本文件 §9 三件套完整规范。**
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 2. 通用布局骨架(三个子类型共享,差异仅 Sidebar / ViewToggle)
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
┌─[Sidebar]*─────────┬─────────────────────────────────────────┤
|
|
47
|
+
│ │ PageContainer → ContentWrapper │
|
|
48
|
+
│ * pure-card 无 │ ┌─ ContentCard (白卡容器) ──────────┐ │
|
|
49
|
+
│ │ │ PageHeader (标题 18px/500) │ │
|
|
50
|
+
│ │ │ ActionToolbar: │ │
|
|
51
|
+
│ │ │ [创建] [导入] │ │
|
|
52
|
+
│ │ │ [SearchCombo] [筛选 ToggleGroup] │ │
|
|
53
|
+
│ │ │ [ViewToggle]* │ │
|
|
54
|
+
│ │ │ CardGrid (preset=*) │ │
|
|
55
|
+
│ │ │ ┌─ItemCard───────┐ × N │ │
|
|
56
|
+
│ │ │ │ CardTitleRow │ │ │
|
|
57
|
+
│ │ │ │ [CardDescRow] │ │ │
|
|
58
|
+
│ │ │ │ [CardFieldRow×N] │ │ │
|
|
59
|
+
│ │ │ │ [CardSuppleRow] │ │ │
|
|
60
|
+
│ │ │ │ CardActionBar │ │ │
|
|
61
|
+
│ │ │ └───────────────────┘ │ │
|
|
62
|
+
│ │ │ Pagination │ │
|
|
63
|
+
│ │ └────────────────────────────────────┘ │
|
|
64
|
+
└────────────────────┴─────────────────────────────────────────┘
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
> Sidebar 由 [`page-frame.json`](../../../rules/page-frame.json) L1 自动继承(TWO_COL 显示 / SINGLE_COL 隐藏),本 pattern 不重复声明。
|
|
68
|
+
> ContentCard 内左右对齐遵循 [分层 padding 模型 v7.5](../SKILL.md#5-1-card-内左右对齐稳定规则硬约束)(Card.paddingX 20px 唯一来源)。
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 3. 必需组件清单
|
|
73
|
+
|
|
74
|
+
| 组件 | 来源规范 | 子类型适用 |
|
|
75
|
+
|------|----------|------------|
|
|
76
|
+
| Sidebar | rules/page-frame.json (L1 框架自动继承) | standard-card / view-toggle |
|
|
77
|
+
| ContentCard | rules/component-specs.json C7-Card | 全部 |
|
|
78
|
+
| PageHeader | rules/common-components.json | 全部 |
|
|
79
|
+
| ActionToolbar | — | 全部 |
|
|
80
|
+
| SearchCombo | _shared/search-combo-spec.md | 全部 |
|
|
81
|
+
| ToggleGroup(胶囊筛选 / ViewToggle 复用) | rules/common-components.json | 全部(ViewToggle 仅 view-toggle 必需) |
|
|
82
|
+
| **CardGrid** | **本文件 §9.2** | 全部 |
|
|
83
|
+
| **ItemCard** × N | **本文件 §9.1** | 全部 |
|
|
84
|
+
| **CardActionBar** | **本文件 §9.3** | 全部 |
|
|
85
|
+
| Pagination | rules/common-components.json | 全部 |
|
|
86
|
+
| DataTable | _shared/column-meta-rules.md + action-column-spec.md | view-toggle 切换列表视图时 |
|
|
87
|
+
| BulkActionBar | — | view-toggle 列表视图 |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 4. ItemCard density 选型矩阵
|
|
92
|
+
|
|
93
|
+
| 信息量条件 | 推荐 density |
|
|
94
|
+
|-----------|--------------|
|
|
95
|
+
| 字段 ≤1 行 + 仅名称+状态 + 大量浏览 | minimal |
|
|
96
|
+
| 字段 ≤2 行 + 操作可发现性要求高 | **standard**(默认) |
|
|
97
|
+
| 字段 ≥3 行 + 需展示详情/指标/进度 | complex |
|
|
98
|
+
| 信息量不确定 | standard |
|
|
99
|
+
|
|
100
|
+
> view-toggle 子类型锁死 standard。
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 5. 嵌套约束(合并三处冗余为唯一一处)
|
|
105
|
+
|
|
106
|
+
| 父子关系 | 状态 | 适用子类型 |
|
|
107
|
+
|----------|------|----------|
|
|
108
|
+
| ContentWrapper → ContentCard | ALLOW | 全部 |
|
|
109
|
+
| ContentCard → PageHeader / ActionToolbar / CardGrid / Pagination | ALLOW | 全部 |
|
|
110
|
+
| ContentCard → DataTable + BulkActionBar | ALLOW | view-toggle(与 CardGrid 同级,切换可见) |
|
|
111
|
+
| ActionToolbar → SearchCombo / ToggleGroup / ViewToggle | ALLOW | 全部(ViewToggle 仅 view-toggle) |
|
|
112
|
+
| **CardGrid → ItemCard** | ALLOW | 全部 |
|
|
113
|
+
| **ItemCard → CardActionBar** | ALLOW(slot 引用) | 全部 |
|
|
114
|
+
| ContentWrapper → CardGrid 直挂 | FORBID | 必须经 ContentCard 包裹 |
|
|
115
|
+
| ContentCard → ContentCard | FORBID | 白卡容器为单例 |
|
|
116
|
+
| ItemCard → ItemCard | FORBID | 业务卡片禁止嵌套 |
|
|
117
|
+
| CardGrid → 任何非 ItemCard 子节点 | FORBID | Grid 仅承载业务卡片 |
|
|
118
|
+
|
|
119
|
+
> 卡片组件级硬约束(hover/states/CSS 规则)见 §9。
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 6. CRUD 流转 + 操作行为
|
|
124
|
+
|
|
125
|
+
> 卡片视图操作行为 **完全沿用** ListPage 标准流转,本节仅列出卡片视图要点。
|
|
126
|
+
>
|
|
127
|
+
> - 人可读跨页流转规则 → [`flows.md` §3 CRUD 速查](../../../flows.md#3-crud-流转速查)
|
|
128
|
+
> - 机读结构(URL / Toast / navType)→ [`rules/page-flow.json`](../../../rules/page-flow.json) `crudFlow`
|
|
129
|
+
>
|
|
130
|
+
> 卡片视图要点:
|
|
131
|
+
> - 查看 → DetailPage(保留筛选)
|
|
132
|
+
> - 编辑 → FormPage / Sheet(保存后返回原页)
|
|
133
|
+
> - 删除 → Dialog 二次确认(level3)→ 刷新列表
|
|
134
|
+
> - 批量(仅 view-toggle 列表视图)→ BulkActionBar 启用
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 7. 验证清单(按子类型分组)
|
|
139
|
+
|
|
140
|
+
### 通用项(三个子类型共同检查)
|
|
141
|
+
|
|
142
|
+
- [ ] ItemCard.density 全页一致(同一页面禁止混用)
|
|
143
|
+
- [ ] CardGrid 使用 `var(--card-grid-min-*)` token,禁止硬编码 minWidth 字面量
|
|
144
|
+
- [ ] CardActionBar.mode ∈ {hover-slidebar, hover-fade, always-visible} 三态之一
|
|
145
|
+
- [ ] CardActionBar position: absolute(不撑开卡片高度)
|
|
146
|
+
- [ ] 危险操作(删除)使用 var(--destructive) 底色 + 始终最后位置
|
|
147
|
+
- [ ] ContentCard 内左右对齐遵循分层 padding 模型 v7.5(20px 唯一来源)
|
|
148
|
+
|
|
149
|
+
### 子类型差异项
|
|
150
|
+
|
|
151
|
+
| 验证项 | pure-card | standard-card | view-toggle |
|
|
152
|
+
|--------|-----------|---------------|-------------|
|
|
153
|
+
| layout | SINGLE_COL | TWO_COL + Sidebar | TWO_COL + Sidebar |
|
|
154
|
+
| ViewToggle 存在性 | ❌ | ❌ | ✅ Tab 样式 |
|
|
155
|
+
| ItemCard.iconStyle | avatar | avatar | tile |
|
|
156
|
+
| 标题字号 | 14px | 14px | 16px |
|
|
157
|
+
| CardGrid.preset | compact / standard / feature | compact / standard / feature | comfortable |
|
|
158
|
+
| Pagination | 12 条/页 | 12 条/页 | 10 条/页 |
|
|
159
|
+
| ActionBar 显示时机 | hover 触发 | hover 触发 | 常驻底部 |
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 8. 业务字段绑定(产品配置)
|
|
164
|
+
|
|
165
|
+
> AI 在生成卡片视图列表页时,在确定子类型 + ItemCard variant 后,**必读**:
|
|
166
|
+
> - [`products/{产品}/cards.json`](../../../products/ai-gateway/cards.json):ItemCard slot 与产品业务字段的绑定(v7.2 新增)
|
|
167
|
+
> - [`products/{产品}/states.json`](../../../products/ai-gateway/states.json):操作可用性矩阵
|
|
168
|
+
|
|
169
|
+
### 8.1 cards.json Schema(v7.3 起本文件为唯一规范)
|
|
170
|
+
|
|
171
|
+
```jsonc
|
|
172
|
+
{
|
|
173
|
+
"$default": {
|
|
174
|
+
"component": "ItemCard",
|
|
175
|
+
"variant": { "density": "standard", "iconStyle": "avatar" },
|
|
176
|
+
"slots": {
|
|
177
|
+
"title": { "field": "<业务字段名>", "avatar": { "source": "icon | colorClass | hash", "fallback": "colorHash" } },
|
|
178
|
+
"description": { "field": "<业务字段名>", "lineClamp": 1 },
|
|
179
|
+
"fields": [{ "label": "<标签>", "field": "<业务字段名>" }],
|
|
180
|
+
"supplementary": { "fields": ["<字段1>", "<字段2>"] },
|
|
181
|
+
"actions": ["<操作 ID,引用 states.json>"]
|
|
182
|
+
},
|
|
183
|
+
"grid": { "component": "CardGrid", "preset": "standard" }
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
- **加载阶段**:阶段 ②.5(与 `columns.json` / `states.json` 同阶段)
|
|
189
|
+
- **范例文件**:[`products/ai-gateway/cards.json`](../../../products/ai-gateway/cards.json)
|
|
190
|
+
- **actions 引用**:必须指向 `states.json` 已声明的操作,避免重复定义
|
|
191
|
+
|
|
192
|
+
### 8.2 子类型 → 三件套参数映射
|
|
193
|
+
|
|
194
|
+
| 子类型 | itemCard.density | itemCard.iconStyle | cardGridPreset | actionBarMode |
|
|
195
|
+
|-------|------------------|---------------------|----------------|---------------|
|
|
196
|
+
| pure-card | minimal / standard / complex | avatar | compact / standard / feature(与 density 一一对应) | 由 density 决定(hover-fade / hover-slidebar) |
|
|
197
|
+
| standard-card | minimal / standard / complex | avatar | compact / standard / feature(与 density 一一对应) | 由 density 决定(hover-fade / hover-slidebar) |
|
|
198
|
+
| view-toggle | standard(锁死) | tile | comfortable | **always-visible**(覆写 density 默认) |
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 9. 业务卡片三件套完整规格【唯一规范来源】
|
|
203
|
+
|
|
204
|
+
> 本节规格自 v7.3 起从 `rules/card-component.json` 下沉至此。`common-components.json` 中 ItemCard/CardGrid/CardActionBar 的 `specRef` 指向本节锚点。
|
|
205
|
+
> 三件套用于列表页卡片视图;未来如 Dashboard / Workspace / Overview 需要复用,可直接引用本节锚点。
|
|
206
|
+
|
|
207
|
+
### 9.1 ItemCard(业务卡片)
|
|
208
|
+
|
|
209
|
+
- **level**: ORGANISM
|
|
210
|
+
- **layer**: business
|
|
211
|
+
- **shadcnComponent**: Card(基于白卡容器扩展)
|
|
212
|
+
- **场景**:CardGrid 内的单个数据项卡片,含 Title/Description/Field/Supplementary/ActionBar 等 slot,可重复多次出现。
|
|
213
|
+
|
|
214
|
+
#### 9.1.1 variants 变体
|
|
215
|
+
|
|
216
|
+
| 维度 | 选项 | 默认 | 说明 |
|
|
217
|
+
|------|------|------|------|
|
|
218
|
+
| density | minimal / standard / complex | standard | 信息密度,按 §4 选型矩阵决定 |
|
|
219
|
+
| iconStyle | avatar / tile | avatar | avatar=32×32 圆角(pure-card / standard-card);tile=40×40 大方块(view-toggle) |
|
|
220
|
+
| titleFontSize | 14px / 16px | — | iconStyle=avatar → 14px/500;iconStyle=tile → 16px/500 |
|
|
221
|
+
|
|
222
|
+
**iconStyle.avatar 详细**:
|
|
223
|
+
- size: 32×32(常规/复杂)/ 24×24(极简)
|
|
224
|
+
- shape: 圆角矩形 `var(--input-radius)`
|
|
225
|
+
- fallback: 首字母色块 + Glossy 光泽(见 §9.1.6)
|
|
226
|
+
|
|
227
|
+
**iconStyle.tile 详细**:
|
|
228
|
+
- size: 40×40
|
|
229
|
+
- shape: 大方块(直角或微圆角)
|
|
230
|
+
- fallback: 纯图标,无首字母回退
|
|
231
|
+
|
|
232
|
+
#### 9.1.2 slots(5 个 slot 区,按 density 决定使用)
|
|
233
|
+
|
|
234
|
+
| Slot | minimal | standard | complex | 元素与样式 |
|
|
235
|
+
|------|---------|----------|---------|-----------|
|
|
236
|
+
| **CardTitleRow** | 必需 | 必需 | 必需 | icon + title + [badge] + [statusDot] |
|
|
237
|
+
| **CardDescriptionRow** | 禁止 | 必需 | 必需 | text(standard: 12px/lineClamp 1;complex: 14px/lineClamp 2);color: `var(--gray-tertiary)` |
|
|
238
|
+
| **CardFieldRow** | 禁止 | 0-2 行(可选) | 2-4 行(可选) | fieldIcon(12×12) + fieldLabel(12px) + fieldValue(14px standard / 12px complex) |
|
|
239
|
+
| **CardSupplementaryRow** | 1 行(必需) | 0-1 行(可选) | 1 行(必需) | 元信息:创建人/时间/地域;icon(12×12) + label(12px) + value(12px) |
|
|
240
|
+
| **CardActionBar** | 必需 | 必需 | 必需 | 通过 slot 引用(见 §9.3) |
|
|
241
|
+
|
|
242
|
+
**CardTitleRow 元素**:
|
|
243
|
+
- icon: minimal=24×24;standard=Avatar 32×32(avatar) / Icon 40×40(tile);complex=Avatar 32×32;borderRadius `var(--input-radius)`;flex-shrink 0
|
|
244
|
+
- title: 由 variants.titleFontSize 决定;font-weight 500;color `var(--gray-primary)`;单行 truncate
|
|
245
|
+
- badge(可选): 10px / padding 1px 4px / border-radius 2px;用于「企业版」「Beta」标识
|
|
246
|
+
- statusDot(可选): 6px 圆点;位置标题尾部或卡片右上角
|
|
247
|
+
|
|
248
|
+
**CardDescriptionRow CSS**:
|
|
249
|
+
```css
|
|
250
|
+
.card-desc {
|
|
251
|
+
overflow: hidden;
|
|
252
|
+
text-overflow: ellipsis;
|
|
253
|
+
display: -webkit-box;
|
|
254
|
+
-webkit-line-clamp: N; /* standard=1 / complex=2 */
|
|
255
|
+
-webkit-box-orient: vertical;
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
#### 9.1.3 rowGap(slot 间垂直间距,仅 standard 模式)
|
|
260
|
+
|
|
261
|
+
| from → to | gap |
|
|
262
|
+
|-----------|-----|
|
|
263
|
+
| CardTitleRow → CardDescriptionRow | 4px |
|
|
264
|
+
| CardDescriptionRow → CardFieldRow | 8px |
|
|
265
|
+
| CardFieldRow → CardSupplementaryRow | 4px |
|
|
266
|
+
|
|
267
|
+
#### 9.1.4 structureByDensity(density 结构概览)
|
|
268
|
+
|
|
269
|
+
| density | rowsAscii | 高度 | actionBarMode |
|
|
270
|
+
|---------|-----------|------|----------------|
|
|
271
|
+
| minimal | CardTitleRow → CardSupplementaryRow → CardActionBar | ~100px | hover-fade |
|
|
272
|
+
| standard | CardTitleRow → CardDescriptionRow → CardFieldRow(0-2) → CardSupplementaryRow(0-1) → CardActionBar | ~160px | hover-slidebar(默认)/ always-visible(view-toggle 覆写)|
|
|
273
|
+
| complex | CardTitleRow → CardDescriptionRow(line-clamp:2) → CardFieldRow×2-4 → CardSupplementaryRow → CardActionBar(1-2行) | 240px+ | hover-slidebar |
|
|
274
|
+
|
|
275
|
+
#### 9.1.5 states(卡片整体状态)
|
|
276
|
+
|
|
277
|
+
| state | border | background | shadow | actionBar |
|
|
278
|
+
|-------|--------|------------|--------|-----------|
|
|
279
|
+
| default | 1px solid `var(--gray-border)` | `var(--card)` | none | 由 actionBarMode 决定:hover-* 隐藏 / always-visible 常驻 |
|
|
280
|
+
| hover | 1px solid `var(--primary)` + breathing | `var(--card)` | `var(--shadow-sm)` | 可见 |
|
|
281
|
+
| focus | 2px solid `var(--primary)` | `var(--card)` | `var(--shadow-sm)` | 可见 |
|
|
282
|
+
| disabled | 1px solid `var(--gray-border)` | `var(--gray-fill)` | none | 隐藏 |
|
|
283
|
+
|
|
284
|
+
**hover.breathingBorder CSS**:
|
|
285
|
+
```css
|
|
286
|
+
@keyframes breathing { 0%,100% { opacity:0.5 } 50% { opacity:1 } }
|
|
287
|
+
.card-hover-breathing { animation: breathing 2s ease-in-out infinite; }
|
|
288
|
+
```
|
|
289
|
+
应用在 hover 状态下的 border。
|
|
290
|
+
|
|
291
|
+
**clickBehavior**:
|
|
292
|
+
- 卡片主体点击:跳转 DetailPage 或进入编辑
|
|
293
|
+
- ActionBar 点击:执行对应 action,事件 `stopPropagation` 不影响卡片 hover
|
|
294
|
+
|
|
295
|
+
#### 9.1.6 avatarPreset(色块头像系统,iconStyle=avatar 且无图片时)
|
|
296
|
+
|
|
297
|
+
**colorClasses**(9 种):`bg-primary` / `bg-success` / `bg-type-mcp` / `bg-warning` / `bg-data-8` / `bg-data-1` / `bg-destructive` / `bg-brand-3` / `bg-data-4`
|
|
298
|
+
|
|
299
|
+
**fallbackPriority**:
|
|
300
|
+
1. avatar 字段为有效颜色 class → 色块 + 首字母
|
|
301
|
+
2. avatar 字段为有效图片 URL → `<img>`
|
|
302
|
+
3. avatar 字段为空 → `name.charAt(0)` hash 到预设色 + 首字母
|
|
303
|
+
|
|
304
|
+
**blockStyle**:
|
|
305
|
+
- size: 32×32
|
|
306
|
+
- borderRadius: `var(--input-radius)`
|
|
307
|
+
- textColor: `#fff`
|
|
308
|
+
- fontWeight: 600
|
|
309
|
+
- fontSize: 14px
|
|
310
|
+
- content: `name.charAt(0).toUpperCase()`
|
|
311
|
+
|
|
312
|
+
**glossy 光泽 CSS**(色块右侧叠加半透明白色渐变):
|
|
313
|
+
```css
|
|
314
|
+
.avatar-gloss {
|
|
315
|
+
position: absolute;
|
|
316
|
+
width: 18px; height: 32px;
|
|
317
|
+
right: 0; top: 0;
|
|
318
|
+
background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.2) 40%, transparent 100%);
|
|
319
|
+
pointer-events: none;
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
#### 9.1.7 constraints(硬约束)
|
|
324
|
+
|
|
325
|
+
- 标题:必须包含,禁止无标题卡片
|
|
326
|
+
- 标题长度:单行省略 (truncate)
|
|
327
|
+
- 描述长度:standard 1 行 / complex 最多 2 行 (`-webkit-line-clamp: 2`)
|
|
328
|
+
- 卡片嵌套:禁止业务卡片嵌套业务卡片(最多 1 级)
|
|
329
|
+
- 样式一致性:同一页面内 ItemCard 的 density + iconStyle 必须保持一致
|
|
330
|
+
- 深色模式:所有图标使用 mask-image 方案(见 [boundaries.md I1-I4](../../../boundaries.md))
|
|
331
|
+
|
|
332
|
+
#### 9.1.8 tokens(设计 token 映射)
|
|
333
|
+
|
|
334
|
+
| 用途 | token |
|
|
335
|
+
|------|-------|
|
|
336
|
+
| background | `--card` |
|
|
337
|
+
| border | `--gray-border` |
|
|
338
|
+
| borderHover | `--primary` |
|
|
339
|
+
| shadowHover | `--shadow-sm` |
|
|
340
|
+
| radius | `--radius-lg` (12px) |
|
|
341
|
+
| iconRadius | `--input-radius` (8px) |
|
|
342
|
+
| titleColor | `--gray-primary` |
|
|
343
|
+
| fieldColor | `--gray-secondary` |
|
|
344
|
+
| descColor | `--gray-tertiary` |
|
|
345
|
+
| disabledBg | `--gray-fill` |
|
|
346
|
+
| transitionDuration | `--duration-normal` (200ms) |
|
|
347
|
+
| transitionEasing | `--easing-ease` |
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
### 9.2 CardGrid(卡片网格)
|
|
352
|
+
|
|
353
|
+
- **level**: ORGANISM
|
|
354
|
+
- **layer**: business
|
|
355
|
+
- **shadcnImpl**: null
|
|
356
|
+
- **场景**:承载多个 ItemCard,使用 CSS Grid `auto-fill` + `minmax` 自动响应式列数。
|
|
357
|
+
|
|
358
|
+
#### 9.2.1 props
|
|
359
|
+
|
|
360
|
+
| prop | 取值 | 说明 |
|
|
361
|
+
|------|------|------|
|
|
362
|
+
| minWidth | 必须引用 `var(--card-grid-min-*)` | 最小列宽(H2 修复,禁止字面量) |
|
|
363
|
+
| gap | `var(--card-gap)` 默认 16px | 卡片间距 |
|
|
364
|
+
| alignContent | literal: `'start'` | 防止卡片拉伸变形 |
|
|
365
|
+
| children | `ItemCard[]` | 仅承载业务卡片 |
|
|
366
|
+
|
|
367
|
+
#### 9.2.2 CSS 实现
|
|
368
|
+
|
|
369
|
+
```css
|
|
370
|
+
.card-grid {
|
|
371
|
+
display: grid;
|
|
372
|
+
grid-template-columns: repeat(
|
|
373
|
+
auto-fill,
|
|
374
|
+
minmax(var(--card-grid-min, var(--card-grid-min-standard)), 1fr)
|
|
375
|
+
);
|
|
376
|
+
gap: var(--card-gap, 16px);
|
|
377
|
+
align-content: start;
|
|
378
|
+
}
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
#### 9.2.3 presets(4 套预设;pagination 已移除,真相源回归 §1 矩阵)
|
|
382
|
+
|
|
383
|
+
| preset | minWidth | iconStyle | density | usedBy |
|
|
384
|
+
|--------|----------|-----------|---------|--------|
|
|
385
|
+
| **compact** | `var(--card-grid-min-compact)` (240px) | avatar | minimal | pure-card / standard-card |
|
|
386
|
+
| **standard** | `var(--card-grid-min-standard)` (300px) | avatar | standard | pure-card / standard-card |
|
|
387
|
+
| **feature** | `var(--card-grid-min-feature)` (360px) | avatar | complex | pure-card / standard-card |
|
|
388
|
+
| **comfortable** | `var(--card-grid-min-comfortable)` (320px) | tile | standard | view-toggle |
|
|
389
|
+
|
|
390
|
+
> Token 定义见 `rules/design-tokens.css`。
|
|
391
|
+
|
|
392
|
+
#### 9.2.4 responsive(参考列数,由 auto-fill 自动计算,无需手写断点)
|
|
393
|
+
|
|
394
|
+
| viewport | columns |
|
|
395
|
+
|----------|---------|
|
|
396
|
+
| ≥1400px | 4 |
|
|
397
|
+
| 1080-1400px | 3 |
|
|
398
|
+
| 768-1080px | 2 |
|
|
399
|
+
| <768px | 1 |
|
|
400
|
+
|
|
401
|
+
#### 9.2.5 constraints(硬约束)
|
|
402
|
+
|
|
403
|
+
- 禁止手动写 `grid-template-columns` 字面量(必须用 `minmax + var(--min-width)`)
|
|
404
|
+
- 禁止 `alignContent: stretch`(会导致卡片高度被拉伸变形)
|
|
405
|
+
- 禁止在 CardGrid 与 ItemCard 之间插入额外 wrapper
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
### 9.3 CardActionBar(卡片操作栏)
|
|
410
|
+
|
|
411
|
+
- **level**: MOLECULAR
|
|
412
|
+
- **layer**: business
|
|
413
|
+
- **shadcnImpl**: null
|
|
414
|
+
- **场景**:ItemCard 底部的操作栏 — 滑条式 (SlideBar) 设计,白底 + 主要文字色 + 等分宽度(v7.3.1 从主色底调整为白底以提升可读性与表单化一致性)。
|
|
415
|
+
|
|
416
|
+
#### 9.3.1 props
|
|
417
|
+
|
|
418
|
+
| prop | 取值 | 说明 |
|
|
419
|
+
|------|------|------|
|
|
420
|
+
| actions | `Array<{ label, onClick, destructive? }>` | 操作列表 |
|
|
421
|
+
| mode | `'hover-slidebar' \| 'hover-fade' \| 'always-visible'` | 三态,默认由 ItemCard.density 决定,pattern 可覆写 |
|
|
422
|
+
| rows | 1 \| 2 | complex 模式可分行 |
|
|
423
|
+
|
|
424
|
+
#### 9.3.2 containerSpec(容器规格)
|
|
425
|
+
|
|
426
|
+
```css
|
|
427
|
+
.card-action-bar {
|
|
428
|
+
position: absolute;
|
|
429
|
+
bottom: 0; left: 0; right: 0;
|
|
430
|
+
background: var(--card); /* v7.3.1 白底 */
|
|
431
|
+
border-top: 1px solid var(--gray-line); /* v7.3.1 顶部分割线代替主色底边 */
|
|
432
|
+
display: flex;
|
|
433
|
+
z-index: 2;
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
> **硬约束**:
|
|
438
|
+
> - 禁止撑开卡片高度(必须 `position: absolute`)
|
|
439
|
+
> - 背景色与 ContentCard 保持一致(`var(--card)`),全局调整背景时不需修改本节
|
|
440
|
+
|
|
441
|
+
#### 9.3.3 actionButtonSpec(按钮规格)
|
|
442
|
+
|
|
443
|
+
| 属性 | 值 |
|
|
444
|
+
|------|---|
|
|
445
|
+
| flex | 1(等分宽度) |
|
|
446
|
+
| padding | 8px |
|
|
447
|
+
| text-align | center |
|
|
448
|
+
| color | `var(--gray-primary)`(v7.3.1 主要文字色) |
|
|
449
|
+
| font-size | 13px |
|
|
450
|
+
| font-weight | 500 |
|
|
451
|
+
| cursor | pointer |
|
|
452
|
+
| border-right | `1px solid var(--gray-line)`(v7.3.1 按钮间分隔为浅分割线) |
|
|
453
|
+
| last-child | border-right: none |
|
|
454
|
+
| hover-bg | `var(--gray-fill)`(v7.3.1 浅灰样式 hover) |
|
|
455
|
+
| hover-color | `var(--primary)`(v7.3.1 hover 文字高亮为主色,提高可交互发现性) |
|
|
456
|
+
|
|
457
|
+
**destructive 按钮**(醒目警示,保留原色机制):
|
|
458
|
+
- background: `transparent`(默认跟随白底)
|
|
459
|
+
- color: `var(--destructive)`(红色文字表警示)
|
|
460
|
+
- hover-bg: `var(--destructive-bg)`(浅红背景 #FEF2F2)
|
|
461
|
+
- hover-color: `var(--destructive)`(保持红色)
|
|
462
|
+
- 位置:始终放在最后
|
|
463
|
+
|
|
464
|
+
#### 9.3.4 modes 实现表(三态完整 CSS,名称与 ItemCard.structureByDensity.actionBarMode 完全一致)
|
|
465
|
+
|
|
466
|
+
##### hover-slidebar(默认;适用 standard / complex density)
|
|
467
|
+
- trigger: 鼠标 hover 卡片
|
|
468
|
+
- method: `transform: translateY(100%)` → `translateY(0)`
|
|
469
|
+
- duration: 200ms / easing: ease
|
|
470
|
+
- visual: 白底上滑,顶部 1px 浅灰分割线与上方内容区分
|
|
471
|
+
|
|
472
|
+
```css
|
|
473
|
+
.card-action-bar { transform: translateY(100%); transition: transform .2s ease; }
|
|
474
|
+
.card:hover .card-action-bar { transform: translateY(0); }
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
> **禁止**:使用 `max-height`(触发 reflow,性能差)
|
|
478
|
+
|
|
479
|
+
##### hover-fade(适用 minimal density)
|
|
480
|
+
- trigger: 鼠标 hover 卡片
|
|
481
|
+
- method: visibility + opacity 切换
|
|
482
|
+
- duration: 200ms / easing: ease
|
|
483
|
+
|
|
484
|
+
```css
|
|
485
|
+
.card-action-bar { visibility: hidden; opacity: 0; transition: all .2s ease; }
|
|
486
|
+
.card:hover .card-action-bar { visibility: visible; opacity: 1; }
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
> **禁止**:使用 `display: none`(会导致卡片高度变化)
|
|
490
|
+
|
|
491
|
+
##### always-visible(view-toggle 子类型覆写)
|
|
492
|
+
- trigger: 无需 hover,常驻底部可见
|
|
493
|
+
- method: 静态显示,无动画
|
|
494
|
+
|
|
495
|
+
```css
|
|
496
|
+
.card-action-bar {
|
|
497
|
+
transform: none;
|
|
498
|
+
visibility: visible;
|
|
499
|
+
opacity: 1;
|
|
500
|
+
position: absolute;
|
|
501
|
+
bottom: 0;
|
|
502
|
+
}
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
> **禁止**:跟随 hover 状态切换可见性
|
|
506
|
+
|
|
507
|
+
#### 9.3.5 rowsRule(按钮行规则)
|
|
508
|
+
|
|
509
|
+
**single(rows=1)**:
|
|
510
|
+
- max: 4 个按钮
|
|
511
|
+
- buttonGap: 8px
|
|
512
|
+
- overflow: 操作 >5 个时,剩余进入「更多 ▾」Dropdown
|
|
513
|
+
|
|
514
|
+
**double(rows=2)**:
|
|
515
|
+
- row1: 高频操作(管理/编辑/详情等,≤4 个)
|
|
516
|
+
- row2: 低频操作 + 「更多 ▾」(续费/导出/删除等)
|
|
517
|
+
- buttonGap: 8px
|
|
518
|
+
- rowGap: 4px
|
|
519
|
+
|
|
520
|
+
#### 9.3.6 actionBehavior(操作触发后的页面流转,引用 page-flow.json crudFlow)
|
|
521
|
+
|
|
522
|
+
| action | confirm | target | after |
|
|
523
|
+
|--------|---------|--------|-------|
|
|
524
|
+
| 查看/详情 | false | DetailPage | 返回保持筛选 |
|
|
525
|
+
| 编辑 | false | FormPage / Sheet | 保存后返回原页 |
|
|
526
|
+
| 导出 | false | 文件下载 | — |
|
|
527
|
+
| 删除 | Dialog 二次确认(level3)| API 调用 | 刷新列表 |
|
|
528
|
+
|
|
529
|
+
#### 9.3.7 constraints(硬约束)
|
|
530
|
+
|
|
531
|
+
- **样式**:禁止使用文字按钮或 Primary Button 替代滑条式样式
|
|
532
|
+
- **背景**:`var(--card)` 白底(v7.3.1),与 ContentCard 保持一致;禁止使用主色底
|
|
533
|
+
- **文字**:`var(--gray-primary)` 主要文字色(v7.3.1);hover 转 `var(--primary)` 提示可点击
|
|
534
|
+
- **动画**:仅使用本节 §9.3.4 三态(hover-slidebar / hover-fade / always-visible),禁止 `display:none` / `max-height`
|
|
535
|
+
- **位置**:必须 `position: absolute; bottom: 0`,不撑开卡片高度
|
|
536
|
+
- **危险操作**:`color: var(--destructive)` 红色文字(v7.3.1 从红底调整),始终放在最后;hover-bg `var(--destructive-bg)`
|
|
537
|
+
- **按钮分隔**:相邻按钮使用 `1px solid var(--gray-line)` 右边框(v7.3.1 浅灰分割线),最后一个按钮无右边框
|
|
538
|
+
|
|
539
|
+
---
|
|
540
|
+
|
|
541
|
+
## 10. 渲染流程(AI 生成卡片视图列表页时的引用顺序)
|
|
542
|
+
|
|
543
|
+
1. **列表 pattern 路由** → 确定 layout(模式A-CARD / 模式D-CARD / 模式D + ViewToggle)
|
|
544
|
+
2. **读取本文件** → 通过 §1 差异矩阵确认子类型;通过 §9 确认 ItemCard / CardGrid / CardActionBar 的 variant 与 preset
|
|
545
|
+
3. **读取 `products/{产品}/cards.json`** → 取 ItemCard slot 的业务字段映射(§8)
|
|
546
|
+
4. **读取 `products/{产品}/states.json`** → 取 actions 可用性(按状态机过滤)
|
|
547
|
+
5. **渲染** CardGrid > ItemCard × N > slots(按 variant 决定 slot 启用/禁用,参考 §9.1.4 structureByDensity)
|
|
548
|
+
6. **应用** `rules/design-tokens.css` 变量(特别是 `--card-grid-min-*` / `--card-gap` / `--primary` / `--gray-*`)→ 完成样式
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
## 附录:版本变迁
|
|
553
|
+
|
|
554
|
+
| 版本 | 变更 |
|
|
555
|
+
|------|------|
|
|
556
|
+
| v7.1 | 卡片规范从 `card-component-rules.md` 升格为 `rules/card-component.json` 业务组件 contract(ItemCard/CardGrid/CardActionBar 注册到 common-components.json) |
|
|
557
|
+
| v7.2 | 三 patterns(pure-card-list / standard-card-list / view-toggle-list)合并为本文件;contract 修复 H1-H4 |
|
|
558
|
+
| **v7.3** | **`rules/card-component.json` 废止**:完整规格下沉至本文件 §9(ItemCard / CardGrid / CardActionBar 的 variants / slots / states / hover / avatar / modes / constraints / tokens);术语区分迁至 §0;cards.json Schema 迁至 §8.1;pageTypeMapping 迁至 §8.2;renderingFlow 迁至 §10。`common-components.json` 中 specRef 改指本文件锚点。 |
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# 抽屉中列表页 (drawer)
|
|
2
|
+
|
|
3
|
+
> 路由自 `../SKILL.md`
|
|
4
|
+
> 布局模式: 模式D (内嵌 Sheet/Dialog)
|
|
5
|
+
> 核心差异: 列表嵌入在 Sheet 中,用于选择关联数据
|
|
6
|
+
|
|
7
|
+
## 1. 布局骨架
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
┌──────────────────────────────────────────────────────────────────────┐
|
|
11
|
+
│ 主页面内容 (ListPage / FormPage / DetailPage) │
|
|
12
|
+
│ ... │
|
|
13
|
+
│ ┌───────────────────────────────────────────┐ │
|
|
14
|
+
│ │ Sheet (右侧滑出, 宽度 600-900px) │ │
|
|
15
|
+
│ │ ┌───── SheetHeader ──────────────────┐ │ │
|
|
16
|
+
│ │ │ 选择关联实例 [× 关闭] │ │ │
|
|
17
|
+
│ │ ├─────────────────────────────────────┤ │ │
|
|
18
|
+
│ │ │ ActionToolbar (SearchCombo 等) │ │ │
|
|
19
|
+
│ │ │ ──┬──────────────────────────┬── │ │ │
|
|
20
|
+
│ │ │ DataTable (含选择框) │ │ │
|
|
21
|
+
│ │ │ ☑|ID|名称|状态|...|操作 │ │ │
|
|
22
|
+
│ │ │ ☐|i-xxx|test|●运行中|...|选择 │ │ │
|
|
23
|
+
│ │ │ ────────────────────────────── │ │ │
|
|
24
|
+
│ │ │ Pagination │ │ │
|
|
25
|
+
│ │ ├─────────────────────────────────────┤ │ │
|
|
26
|
+
│ │ │ [取消] [确定] (底部操作栏) │ │ │
|
|
27
|
+
│ │ └─────────────────────────────────────┘ │ │
|
|
28
|
+
│ └───────────────────────────────────────────┘ │
|
|
29
|
+
└──────────────────────────────────────────────────────────────────────┘
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 2. 核心差异
|
|
33
|
+
|
|
34
|
+
| 维度 | 标准列表 | 抽屉中列表 |
|
|
35
|
+
|------|----------|-----------|
|
|
36
|
+
| 容器 | PageContainer | **Sheet** |
|
|
37
|
+
| 触发方式 | 直接访问 URL | **点击按钮/链接打开 Sheet** |
|
|
38
|
+
| 选择返回 | 跳转页面 | **选择后点击确定关闭 Sheet,返回选中数据** |
|
|
39
|
+
| 宽度 | 全宽/自适应 | **固定宽度 (600-900px)** |
|
|
40
|
+
| 关闭方式 | 浏览器返回/面包屑 | **点击 × / 遮罩层 / Esc** |
|
|
41
|
+
| 底部操作栏 | 无 | **必需 [取消] [确定]** |
|
|
42
|
+
|
|
43
|
+
## 3. Sheet 交互规范
|
|
44
|
+
|
|
45
|
+
| 交互 | 行为 |
|
|
46
|
+
|------|------|
|
|
47
|
+
| 打开 Sheet | 点击触发按钮,从右侧滑出,宽度 600-900px |
|
|
48
|
+
| 选择数据 | 勾选选择框,支持单选/多选(由业务决定) |
|
|
49
|
+
| 确认选择 | 点击"确定"关闭 Sheet,返回选中数据到主页面 |
|
|
50
|
+
| 取消选择 | 点击"取消"关闭 Sheet,不返回数据 |
|
|
51
|
+
| 关闭 Sheet | 点击 × / 遮罩层 / Esc,丢弃未确认的选择 |
|
|
52
|
+
| 搜索/筛选 | 在 Sheet 内执行搜索/筛选,不跳转页面 |
|
|
53
|
+
| 分页 | 在 Sheet 内分页,不影响主页面 |
|
|
54
|
+
|
|
55
|
+
## 4. 引用共享规则
|
|
56
|
+
|
|
57
|
+
| 共享规则 | 路径 | 说明 |
|
|
58
|
+
|----------|------|------|
|
|
59
|
+
| 表格列元规则 | `../_shared/column-meta-rules.md` | 列元规则(显隐/拖拽/排序)
|
|
60
|
+
| 产品列定义 | `products/{产品}/columns.json` | 具体列名/宽度/类型 |
|
|
61
|
+
| 操作列规范 | `../_shared/action-column-spec.md` | 操作列结构 |
|
|
62
|
+
|
|
63
|
+
> DataTable、Pagination、ActionToolbar 等组件与标准列表页一致,不再重复。
|
|
64
|
+
> 操作列中"管理/查看"等页面跳转操作在抽屉中通常禁用或隐藏。
|
|
65
|
+
|
|
66
|
+
## 5. 验证清单
|
|
67
|
+
|
|
68
|
+
> 通用检查项见 `../../../docs/validation-workflow.md` 验证清单。此处仅列出本模式差异项。
|
|
69
|
+
|
|
70
|
+
| 验证项 | 检查点 | 目标 |
|
|
71
|
+
|--------|--------|------|
|
|
72
|
+
| Sheet滑出 | 右侧滑出,宽度600-900px | 正确 |
|
|
73
|
+
| 遮罩层 | 半透明遮罩,点击关闭 | 正确 |
|
|
74
|
+
| 选择反馈 | 选中行高亮 | 正确 |
|
|
75
|
+
| 确定/取消 | 确定返回数据,取消丢弃 | 正确 |
|
|
76
|
+
| Esc关闭 | Esc关闭Sheet | 正确 |
|