@agile-team/wl-skills-kit 2.11.1 → 2.11.3

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.
Files changed (91) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +38 -21
  3. package/bin/wl-skills.js +27 -3
  4. package/files/.wl-skills/docs/jh-pagination.md +505 -505
  5. package/files/.wl-skills/docs/request.md +940 -940
  6. package/files/.wl-skills/docs/validate-exempt.md +113 -0
  7. package/files/.wl-skills/guides/architecture.md +1 -1
  8. package/files/.wl-skills/skills/_compat/headers/cursor-mdc.txt +1 -1
  9. package/files/.wl-skills/skills/_compat/headers/kiro.txt +1 -1
  10. package/files/.wl-skills/skills/_compat/headers/trae.txt +1 -1
  11. package/files/.wl-skills/skills/core/convention-audit/SKILL.md +3 -3
  12. package/files/.wl-skills/skills/core/spec-doc-parse/SKILL.md +332 -332
  13. package/files/.wl-skills/skills/core/spec-doc-parse/USAGE.md +97 -97
  14. package/files/.wl-skills/skills/sync/permission-sync/USAGE.md +107 -107
  15. package/files/.wl-skills/src/components/global/C_ParentView/index.vue +3 -3
  16. package/files/.wl-skills/src/components/global/C_RightToolbar/index.vue +157 -157
  17. package/files/.wl-skills/src/components/global/C_SvgIcon/index.vue +31 -31
  18. package/files/.wl-skills/src/components/global/C_SvgIcon/svgicon.js +10 -10
  19. package/files/.wl-skills/src/components/global/C_TagStatus/README.md +264 -264
  20. package/files/.wl-skills/src/components/global/C_TagStatus/config.ts +192 -192
  21. package/files/.wl-skills/src/components/global/C_TagStatus/index.vue +106 -106
  22. package/files/.wl-skills/src/components/global/C_TagStatus/types.ts +64 -64
  23. package/files/.wl-skills/src/components/global/C_Tree/README.md +153 -153
  24. package/files/.wl-skills/src/components/global/C_Tree/index.scss +42 -42
  25. package/files/.wl-skills/src/components/global/C_Tree/index.vue +78 -78
  26. package/files/.wl-skills/src/components/global/C_Tree/types.ts +59 -59
  27. package/files/.wl-skills/src/components/local/c_formModal/README.md +235 -235
  28. package/files/.wl-skills/src/components/local/c_formModal/data.ts +95 -95
  29. package/files/.wl-skills/src/components/local/c_formModal/index.scss +8 -8
  30. package/files/.wl-skills/src/components/local/c_formModal/index.vue +107 -107
  31. package/files/.wl-skills/src/components/local/c_formSections/data.ts +175 -175
  32. package/files/.wl-skills/src/components/local/c_formSections/index.scss +280 -280
  33. package/files/.wl-skills/src/components/local/c_formSections/index.vue +429 -429
  34. package/files/.wl-skills/src/components/local/c_listModal/data.ts +41 -41
  35. package/files/.wl-skills/src/components/local/c_listModal/index.vue +136 -136
  36. package/files/.wl-skills/src/components/local/c_spliterTitle/index.scss +25 -25
  37. package/files/.wl-skills/src/components/local/c_spliterTitle/index.vue +21 -21
  38. package/files/.wl-skills/src/components/remote/AGGrid/README.md +530 -530
  39. package/files/.wl-skills/src/components/remote/BaseForm/README.md +508 -508
  40. package/files/.wl-skills/src/components/remote/BaseQuery/README.md +865 -865
  41. package/files/.wl-skills/src/components/remote/BaseTable/README.md +941 -941
  42. package/files/.wl-skills/src/components/remote/BaseToolbar/README.md +496 -496
  43. package/files/.wl-skills/src/types/page.ts +24 -24
  44. package/files/.wl-skills/standards/04-coding-basics.md +39 -1
  45. package/files/.wl-skills/standards/09-typescript.md +26 -3
  46. package/files/.wl-skills/standards/12-base-table.md +56 -4
  47. package/files/.wl-skills/standards/13-platform-components.md +1 -0
  48. package/files/.wl-skills/standards/index.md +2 -2
  49. package/files/.wl-skills/templates/README.md +44 -44
  50. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add/api.md +54 -54
  51. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add/data.ts +346 -346
  52. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add/index.scss +1 -1
  53. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add/index.vue +28 -28
  54. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add-form/data.ts +115 -115
  55. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add-form/index.scss +44 -44
  56. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add-form/index.vue +43 -43
  57. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change/data.ts +338 -338
  58. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change/index.scss +1 -1
  59. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change/index.vue +28 -28
  60. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change-form/data.ts +115 -115
  61. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change-form/index.scss +44 -44
  62. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change-form/index.vue +43 -43
  63. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-archive/api.md +88 -88
  64. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-archive/data.ts +601 -601
  65. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-archive/index.scss +1 -1
  66. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-archive/index.vue +64 -64
  67. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-detail/api.md +67 -67
  68. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-detail/data.ts +286 -286
  69. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-detail/index.scss +139 -139
  70. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-detail/index.vue +318 -318
  71. package/files/.wl-skills/templates/produce/aiflow/mmwr-temp-customer-archive/api.md +98 -98
  72. package/files/.wl-skills/templates/produce/aiflow/mmwr-temp-customer-archive/data.ts +543 -543
  73. package/files/.wl-skills/templates/produce/aiflow/mmwr-temp-customer-archive/index.scss +1 -1
  74. package/files/.wl-skills/templates/produce/aiflow/mmwr-temp-customer-archive/index.vue +52 -52
  75. package/files/.wl-skills/templates/sale/demo/add-demo/data.ts +518 -518
  76. package/files/.wl-skills/templates/sale/demo/billet-flame-cut-plan/data.ts +524 -524
  77. package/files/.wl-skills/templates/sale/demo/billet-flame-cut-plan/index.scss +154 -154
  78. package/files/.wl-skills/templates/sale/demo/billet-flame-cut-plan/index.vue +117 -117
  79. package/files/.wl-skills/templates/sale/demo/domestic-trade-order/data.ts +308 -308
  80. package/files/.wl-skills/templates/sale/demo/domestic-trade-order/index.scss +99 -99
  81. package/files/.wl-skills/templates/sale/demo/domestic-trade-order/index.vue +77 -77
  82. package/files/.wl-skills/templates/sale/demo/heat-batch-return/data.ts +367 -367
  83. package/files/.wl-skills/templates/sale/demo/heat-batch-return/index.scss +100 -100
  84. package/files/.wl-skills/templates/sale/demo/heat-batch-return/index.vue +170 -170
  85. package/files/.wl-skills/templates/sale/demo/heat-batch-return/meltDialog.vue +320 -320
  86. package/files/.wl-skills/templates/sale/demo/metallurgical-spec/data.ts +824 -824
  87. package/lib/ast-rules.js +395 -12
  88. package/mcp/config.js +46 -46
  89. package/mcp/registry.js +6 -1
  90. package/mcp/tools/projectTools.js +9 -1
  91. package/package.json +2 -2
