@agile-team/wl-skills-kit 1.0.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/CHANGELOG.md +13 -0
- package/README.md +328 -0
- package/bin/wl-skills.js +104 -0
- package/files/.github/copilot-instructions.md +211 -0
- package/files/.github/docs/SYS_MENU_INFO.md +247 -0
- package/files/.github/docs/menu-sync-design.md +265 -0
- package/files/.github/docs/use-skill.md +379 -0
- package/files/.github/docs/wl-skills-kit.md +266 -0
- package/files/.github/skills/api-contract/SKILL.md +247 -0
- package/files/.github/skills/convention-extract/SKILL.md +355 -0
- package/files/.github/skills/menu-sync/SKILL.md +255 -0
- package/files/.github/skills/menu-sync/env/guide.md +73 -0
- package/files/.github/skills/page-codegen/SKILL.md +825 -0
- package/files/.github/skills/page-codegen/TPL-CHANGE-HISTORY.md +281 -0
- package/files/.github/skills/page-codegen/TPL-DETAIL-TABS.md +1112 -0
- package/files/.github/skills/page-codegen/TPL-DRIVEN.md +124 -0
- package/files/.github/skills/page-codegen/TPL-FORM-ROUTE.md +441 -0
- package/files/.github/skills/page-codegen/TPL-LIST.md +196 -0
- package/files/.github/skills/page-codegen/TPL-MASTER-DETAIL.md +153 -0
- package/files/.github/skills/page-codegen/TPL-OPERATION-STATION.md +442 -0
- package/files/.github/skills/page-codegen/TPL-RECORD-FORM.md +376 -0
- package/files/.github/skills/page-codegen/TPL-TREE-LIST.md +191 -0
- package/files/.github/skills/prototype-scan/SKILL.md +414 -0
- package/files/demo/README.md +44 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/api.md +54 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/data.ts +346 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/index.vue +28 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/data.ts +115 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/index.scss +44 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/index.vue +43 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change/data.ts +338 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change/index.vue +28 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/data.ts +115 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/index.scss +44 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/index.vue +43 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/data.ts +196 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.scss +150 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.vue +79 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/api.md +88 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/data.ts +601 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/index.vue +64 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/api.md +67 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/data.ts +286 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/index.scss +139 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/index.vue +318 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/api.md +98 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/data.ts +543 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/index.vue +52 -0
- package/files/demo/sale/demo/add-demo/data.ts +518 -0
- package/files/demo/sale/demo/add-demo/index.scss +207 -0
- package/files/demo/sale/demo/add-demo/index.vue +167 -0
- package/files/demo/sale/demo/billet-flame-cut-plan/data.ts +524 -0
- package/files/demo/sale/demo/billet-flame-cut-plan/index.scss +155 -0
- package/files/demo/sale/demo/billet-flame-cut-plan/index.vue +117 -0
- package/files/demo/sale/demo/domestic-trade-order/data.ts +308 -0
- package/files/demo/sale/demo/domestic-trade-order/index.scss +99 -0
- package/files/demo/sale/demo/domestic-trade-order/index.vue +77 -0
- package/files/demo/sale/demo/heat-batch-return/data.ts +367 -0
- package/files/demo/sale/demo/heat-batch-return/index.scss +100 -0
- package/files/demo/sale/demo/heat-batch-return/index.vue +170 -0
- package/files/demo/sale/demo/heat-batch-return/meltDialog.vue +320 -0
- package/files/demo/sale/demo/metallurgical-spec/data.ts +825 -0
- package/files/demo/sale/demo/metallurgical-spec/index.scss +264 -0
- package/files/demo/sale/demo/metallurgical-spec/index.vue +309 -0
- package/files/docs/jh-date-range.md +257 -0
- package/files/docs/jh-date.md +222 -0
- package/files/docs/jh-dept-picker.md +190 -0
- package/files/docs/jh-drag-row.md +590 -0
- package/files/docs/jh-file-upload.md +216 -0
- package/files/docs/jh-pagination.md +505 -0
- package/files/docs/jh-picker.md +218 -0
- package/files/docs/jh-select.md +148 -0
- package/files/docs/jh-text.md +248 -0
- package/files/docs/jh-user-picker.md +197 -0
- package/files/docs/page-query-hook-best-practices.md +362 -0
- package/files/docs/request.md +925 -0
- package/files/src/components/global/C_ParentView/index.vue +3 -0
- package/files/src/components/global/C_RightToolbar/index.vue +459 -0
- package/files/src/components/global/C_Splitter/index.vue +195 -0
- package/files/src/components/global/C_SvgIcon/index.vue +61 -0
- package/files/src/components/global/C_SvgIcon/svgicon.js +10 -0
- package/files/src/components/global/C_TagStatus/README.md +264 -0
- package/files/src/components/global/C_TagStatus/config.ts +192 -0
- package/files/src/components/global/C_TagStatus/index.vue +127 -0
- package/files/src/components/global/C_TagStatus/types.ts +64 -0
- package/files/src/components/global/C_Tree/README.md +153 -0
- package/files/src/components/global/C_Tree/index.scss +42 -0
- package/files/src/components/global/C_Tree/index.vue +119 -0
- package/files/src/components/global/C_Tree/types.ts +59 -0
- package/files/src/components/local/c_formModal/README.md +235 -0
- package/files/src/components/local/c_formModal/data.ts +95 -0
- package/files/src/components/local/c_formModal/index.scss +8 -0
- package/files/src/components/local/c_formModal/index.vue +107 -0
- package/files/src/components/local/c_formSections/README.md +496 -0
- package/files/src/components/local/c_formSections/data.ts +175 -0
- package/files/src/components/local/c_formSections/index.scss +280 -0
- package/files/src/components/local/c_formSections/index.vue +429 -0
- package/files/src/components/local/c_listModal/data.ts +41 -0
- package/files/src/components/local/c_listModal/index.vue +136 -0
- package/files/src/components/local/c_spliterTitle/index.scss +25 -0
- package/files/src/components/local/c_spliterTitle/index.vue +21 -0
- package/files/src/components/remote/AGGrid/README.md +530 -0
- package/files/src/components/remote/BaseForm/README.md +508 -0
- package/files/src/components/remote/BaseQuery/README.md +865 -0
- package/files/src/components/remote/BaseTable/README.md +941 -0
- package/files/src/components/remote/BaseToolbar/README.md +496 -0
- package/files/src/types/page.ts +24 -0
- package/package.json +31 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prototype-scan
|
|
3
|
+
description: "Use when: analyzing Axure exported HTML prototype files to extract page inventory, classify interaction patterns, identify reusable components, and produce a structured page checklist for Vue development. Also supports detailed design documents (MD/Word) as input. Triggers on: prototype analysis, axure scan, page inventory, 原型解析, 页面清单, axure转vue, 详设文档, design doc, 详细设计."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: 原型解析(prototype-scan)
|
|
7
|
+
|
|
8
|
+
将 **Axure 导出的 HTML 原型包** 或 **详细设计文档(MD/Word/表格)** 解析为结构化的 **page-spec JSON 页面清单**,作为后续接口约定和代码生成的输入。
|
|
9
|
+
|
|
10
|
+
> **两种输入,同一输出**:输出格式完全相同(page-spec JSON),消费方(page-codegen)无需感知来源。
|
|
11
|
+
|
|
12
|
+
## 触发
|
|
13
|
+
|
|
14
|
+
- **模式 A(Axure)**:提供 Axure HTML 文件包目录,AI 全量扫描 HTML
|
|
15
|
+
- **模式 B(详设文档)**:提供 MD/Word/表格格式的详细设计文档,AI 解析结构化字段
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 输入模式 A:Axure HTML 扫描
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 步骤
|
|
24
|
+
|
|
25
|
+
## 步骤
|
|
26
|
+
|
|
27
|
+
### 1. 全量扫描 HTML
|
|
28
|
+
|
|
29
|
+
遍历所有 `.html` 文件,提取:
|
|
30
|
+
|
|
31
|
+
| 区域 | 提取内容 |
|
|
32
|
+
| ---- | ------------------------------------------------------ |
|
|
33
|
+
| 标题 | `<title>` / 标题文本 → 页面名称 |
|
|
34
|
+
| 表格 | `<table>` / 网格布局 → 表格列定义 |
|
|
35
|
+
| 表单 | `<input>` / `<select>` / 标签文本 → 查询条件和表单字段 |
|
|
36
|
+
| 按钮 | `<button>` / 链接文本 → 操作按钮列表 |
|
|
37
|
+
| 弹窗 | 遮罩层 / 弹出层 → 弹窗组件 |
|
|
38
|
+
| 树形 | 侧边栏 / 树形导航 → 树形结构 |
|
|
39
|
+
| 注释 | Axure 注解 → 业务说明 |
|
|
40
|
+
|
|
41
|
+
### 2. 交互模式分类
|
|
42
|
+
|
|
43
|
+
| 模式 | 特征 | 前端组件 |
|
|
44
|
+
| --------------- | --------------------- | ------------------------------------------------ |
|
|
45
|
+
| `LIST` | 查询区 + 表格 + 分页 | BaseQuery + BaseTable + jh-pagination |
|
|
46
|
+
| `MASTER_DETAIL` | 上方主表 + 下方明细表 | jh-drag-row(需 `.drager_row { height: 100% }`) |
|
|
47
|
+
| `TREE_LIST` | 左侧树 + 右侧表格 | C_Splitter + C_Tree |
|
|
48
|
+
| `FORM_MODAL` | 弹窗中的表单 | el-dialog + el-form |
|
|
49
|
+
| `COMPOSITE` | 多种组合 | 组合使用 |
|
|
50
|
+
|
|
51
|
+
### 3. 字段提取
|
|
52
|
+
|
|
53
|
+
对每个页面提取 3 类字段(字段名用 camelCase,与 data.ts 直接对应):
|
|
54
|
+
|
|
55
|
+
**查询字段:**
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
中文名 | 建议英文名(camelCase) | 组件类型 | dictCode(如有)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
组件类型对照(查询项 `queryDef()` 中使用):
|
|
62
|
+
|
|
63
|
+
| 原型表现 | 组件配置 |
|
|
64
|
+
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
65
|
+
| 普通输入框 | 默认 input(无需 component 属性) |
|
|
66
|
+
| 下拉选择 | `logicType: BusLogicDataType.dict, logicValue: "dictCode"` |
|
|
67
|
+
| 单日期 | `component: () => ({ tag: "jh-date", type: "date" })` |
|
|
68
|
+
| 月份选择 | `component: () => ({ tag: "jh-date", type: "month", showFormat: "YYYY-MM", format: "YYYYMM" })` |
|
|
69
|
+
| 日期范围 | `component: () => ({ tag: "jh-date", type: "daterange", rangeSeparator: "至", showFormat: "YYYY-MM-DD", valueFormat: "YYYY-MM-DD" })`,需额外配 `startName`/`endName` |
|
|
70
|
+
| 用户选择 | `component: () => ({ tag: "jh-user-picker" })` |
|
|
71
|
+
| 部门选择 | `component: () => ({ tag: "jh-dept-picker" })` |
|
|
72
|
+
|
|
73
|
+
**表格列:**
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
列名(中文) | 字段名(camelCase) | 宽度建议 | 是否字典列(logicType/logicValue)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
字典列配置参考:`{ label: "状态", name: "status", minWidth: 120, logicType: BusLogicDataType.dict, logicValue: "dictCode", sortable: true, filterable: true }`
|
|
80
|
+
|
|
81
|
+
**表单字段(弹窗):**
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
中文名 | 英文名(camelCase) | 类型 | 是否必填 | 组件类型 | dictCode
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 4. 组件匹配
|
|
88
|
+
|
|
89
|
+
对照平台已有组件(详细 API 见 `docs/jh-*.md`):
|
|
90
|
+
|
|
91
|
+
| 功能区 | 组件 | 说明 |
|
|
92
|
+
| -------- | ----------------------- | ------------------------------------ |
|
|
93
|
+
| 查询区 | BaseQuery | 通过 `queryDef()` 声明式配置 |
|
|
94
|
+
| 工具栏 | BaseToolbar | 通过 `toolbarDef()` 声明式配置 |
|
|
95
|
+
| 表格 | BaseTable | 通过 `columnsDef()` 声明式配置 |
|
|
96
|
+
| 分页 | jh-pagination | 固定用法,见 copilot-instructions.md |
|
|
97
|
+
| 上下分栏 | jh-drag-row | 主从表必备,需设 `:top-height` |
|
|
98
|
+
| 左右分割 | C_Splitter | 树形+列表必备,设 `:left-width` |
|
|
99
|
+
| 树形面板 | C_Tree | 含搜索+Tab 切换 |
|
|
100
|
+
| 下拉选择 | jh-select | dict 属性自动加载字典数据 |
|
|
101
|
+
| 日期选择 | jh-date / jh-date-range | 参见 `docs/jh-date.md` |
|
|
102
|
+
| 用户选择 | jh-user-picker | 参见 `docs/jh-user-picker.md` |
|
|
103
|
+
| 部门选择 | jh-dept-picker | 参见 `docs/jh-dept-picker.md` |
|
|
104
|
+
| 文件上传 | jh-file-upload | 参见 `docs/jh-file-upload.md` |
|
|
105
|
+
|
|
106
|
+
**新建组件判断:**
|
|
107
|
+
|
|
108
|
+
- 3+ 页面相同逻辑 → `src/components/global/C_PascalCase/`
|
|
109
|
+
- 同模块 2 页面共用 → `src/components/local/c_camelCase/`
|
|
110
|
+
- 业务强耦合 → 页面 `components/` 目录下
|
|
111
|
+
|
|
112
|
+
### 5. pages.ts 注册名推断
|
|
113
|
+
|
|
114
|
+
根据 `vite/plugins/shared/pages.ts` 的 `gProd` / `gSale` 函数格式:
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
// ["kebab-case-目录名", "中文label"]
|
|
118
|
+
// 路径: views/[域]/[模块]/[子模块]/[目录]/index.vue
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 输出格式:page-spec JSON
|
|
124
|
+
|
|
125
|
+
> **核心原则:结构化 JSON 确保字段不遗漏(可机器 diff),notes 保留复杂语境。**
|
|
126
|
+
> 每个页面输出一个 page-spec JSON 对象,所有页面汇总为数组。
|
|
127
|
+
> **禁止在 JSON 中用"等"、"..."省略任何字段**,必须逐个列出。
|
|
128
|
+
|
|
129
|
+
### page-spec 结构定义
|
|
130
|
+
|
|
131
|
+
```jsonc
|
|
132
|
+
{
|
|
133
|
+
// ===== 页面基本信息 =====
|
|
134
|
+
"pageName": "客户档案", // 中文名
|
|
135
|
+
"kebabName": "customer-archive", // kebab-case 目录名
|
|
136
|
+
"pattern": "LIST", // LIST | MASTER_DETAIL | TREE_LIST | FORM_TAB | COMPOSITE
|
|
137
|
+
"path": "views/sale/demo/khda/customer-archive/",
|
|
138
|
+
"pagesTs": ["customer-archive", "客户档案"], // pages.ts 注册项
|
|
139
|
+
"platformComponents": ["BaseQuery", "BaseTable", "jh-pagination"],
|
|
140
|
+
"newComponents": [], // 需要新建的组件名(空数组=不需要新建)
|
|
141
|
+
|
|
142
|
+
// ===== 查询区字段(逐个列出,禁止省略) =====
|
|
143
|
+
"query": [
|
|
144
|
+
{ "field": "customerName", "label": "客户名称", "type": "input" },
|
|
145
|
+
{ "field": "customerType", "label": "客户类型", "type": "dict", "dictCode": "customer_type" },
|
|
146
|
+
{
|
|
147
|
+
"field": "createDate", "label": "建立日期", "type": "dateRange",
|
|
148
|
+
"startName": "createDateStart", "endName": "createDateEnd"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
|
|
152
|
+
// ===== 工具栏按钮(逐个列出,与原型顺序严格一致) =====
|
|
153
|
+
"toolbar": [
|
|
154
|
+
{ "label": "新增", "type": "primary", "action": "openModal" },
|
|
155
|
+
{ "label": "删除", "type": "danger", "action": "batchDelete" },
|
|
156
|
+
{ "label": "导出", "type": "plain", "action": "export" }
|
|
157
|
+
],
|
|
158
|
+
// toolbar.type 映射:蓝底填充="primary",线框/白底="plain",红色="danger",灰色="default"
|
|
159
|
+
|
|
160
|
+
// ===== 表格列(逐列列出,禁止省略) =====
|
|
161
|
+
"columns": [
|
|
162
|
+
{ "field": "customerName", "label": "客户名称", "width": 180 },
|
|
163
|
+
{ "field": "customerType", "label": "客户类型", "width": 120, "dict": "customer_type" }
|
|
164
|
+
],
|
|
165
|
+
|
|
166
|
+
// ===== 操作列按钮 =====
|
|
167
|
+
"operations": [
|
|
168
|
+
{ "label": "编辑", "action": "edit" },
|
|
169
|
+
{ "label": "删除", "action": "delete" }
|
|
170
|
+
],
|
|
171
|
+
|
|
172
|
+
// ===== 内嵌子表(关键!必须标注交互属性) =====
|
|
173
|
+
"subTables": [
|
|
174
|
+
{
|
|
175
|
+
"name": "businessInfo",
|
|
176
|
+
"label": "业务信息",
|
|
177
|
+
"editable": true, // 是否可增删行
|
|
178
|
+
"inlineEdit": false, // 是否行内编辑(双击单元格编辑)
|
|
179
|
+
"columns": [
|
|
180
|
+
{ "field": "salesType", "label": "销售别", "width": 80 }
|
|
181
|
+
],
|
|
182
|
+
"operations": [ // 子表的操作按钮
|
|
183
|
+
{ "label": "删除", "action": "removeRow" }
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
|
|
188
|
+
// ===== 表单字段(FORM_TAB / 弹窗 页面使用) =====
|
|
189
|
+
"formSections": [
|
|
190
|
+
{
|
|
191
|
+
"name": "basicInfo",
|
|
192
|
+
"label": "基本信息",
|
|
193
|
+
"fields": [
|
|
194
|
+
{ "field": "customerName", "label": "客户名称", "type": "input", "required": true },
|
|
195
|
+
{ "field": "customerType", "label": "客户类型", "type": "dict", "dictCode": "customer_type", "required": true }
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
|
|
200
|
+
// ===== 页面级特殊交互开关 =====
|
|
201
|
+
"features": {
|
|
202
|
+
"tabSwitch": false, // 是否有 Tab 切换(如临时/正式客户)
|
|
203
|
+
"tabItems": [], // Tab 项:[{ "label": "临时客户", "value": "temp" }]
|
|
204
|
+
"viewSwitch": false, // 是否有视图/视角切换(如管理视角/使用视角 Radio)
|
|
205
|
+
"viewItems": [], // 视图项:[{ "label": "管理视角", "value": "management" }]
|
|
206
|
+
"hiddenMenu": false // 是否隐藏菜单(从列表跳转进入的子页面)
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
// ===== 非结构化补充说明 =====
|
|
210
|
+
"notes": [
|
|
211
|
+
"客户分类/客户级别的下拉选项按产品线动态变化",
|
|
212
|
+
"状态信息区(创建时间、核实状态等)为只读展示"
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### 子表交互判断规则
|
|
218
|
+
|
|
219
|
+
| 原型特征 | editable | inlineEdit |
|
|
220
|
+
|---------|----------|------------|
|
|
221
|
+
| 表格上方有"新增"按钮,行内有"删除"链接 | `true` | `false` |
|
|
222
|
+
| 表格单元格可直接编辑(输入框/下拉) | `true` | `true` |
|
|
223
|
+
| 纯展示表格,无任何编辑入口 | `false` | `false` |
|
|
224
|
+
| 表格仅有外部"导入"按钮填充数据 | `false` | `false` |
|
|
225
|
+
|
|
226
|
+
### 完整输出模板
|
|
227
|
+
|
|
228
|
+
````markdown
|
|
229
|
+
# 页面清单 - [模块名称]
|
|
230
|
+
|
|
231
|
+
> 原型来源:[文件名/版本]
|
|
232
|
+
> 业务说明:[一句话描述]
|
|
233
|
+
|
|
234
|
+
## 页面总表
|
|
235
|
+
|
|
236
|
+
| # | 页面名称 | 交互模式 | kebab 目录名 | 是否隐藏菜单 |
|
|
237
|
+
|---|---------|---------|-------------|-------------|
|
|
238
|
+
|
|
239
|
+
## page-spec
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
[
|
|
243
|
+
{ /* 页面1 完整 page-spec */ },
|
|
244
|
+
{ /* 页面2 完整 page-spec */ }
|
|
245
|
+
]
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## 共享组件识别
|
|
249
|
+
|
|
250
|
+
| 组件 | 位置 | 复用页面 | 说明 |
|
|
251
|
+
|-----|------|---------|------|
|
|
252
|
+
|
|
253
|
+
## 数据字典汇总
|
|
254
|
+
|
|
255
|
+
| dictCode | 中文名 | 可选值 | 出现页面 |
|
|
256
|
+
|----------|-------|--------|---------|
|
|
257
|
+
|
|
258
|
+
## pages.ts 注册片段
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
const [模块名]Module = gProd("[base-path]", {
|
|
262
|
+
[子模块]: [
|
|
263
|
+
["[kebab-目录名]", "[中文名]"],
|
|
264
|
+
],
|
|
265
|
+
});
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
> ⚠️ 注册后还需在系统管理平台配置菜单路由
|
|
269
|
+
````
|
|
270
|
+
|
|
271
|
+
### 自检清单(输出前必须逐项确认)
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
□ 每个页面的 query 数组 — 数量与原型查询区字段一一对应?
|
|
275
|
+
□ 每个页面的 query 数组 — 顺序与原型一致(从左到右、从上到下)?
|
|
276
|
+
□ 每个页面的 columns 数组 — 数量与原型表头一一对应?
|
|
277
|
+
□ 每个页面的 columns 数组 — 顺序与原型表头从左到右完全一致?
|
|
278
|
+
□ 每个页面的 toolbar 数组 — 数量与原型按钮一一对应?
|
|
279
|
+
□ 每个页面的 toolbar 数组 — 顺序与原型按钮从左到右完全一致?
|
|
280
|
+
□ 每个页面的 toolbar 数组 — 按钮 type 与原型颜色对应(蓝底=primary, 线框=plain, 红色=danger)?
|
|
281
|
+
□ 每个页面的 operations 数组 — 数量与原型操作列按钮一一对应?
|
|
282
|
+
□ 每个页面的 operations 数组 — 顺序与原型一致?
|
|
283
|
+
□ 所有 subTables 都标注了 editable + inlineEdit?
|
|
284
|
+
□ 所有 dict 字段都提取了 dictCode?
|
|
285
|
+
□ features.tabSwitch / tabItems — 原型中的小 Tab 标签是否全部提取?
|
|
286
|
+
□ features.viewSwitch / viewItems — 原型中的视角切换(Radio/RadioButton)是否提取?
|
|
287
|
+
□ viewSwitch 为 true 时,是否为每个视角分别提取了 columns 数组?
|
|
288
|
+
□ features.hiddenMenu 已正确标注?
|
|
289
|
+
□ notes 中补充了无法结构化的特殊逻辑?
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### 精度细节要求(必读)
|
|
293
|
+
|
|
294
|
+
> **顺序即规范**:原型设计师精心安排了查询区、按钮栏、表格列的顺序,AI 输出必须严格保持一致。
|
|
295
|
+
|
|
296
|
+
1. **查询区字段**:按原型从左到右、从上到下逐个提取,不可调换顺序,不可遗漏
|
|
297
|
+
2. **工具栏按钮**:按原型从左到右逐个提取,标注颜色类型(蓝底填充 = `primary`,线框 = `plain`,红色 = `danger`,灰色/默认 = `default`)
|
|
298
|
+
3. **Tab 标签**:原型中所有 Tab(如"临时客户"/"正式客户"/"公海池")必须提取到 `features.tabItems`,标注 label 和 value
|
|
299
|
+
4. **视图/视角切换**:原型中 Radio/RadioButton 组(如"管理视角"/"使用视角")必须提取到 `features.viewItems`。当 viewSwitch 为 true 时,须为**每个视角分别提取 columns 数组**(因不同视角列定义不同),page-spec 中使用 `viewColumns: { "management": [...], "usage": [...] }` 结构
|
|
300
|
+
5. **表格列**:按原型表头从左到右逐列提取(不含复选框列和序号列,这两列在代码模板中自动添加),不可遗漏任何一列
|
|
301
|
+
5. **操作列按钮**:表格最后一列的操作按钮(查看/编辑/删除/启用等),逐个提取到 `operations`,保持原型中的文字和顺序
|
|
302
|
+
6. **按钮文字**:必须使用原型中的**原始文字**(如原型写"新增申请"不可简化为"新增")
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## 输入模式 B:详细设计文档
|
|
307
|
+
|
|
308
|
+
> 详设文档输入比 Axure HTML **精度更高(95-100%)**,因为字段名和类型是明确写出的,不需要从视觉推断。
|
|
309
|
+
> 输出格式与模式 A 完全一致(page-spec JSON),page-codegen 无感知。
|
|
310
|
+
|
|
311
|
+
### 为什么详设比 Axure 更精确
|
|
312
|
+
|
|
313
|
+
| 信息类型 | Axure 提供 | 详设文档提供 |
|
|
314
|
+
|---------|-----------|------------|
|
|
315
|
+
| 字段中文名 | ✅(原型标签) | ✅(明确写出) |
|
|
316
|
+
| 字段英文名 | ❌(需推断) | ✅(直接写出) |
|
|
317
|
+
| 字段类型 | ⚠️(视觉判断) | ✅(明确标注) |
|
|
318
|
+
| 字典 code | ❌(需猜测) | ✅(可直接对应) |
|
|
319
|
+
| 必填规则 | ⚠️(看 * 号) | ✅(明确写出) |
|
|
320
|
+
| 子表可编辑 | ⚠️(看有无按钮) | ✅(明确标注) |
|
|
321
|
+
| 接口字段名 | ❌(无) | ✅(可直接写入) |
|
|
322
|
+
|
|
323
|
+
### 推荐的详设文档格式(最大化精度)
|
|
324
|
+
|
|
325
|
+
提供文档时,**建议按以下格式**(AI 可直接映射到 page-spec JSON,无需猜测):
|
|
326
|
+
|
|
327
|
+
````markdown
|
|
328
|
+
## [页面名称]
|
|
329
|
+
|
|
330
|
+
**基本信息**
|
|
331
|
+
- 交互模式:LIST / MASTER_DETAIL / TREE_LIST / FORM_TAB
|
|
332
|
+
- 目录名:kebab-case(如 customer-archive)
|
|
333
|
+
- 服务缩写:sale(如 pm / mmwr / sale / hrms / base)
|
|
334
|
+
- 是否隐藏菜单:否
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
### 查询条件
|
|
339
|
+
|
|
340
|
+
| 字段名(camelCase) | 中文名 | 类型 | 字典code | 起止字段名 |
|
|
341
|
+
|------------------|--------|------|---------|-----------|
|
|
342
|
+
| customerName | 客户名称 | input | - | - |
|
|
343
|
+
| enableStatus | 启用状态 | dict | enable_status | - |
|
|
344
|
+
| createDate | 建立日期 | dateRange | - | createDateStart / createDateEnd |
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
### 工具栏按钮
|
|
349
|
+
|
|
350
|
+
| 按钮名 | 类型 | 行为 |
|
|
351
|
+
|--------|------|------|
|
|
352
|
+
| 新增 | primary | openModal |
|
|
353
|
+
| 导出 | plain | export |
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
### 表格列(按顺序)
|
|
358
|
+
|
|
359
|
+
| 字段名(camelCase) | 中文名 | 宽度 | 字典code | 说明 |
|
|
360
|
+
|------------------|--------|------|---------|------|
|
|
361
|
+
| customerName | 客户名称 | 180 | - | |
|
|
362
|
+
| customerType | 客户类型 | 120 | customer_type | |
|
|
363
|
+
| enableStatus | 启用状态 | 100 | enable_status | |
|
|
364
|
+
|
|
365
|
+
### 操作列
|
|
366
|
+
|
|
367
|
+
| 按钮 | 行为 |
|
|
368
|
+
|------|------|
|
|
369
|
+
| 编辑 | edit |
|
|
370
|
+
| 删除 | delete |
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
### 子表(如有)
|
|
375
|
+
|
|
376
|
+
**子表名称**: 业务信息(businessInfo)
|
|
377
|
+
- 可增删行: 是
|
|
378
|
+
- 行内编辑: 否
|
|
379
|
+
|
|
380
|
+
| 字段名 | 中文名 | 类型 |
|
|
381
|
+
|--------|--------|------|
|
|
382
|
+
| salesType | 销售别 | input |
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
### 特殊说明(notes)
|
|
387
|
+
|
|
388
|
+
- 客户分类下拉选项按产品线动态变化
|
|
389
|
+
- 状态信息区为只读展示
|
|
390
|
+
````
|
|
391
|
+
|
|
392
|
+
> **不强制要求此格式** —— AI 可以解析任何常见格式(普通表格、Word、自由段落)。
|
|
393
|
+
> 但**字段英文名和字典 code 如果没有明确提供**,AI 会基于中文名推断,精度略降。
|
|
394
|
+
|
|
395
|
+
### 模式 B 的执行步骤
|
|
396
|
+
|
|
397
|
+
遵循与模式 A 相同的步骤 2-5(分类 → 提取 → 组件匹配 → 输出 page-spec JSON),差异仅在步骤 1:
|
|
398
|
+
|
|
399
|
+
**步骤 1B:解析文档结构**
|
|
400
|
+
|
|
401
|
+
1. 识别文档中的页面边界(标题层级、分隔线)
|
|
402
|
+
2. 逐页提取:查询条件表 → query[]、表格列表 → columns[]、按钮列表 → toolbar[]、操作列 → operations[]、子表 → subTables[]
|
|
403
|
+
3. **如文档中已有字段英文名** → 直接使用;**如没有** → 基于中文名推断 camelCase,并在 notes 中注明"英文名为推断值,请确认"
|
|
404
|
+
4. **如文档中已有字典 code** → 直接使用;**如没有** → 基于中文名推断,在 notes 注明"dictCode 为推断值,请后端确认"
|
|
405
|
+
5. 继续执行步骤 2-5,输出完整 page-spec JSON
|
|
406
|
+
|
|
407
|
+
### 精度对比
|
|
408
|
+
|
|
409
|
+
| 输入来源 | 字段不遗漏 | 英文名准确 | 字典code准确 | 综合精度 |
|
|
410
|
+
|---------|-----------|-----------|------------|---------|
|
|
411
|
+
| Axure HTML(推荐格式) | ✅ | ⚠️ 推断 | ⚠️ 推断 | 90-95% |
|
|
412
|
+
| 详设文档(推荐格式) | ✅ | ✅ 直接读 | ✅ 直接读 | **95-100%** |
|
|
413
|
+
| 详设文档(自由格式) | ✅ | ⚠️ 推断 | ⚠️ 推断 | 85-95% |
|
|
414
|
+
| 截图/非结构化 | ⚠️ 可能漏 | ❌ 推断 | ❌ 推断 | 70-80% |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# demo — 领域样例索引
|
|
2
|
+
|
|
3
|
+
> AI 学习参考 + 开发者速查。每个样例均可独立运行(Mock 数据,不依赖后端)。
|
|
4
|
+
> 安装 wl-skills-kit 后自动导入此目录,**不要在此目录下放业务代码**。
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## produce/aiflow/ — 生产域(客户档案模块,8 个页面)
|
|
9
|
+
|
|
10
|
+
| 目录 | 模板类型 | 说明 |
|
|
11
|
+
| ------------------------------------- | -------------- | ----------------------------------- |
|
|
12
|
+
| `mmwr-customer-archive/` | LIST + Tabs | 客户档案列表(带 c_formModal 弹窗) |
|
|
13
|
+
| `mmwr-temp-customer-archive/` | LIST | 临时客户档案列表 |
|
|
14
|
+
| `mmwr-customer-apply-add/` | LIST | 客户新增申请列表 |
|
|
15
|
+
| `mmwr-customer-apply-add-form/` | FORM_ROUTE | 客户新增申请表单(独立路由) |
|
|
16
|
+
| `mmwr-customer-apply-change/` | LIST | 客户变更申请列表 |
|
|
17
|
+
| `mmwr-customer-apply-change-form/` | FORM_ROUTE | 客户变更申请表单(独立路由) |
|
|
18
|
+
| `mmwr-customer-apply-change-history/` | CHANGE_HISTORY | 客户变更历史比对 |
|
|
19
|
+
| `mmwr-customer-detail/` | DETAIL_TABS | 客户详情(多 Tab) |
|
|
20
|
+
|
|
21
|
+
## sale/demo/ — 销售域(平台默认样例,5 个页面)
|
|
22
|
+
|
|
23
|
+
| 目录 | 模板类型 | 说明 |
|
|
24
|
+
| ------------------------ | ------------- | -------------------------------- |
|
|
25
|
+
| `domestic-trade-order/` | LIST | 标准内贸订单列表 |
|
|
26
|
+
| `metallurgical-spec/` | MASTER_DETAIL | 冶金规范(jh-drag-row 上下分栏) |
|
|
27
|
+
| `add-demo/` | FORM_ROUTE | 新增表单演示(c_formSections) |
|
|
28
|
+
| `billet-flame-cut-plan/` | LIST | 坯料火焰切割计划列表 |
|
|
29
|
+
| `heat-batch-return/` | LIST + Modal | 炉批退判(含自定义弹窗) |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 样例标准
|
|
34
|
+
|
|
35
|
+
每个目录必须包含:
|
|
36
|
+
|
|
37
|
+
- `index.vue` — 视图层(纯模板 + createPage 解构)
|
|
38
|
+
- `data.ts` — 逻辑层(AbstractPageQueryHook 或 composable)
|
|
39
|
+
- `index.scss` — 样式层
|
|
40
|
+
- `api.md` — 接口约定(可选)
|
|
41
|
+
|
|
42
|
+
## 贡献
|
|
43
|
+
|
|
44
|
+
新增样例请放在 `demo/{domain}/{submodule}/{page-name}/`,提 PR 到 wl-skills-kit 仓库。
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# 新增申请列表 — 接口约定
|
|
2
|
+
|
|
3
|
+
## 服务缩写:`sale` 资源名:`customerApply`
|
|
4
|
+
|
|
5
|
+
### 1. 分页查询
|
|
6
|
+
|
|
7
|
+
- **方法**:POST
|
|
8
|
+
- **URL**:`/sale/customerApply/addList`
|
|
9
|
+
- **请求体**:`{ customerCode, approvalProduct, applyOrg, customerName, applyType, applyDept, applicant, approvalStatus, applyDateStart, applyDateEnd, verifyStatus, current, size }`
|
|
10
|
+
- **响应**:`{ code:200, result:{ records:[], total, current, size } }`
|
|
11
|
+
|
|
12
|
+
### 2. 删除
|
|
13
|
+
|
|
14
|
+
- **方法**:POST
|
|
15
|
+
- **URL**:`/sale/customerApply/remove`
|
|
16
|
+
- **请求体**:`{ ids:[] }`
|
|
17
|
+
|
|
18
|
+
### 3. 提交审批
|
|
19
|
+
|
|
20
|
+
- **方法**:POST
|
|
21
|
+
- **URL**:`/sale/customerApply/submit`
|
|
22
|
+
- **请求体**:`{ ids:[] }`
|
|
23
|
+
|
|
24
|
+
### 4. 撤回
|
|
25
|
+
|
|
26
|
+
- **方法**:POST
|
|
27
|
+
- **URL**:`/sale/customerApply/withdraw`
|
|
28
|
+
- **请求体**:`{ ids:[] }`
|
|
29
|
+
|
|
30
|
+
### 5. 导出
|
|
31
|
+
|
|
32
|
+
- **方法**:GET
|
|
33
|
+
- **URL**:`/sale/customerApply/export`
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 列表字段
|
|
38
|
+
|
|
39
|
+
| 字段 | 类型 | 说明 |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| id | string | 主键 |
|
|
42
|
+
| applyCode | string | 申请编码(蓝色链接列) |
|
|
43
|
+
| applyType | string | 申请类型 |
|
|
44
|
+
| customerCode | string | 客户编码 |
|
|
45
|
+
| customerName | string | 客户名称 |
|
|
46
|
+
| approvalProduct | string | 审批产品别 |
|
|
47
|
+
| applyReason | string | 申请原因 |
|
|
48
|
+
| applicant | string | 申请人 |
|
|
49
|
+
| applyDept | string | 申请部门 |
|
|
50
|
+
| applyOrg | string | 申请组织 |
|
|
51
|
+
| creator | string | 创建人 |
|
|
52
|
+
| createTime | string | 创建时间 |
|
|
53
|
+
| approvalStatus | string | 审批状态(色块)|
|
|
54
|
+
| verifyStatus | string | 核实状态(色块)|
|