@@ -1,24 +1,24 @@
1
- /*
2
- * @Author: ChenYu ycyplus@gmail.com
3
- * @Date: 2026-01-02 11:00:00
4
- * @LastEditors: ChenYu ycyplus@gmail.com
5
- * @LastEditTime: 2026-01-02 11:00:00
6
- * @FilePath: \cx-ui-sale\src\types\page.ts
7
- * @Description: 页面常用类型统一导出
8
- * Copyright (c) 2026 by CHENY, All Rights Reserved 😎.
9
- */
10
-
11
- // 页面 Hook
12
- export { AbstractPageQueryHook } from "@jhlc/common-core/src/page-hooks/page-query-hook";
13
-
14
- // 查询组件类型
15
- export { BaseQueryItemDesc } from "@jhlc/common-core/src/components/form/base-query/type";
16
-
17
- // 工具栏类型
18
- export { ActionButtonDesc } from "@jhlc/common-core/src/components/toolbar/type";
19
-
20
- // 表格类型
21
- export { TableColumnDesc } from "@jhlc/common-core/src/components/table/base-table/type";
22
-
23
- // 业务逻辑数据类型
24
- export { BusLogicDataType } from "@jhlc/types/src/logical-data";
1
+ /*
2
+ * @Author: ChenYu ycyplus@gmail.com
3
+ * @Date: 2026-01-02 11:00:00
4
+ * @LastEditors: ChenYu ycyplus@gmail.com
5
+ * @LastEditTime: 2026-01-02 11:00:00
6
+ * @FilePath: \cx-ui-sale\src\types\page.ts
7
+ * @Description: 页面常用类型统一导出
8
+ * Copyright (c) 2026 by CHENY, All Rights Reserved 😎.
9
+ */
10
+
11
+ // 页面 Hook
12
+ export { AbstractPageQueryHook } from "@jhlc/common-core/src/page-hooks/page-query-hook";
13
+
14
+ // 查询组件类型
15
+ export { BaseQueryItemDesc } from "@jhlc/common-core/src/components/form/base-query/type";
16
+
17
+ // 工具栏类型
18
+ export { ActionButtonDesc } from "@jhlc/common-core/src/components/toolbar/type";
19
+
20
+ // 表格类型
21
+ export { TableColumnDesc } from "@jhlc/common-core/src/components/table/base-table/type";
22
+
23
+ // 业务逻辑数据类型
24
+ export { BusLogicDataType } from "@jhlc/types/src/logical-data";
@@ -5,7 +5,7 @@
5
5
 
6
6
  ---
7
7
 
8
- ## 13 条核心约定
8
+ ## 14 条核心约定
9
9
 
10
10
  1. **变量声明**:优先 `const`,必须重新赋值时用 `let`,禁止 `var`
11
11
  2. **解构赋值**:优先使用 `const { a, b } = obj`,而非 `obj.a` / `obj.b`
@@ -20,6 +20,44 @@
20
20
  11. **v-for**:必须设置 `:key`,优先用业务主键 id 而非 index
21
21
  12. **指令缩写**:统一 `:`(v-bind)、`@`(v-on)、`#`(v-slot)
22
22
  13. **this 别名**:`<script setup>` 中无 `this`;旧 Options API 中的 `this` 别名用 `self`
23
+ 14. **圈复杂度**:单函数圈复杂度 ≤ **10**(Mcabe),尽量小;超阈值必须拆分
24
+
25
+ ---
26
+
27
+ ## 圈复杂度(Mcabe)细则
28
+
29
+ > 对应确定性执行器 **R13**(`wl-skills validate` AST 引擎,阻断级)。
30
+
31
+ - **定义**:`复杂度 = 1 + 决策点数`,决策点 = `if` / `case` / `for` / `for-in` / `for-of` / `while` / `do-while` / `catch` / 三元 `?:` / `&&` / `||` / `??`。与 ESLint `complexity` 规则完全一致。
32
+ - **范围**:`index.vue <script>` 与 `data.ts` 中的**每一个**函数 / 方法 / 箭头函数独立计算(嵌套函数单独计,不叠加到父函数)。
33
+ - **上限**:`10`。`> 10` 由 R13 报 error 阻断提交。
34
+ - **豁免**:单函数加 `// wl-skills:ignore R13` 可精确豁免(仅限确有复杂第三方对接场景,需注释说明)。
35
+
36
+ **降低复杂度的手法**(按优先级):
37
+
38
+ 1. **提前 return**(Guard Clause)替代嵌套 `if`
39
+ 2. 查表驱动(`map[cond]()`)替代 `if-else` / `switch` 长链
40
+ 3. 按职责抽取子函数(每个子函数单一职责)
41
+ 4. 策略 / 状态机模式消除多分支
42
+
43
+ **示例**:
44
+
45
+ ```typescript
46
+ // ❌ 复杂度 6,难读
47
+ function getLabel(type: string, v: number) {
48
+ if (type === "a") { if (v > 0) { return "A+" } else { return "A-" } }
49
+ else if (type === "b") { if (v > 0) { return "B+" } else { return "B-" } }
50
+ return v > 0 ? "OTHER+" : "OTHER-"
51
+ }
52
+
53
+ // ✅ 复杂度 2,查表驱动
54
+ const LABEL_MAP = { a: ["A-", "A+"], b: ["B-", "B+"] } as const
55
+ function getLabel(type: string, v: number) {
56
+ const pair = LABEL_MAP[type as keyof typeof LABEL_MAP]
57
+ if (pair) return pair[v > 0 ? 1 : 0]
58
+ return v > 0 ? "OTHER+" : "OTHER-"
59
+ }
60
+ ```
23
61
 
24
62
  ---
25
63
 
@@ -1,7 +1,29 @@
1
1
  # 09 — TypeScript 类型规范
2
2
 
3
- > **强制度**:🟡 建议。
4
- > 项目使用 `strict: false` 宽松模式起步。
3
+ > **强制度**:🔴 必遵。
4
+ > 项目使用 `strict: false` 宽松模式起步,但**类型错误零容忍**:`vue-tsc --noEmit` 必须 0 error。
5
+
6
+ ---
7
+
8
+ ## 类型错误零容忍(R14)
9
+
10
+ > 对应确定性执行器 **R14**(`wl-skills validate --typecheck` / MCP `wls_validate_page {typecheck:true}`,阻断级)。
11
+
12
+ - **基线**:`vue-tsc --noEmit`(无 `vue-tsc` 时回退 `tsc --noEmit`)必须退出码 0。
13
+ - **何时跑**:
14
+ - **CI 必跑**:流水线中 `wl-skills validate --typecheck`(与 `--strict` 组合),任何 TS error 阻断合并
15
+ - **pre-push / 发版前必跑**:本地 `pnpm wl-skills validate --typecheck`
16
+ - **pre-commit 不建议开启**:全量类型检查较慢,避免拖慢日常提交
17
+ - **优雅降级**:项目无 `tsconfig.json` 或未安装 `vue-tsc` / `tsc` 时,R14 输出 warn 不阻断(提示安装后纳入 CI)。
18
+ - **为什么必遵**:类型错误在运行时才暴露,成本高;CI 阶段拦截是 ROI 最高的质量门。
19
+
20
+ ```bash
21
+ # CI / 发版前
22
+ wl-skills validate --typecheck --strict
23
+
24
+ # MCP(AI 编辑器中)
25
+ wls_validate_page({ path: "src/views", typecheck: true })
26
+ ```
5
27
 
6
28
  ---
7
29
 
@@ -68,4 +90,5 @@ interface Customer {
68
90
  | -------------------- | ------------------------------------------ |
69
91
  | 已有 `tsconfig.json` | ✅ 直接安装 git-standards,零冲突 |
70
92
  | 无 TS 环境 | 先 `tsc --init` 初始化,再装 git-standards |
71
- | ESLint TS 规则 | `warn` 级别,不阻断提交,仅作质量提示 |
93
+
94
+ > ESLint TS 规则维持 `warn`(风格类,不阻断提交);**类型错误阻断由 R14 兜底**(`vue-tsc --noEmit` 非零退出码 → error),二者职责分离:ESLint 管风格,R14 管正确性。
@@ -132,10 +132,62 @@ subColumnsDef(): TableColumnDesc<any>[] {
132
132
 
133
133
  ### 豁免规则
134
134
 
135
- - 豁免场景仍**优先使用 `BaseTable`**(非 AGGrid 模式),而非裸 `el-table`
136
- - 豁免场景如果支持列持久化,仍**必须有 `cid`**
137
- - 审查报告中豁免项必须标注**原因**,避免滥用
138
- - 如果豁免场景后续升级为主列表,必须迁移到 AGGrid
135
+ > **两层豁免机制**:单文件注释豁免(精确)+ 项目级配置豁免(批量)。标准列表页不受豁免影响,仍强制 `BaseTable + AGGrid`。
136
+
137
+ #### 优先级:标准列表 vs 特殊场景
138
+
139
+ | 场景类型 | 渲染要求 | R3(el-table)/ AGGrid 卡控 |
140
+ |---|---|---|
141
+ | **标准列表页**(分页查询、台账、核心业务列表) | `BaseTable` + `render-type="agGrid"` + `cid` | 🔴 强制,不可豁免 |
142
+ | **BaseTable 可胜任的特殊表格**(弹窗小表、只读展示、嵌套子表) | `BaseTable`(非 AGGrid 也可),尽量带 `cid` | 🟢 豁免 AGGrid(R3 仍建议改 BaseTable) |
143
+ | **BaseTable 受限的复杂场景**(表单/设计器内嵌表格、行内编辑明细表、特殊合并单元格/复杂行列布局) | 优先 `BaseTable`;确实受限时降级 `el-table` | 🟢 可豁免 R3(需登记豁免原因) |
144
+ | **平台封装组件内部** | 按需 | 🟢 豁免 R3(封装层单独评审) |
145
+
146
+ > 判定原则:**先用 BaseTable**;BaseTable 确实受限不能满足时,才降级 `el-table`,不直接裸用。
147
+
148
+ #### 豁免方式一:单文件注释(精确到文件)
149
+
150
+ 在特殊文件内加注释标记,精确豁免该文件的指定规则(适合个别页面):
151
+
152
+ ```vue
153
+ <!-- index.vue -->
154
+ <!-- wl-skills:ignore R3 --> ← 整页豁免 R3(el-table 检测)
155
+ <template>
156
+ <el-table> ... </el-table> <!-- 表单设计器内嵌表格,AGGrid 内联编辑受限 -->
157
+ </template>
158
+ ```
159
+
160
+ ```typescript
161
+ // data.ts
162
+ // wl-skills:ignore R10 ← 豁免该文件的 R10
163
+ ```
164
+
165
+ #### 豁免方式二:项目级配置(批量到目录,推荐用于整片特殊场景)
166
+
167
+ 项目根放 `.wl-skills-validate.json`(kit 不主动创建,零功能影响;详见 `docs/validate-exempt.md`):
168
+
169
+ ```json
170
+ {
171
+ "exemptions": [
172
+ {
173
+ "paths": ["src/views/produce/designer"],
174
+ "rules": ["R3", "R10"],
175
+ "reason": "表单设计器内嵌表格,BaseTable AGGrid 内联编辑受限"
176
+ },
177
+ {
178
+ "paths": ["src/views/sale/order-edit/**"],
179
+ "rules": ["R3"],
180
+ "reason": "订单行内编辑明细表,AGGrid 行编辑成本高于收益"
181
+ }
182
+ ]
183
+ }
184
+ ```
185
+
186
+ - `paths`:页面目录前缀,支持 `/**` glob;命中该目录及其子目录
187
+ - `rules`:规则编号(`R3`/`R10` 等),大小写不敏感
188
+ - `reason`:**必填审计字段**,避免滥用
189
+
190
+ > ⚠️ 豁免不是放任。豁免项升级为主列表页时,必须迁移回 `BaseTable + AGGrid`。`convention-audit` 审计时列出所有豁免项供人工复核。
139
191
 
140
192
  ### 审查报告中的分类
141
193
 
@@ -116,6 +116,7 @@ export function createPage() {
116
116
 
117
117
  - [ ] 查询区使用了 BaseQuery,没有自己写 el-form?
118
118
  - [ ] 表格使用了 BaseTable + agGrid + cid,没有用 el-table?
119
+ (BaseTable 受限的特殊场景如表单/设计器内嵌表格,登记豁免后可用 el-table,见 standards/12 §豁免规则)
119
120
  - [ ] 弹窗使用了 c_formModal / c_listModal,没有手写 el-dialog?
120
121
  - [ ] 日期组件用了 jh-date 系列,没有用 el-date-picker?
121
122
  - [ ] HTTP 请求都走 `this.getAction / postAction`,没有 import axios?
@@ -17,7 +17,7 @@
17
17
  | 06 | `06-security.md` | 安全规范 | 🔴 必遵 |
18
18
  | 07 | `07-config.md` | 配置管理 | 🔴 必遵 |
19
19
  | 08 | `08-git.md` | Git 分支 & 提交 + 审计 | 🔴 必遵 |
20
- | 09 | `09-typescript.md` | TypeScript 类型 | 🟡 建议 |
20
+ | 09 | `09-typescript.md` | TypeScript 类型 + 类型错误零容忍 | 🔴 必遵 + 阻断 |
21
21
  | 10 | `10-pinia.md` | Pinia 状态管理 | 🔴 必遵 |
22
22
  | 11 | `11-form-validation.md` | 表单与校验 | 🔴 必遵 |
23
23
  | 12 | `12-base-table.md` | BaseTable + AGGrid cid | 🔴 必遵 |
@@ -79,7 +79,7 @@
79
79
  ✅ 已读取 standards/13-platform-components.md → 平台组件对照表
80
80
  ```
81
81
 
82
- > **不要** 一次性读取全部 13 条。错误示范:`✅ 已读取 standards/01 ~ standards/13`(浪费 token,违反懒加载原则)。
82
+ > **不要** 一次性读取全部 14 条。错误示范:`✅ 已读取 standards/01 ~ standards/14`(浪费 token,违反懒加载原则)。
83
83
 
84
84
  ---
85
85
 
@@ -1,44 +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/.wl-skills/templates/ — 销售域(平台默认样例,5 个页面)
22
-
23
- | 目录 | 模板类型 | 说明 |
24
- | ------------------------ | ------------- | -------------------------------- |
25
- | `domestic-trade-order/` | LIST | 标准内贸订单列表 |
26
- | `metallurgical-spec/` | MASTER_DETAIL | 冶金规范(jh-drag-row 上下分栏) |
27
- | `add-.wl-skills/templates/` | 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
- 新增样例请放在 `.wl-skills/templates/{domain}/{submodule}/{page-name}/`,提 PR 到 wl-skills-kit 仓库。
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/.wl-skills/templates/ — 销售域(平台默认样例,5 个页面)
22
+
23
+ | 目录 | 模板类型 | 说明 |
24
+ | ------------------------ | ------------- | -------------------------------- |
25
+ | `domestic-trade-order/` | LIST | 标准内贸订单列表 |
26
+ | `metallurgical-spec/` | MASTER_DETAIL | 冶金规范(jh-drag-row 上下分栏) |
27
+ | `add-.wl-skills/templates/` | 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
+ 新增样例请放在 `.wl-skills/templates/{domain}/{submodule}/{page-name}/`,提 PR 到 wl-skills-kit 仓库。
@@ -1,54 +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:2000, data:{ 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 | 核实状态(色块)|
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:2000, data:{ 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 | 核实状态(色块)|