@qilitt-mickey/vue3-temp-skill 1.1.18 → 1.1.20

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 CHANGED
@@ -8,6 +8,7 @@ Vue 3 企业级中后台项目开发规范技能包 — 按团队规范生成代
8
8
 
9
9
  - **始终加载** `core-kernel`
10
10
  - **按需** `project-inventory`(addon / 查 Re* / 装依赖)
11
+ - **精简模板启用 addon** `addon-enable`(装包后逐文件恢复配置,非自动)
11
12
  - **生成后闸门** `code-quality`:清单 + `pnpm lint:fix` + `pnpm type-check` + 结果块
12
13
  - 复用仓库已有封装;选型表指定库勿擅自替换;addon 精确版本见 inventory 第九节
13
14
 
@@ -31,7 +32,7 @@ Vue 3 企业级中后台项目开发规范技能包 — 按团队规范生成代
31
32
  |------|------|
32
33
  | 始终 | core-kernel |
33
34
  | 闸门 | code-quality |
34
- | 按需资产 | project-inventory |
35
+ | 按需资产 | project-inventory、**addon-enable** |
35
36
  | 标准业务 | http-api、crud-pages、detail-page、data-writeback、permission-auth、layout-theme、design-system、design-handoff、icons、feedback-loading、base-code-dict、api-check、ui-components |
36
37
  | 专项 | form-advanced、table-vxe、tree-table、chart-echarts、file-management、download-export、rich-text、graph-relation、workflow-bpmn、flowchart-g6、data-mapping、websocket-realtime、mobile-h5、wechat-js、verify-captcha、qrcode-barcode、feedback-ui、seamless-scroll、particles、data-compare、data-screen、directives-advanced |
37
38
 
@@ -52,11 +53,23 @@ npx @qilitt-mickey/vue3-temp-skill@latest install all
52
53
  ## 生成工作流(AI)
53
54
 
54
55
  1. 解析需求 → 命中功能模块
55
- 2. 读 `core-kernel` + 命中模块;addon 时加读 inventory;设计交接块时加读 `design-handoff`
56
- 3. 缺包按 inventory 第九节精确版本,确认后安装
56
+ 2. 读 `core-kernel` + 命中模块;addon 时加读 inventory + **`addon-enable`**;设计交接块时加读 `design-handoff`
57
+ 3. 缺包按 inventory 第九节精确版本,确认后安装;**再按 `addon-enable` 逐文件恢复配置**
57
58
  4. 复用仓库 Re*/Hook/utils;按模块示例生成落盘
58
59
  5. 执行 `code-quality` → 输出审查结果块 + 变更说明
59
60
 
60
61
  ## 与模版的关系
61
62
 
62
- 本 Skill 约定对齐 **vue3-web-temp** 脚手架;使用者在各自业务仓库中开发,不绑定某一固定本机目录。壳层以当前项目源码为准,规范以本包 `references/` 为准。
63
+ 本 Skill 约定对齐 **vue3-web-temp** 精简脚手架:
64
+
65
+ | 文档 | 读者 | 内容 |
66
+ |------|------|------|
67
+ | 模板 `README.md` | 人类开发者 | 安装、配置、命令、与 AI 协同入口 |
68
+ | 模板 `AGENTS.md` | AI 助手 | 仓库事实、硬性约定摘要、Skill 路由 |
69
+ | 本包 `references/` | AI + 开发者 | **标准样板**、专项细则、addon 安装表 |
70
+ | 本包 `addon-enable.md` | AI + 开发者 | **出厂已删依赖的逐文件恢复代码** |
71
+
72
+ - 模板仓库:布局壳 + core 依赖 + `Re*` 源码(addon 组件默认不参与类型检查直至安装依赖)
73
+ - **标准样板**:在本包 `references/`,不在模板 `views/`
74
+ - 壳层以当前项目源码为准;规范与安装表以本包为准
75
+ - HTTP:`axios@1.19.0` 固定版本,仅经 `@/utils/http`
package/SKILL.md CHANGED
@@ -9,10 +9,26 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
9
9
 
10
10
  执行顺序:命中模块 → 读 `core-kernel` → 读命中 `references/<模块>.md` → 生成 → 执行 `code-quality` → 回复含审查结果块。
11
11
 
12
+ ## 术语约定
13
+
14
+ 全文统一使用下表术语;不得使用「黄金样板 / 强制完整样板 / 抗略读 / 默记 / 真相源」等表述。
15
+
16
+ | 统一术语 | 含义 | 禁止使用 |
17
+ |----------|------|----------|
18
+ | 标准样板 | 模块内完整代码样板,命中即整段落盘 | 黄金样板、强制完整样板 |
19
+ | 完整性守则 | 全模块通用的防浅读规则 | 抗略读 |
20
+ | 速查约定 | 高频写法的快速指引 | 默记 |
21
+ | 权威性优先级 | 实现方式选取顺序:仓库封装 > 本 Skill 示例 > 通用 Vue 习惯 | 真相源 |
22
+ | 回退至 | 缺档取值动作(如「缺档 → 回退至 default」) | 缺档场景的「落到」 |
23
+ | 未命中模块 | 需求无对应专项模块时的路由结果 | 「兜底」指代路由结果 |
24
+
12
25
  ## 模版约定
13
26
 
14
27
  - 面向由 **vue3-web-temp** 脚手架搭出的业务项目(目录名/安装路径因人而异,以当前工作区为准)
15
- - 业务写法以本包 `references/` 为准;壳层行为(顶部 tag / 侧栏 / keep-alive / `useDetail`)以**当前项目**已有实现为准
28
+ - **文档分工**:人类读模板 `README.md`;AI 读模板 `AGENTS.md` + Skill;样板与细则在本包 `references/`
29
+ - **精简出厂**:模板 `views/` 仅保留登录/首页等壳页面;**业务标准样板**在本包 `references/`(如 `crud-pages`、`detail-page`)
30
+ - **依赖分层**:`package.json` 仅 **core**;**addon** 默认不装;缺包时装依赖后须按 `addon-enable.md` **逐文件恢复配置**(非自动)
31
+ - 壳层行为(顶部 tag / 侧栏 / keep-alive / `useDetail`)以**当前项目**已有实现为准
16
32
  - **双轨**:无设计 handoff → 保持模版出厂;有设计落地 → 读 `design-handoff.md` **原子步骤**(`Theme`/`Version`/令牌整组,禁止只改主色)
17
33
 
18
34
  ## 使用方式
@@ -25,19 +41,19 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
25
41
 
26
42
  1. 先读 `references/core-kernel.md`
27
43
  2. 复用仓库已有 `Re*` / Hook / utils;选型表指定库勿擅自替换
28
- 3. 按命中模块内**强制完整样板**整段编写(禁止只抄 API 签名、丢掉 meta/配套段落)
44
+ 3. 按命中模块内**标准样板**整段编写(禁止只抄 API 签名、丢掉 meta/配套段落)
29
45
  4. 无对应能力 → 标注「待确认」,未经同意不引入新依赖
30
- 5. 真相源:`仓库已有封装` > `本 Skill 示例` > 通用 Vue 习惯
31
- 6. 命中 addon / 缺依赖时再读 `project-inventory.md` 第九节;精确版本安装,禁止 `@latest`
46
+ 5. 权威性优先级:`仓库已有封装` > `本 Skill 示例` > 通用 Vue 习惯
47
+ 6. 命中 addon / 缺依赖:读 `project-inventory` 第九/十节 + **`addon-enable.md`**(逐文件恢复代码);精确版本安装,禁止 `@latest`
32
48
 
33
- ## 抗略读(全模块 · 提高命中率)
49
+ ## 完整性守则(全模块强制)
34
50
 
35
- 按需模块 ≠ 可浅读。命中即须落到该文件的**完整样板 / Must-do**,生成后靠 `code-quality` 硬失败表兜底。
51
+ 按需模块 ≠ 可浅读。命中即须落到该文件的**标准样板 / Must-do**,生成后靠 `code-quality` 硬失败表兜底。
36
52
 
37
53
  1. **样板字段默认写出**:示例里写明的 `activePath` / `keepAlive` / `roles` / `responseType: "blob"` 等不得改成 `//` 注释再当可选项;仅业务明确不需要时才删除
38
54
  2. **关联能力同批落盘**:列表→详情 = `crud-pages` + `detail-page` 三件套;有 API = 同步 `http-api`;有删除 = 确认框;有编辑回显 = `Object.assign`
39
55
  3. **Hook ≠ 壳层自动**:`toDetail` 写 tag;侧栏高亮 / keepAlive 靠路由 meta;`http` 加解密靠环境开关,不靠单请求配置
40
- 4. **大范围交付仍须逐模块核对硬失败表**,禁止「lint 过了就算完」
56
+ 4. **大范围交付仍须逐模块核对硬失败表**,禁止以 lint 通过代替硬失败表逐项核对
41
57
 
42
58
  ## 模块路由表
43
59
 
@@ -52,6 +68,7 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
52
68
  | 时机 | 文件 |
53
69
  |------|------|
54
70
  | addon / 查 Re* 名 / 装依赖 | `references/project-inventory.md` |
71
+ | **启用精简模板已删的 addon(装包 + 改配置)** | `references/addon-enable.md`(与功能模块同读) |
55
72
  | 写完代码后(闸门,非功能命中) | `references/code-quality.md` |
56
73
  | 设计交接块 / **design-handoff/v1 JSON** / 上游令牌产出落地 | `references/design-handoff.md`(+ `design-system`) |
57
74
 
@@ -97,15 +114,16 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
97
114
  | **feedback-ui** | 通知栏、水印、时间轴、打字机 |
98
115
  | **seamless-scroll** | 无缝滚动、跑马灯 |
99
116
  | **particles** | 粒子、tsparticles、登录背景粒子 |
100
- | **directives-advanced** | 一键复制、标题太长字号变小 → `v-copy` / `v-auto-font` |
117
+ | **directives-advanced** | 一键复制、标题字号自适应 → `v-copy` / `v-auto-font` |
101
118
 
102
119
  ### 匹配规则
103
120
 
104
121
  1. 单模块 → 该模块 + `core-kernel`;结束后执行 `code-quality`
105
122
  2. 多模块 → 同时加载(例:客户列表 = `crud-pages` + `permission-auth` + `http-api`)
106
- 3. 兜底 → 仅 `core-kernel`,询问是否专项
107
- 4. 默认不改 `vite.config.ts` / `build/**`
123
+ 3. 未命中模块 → 仅 `core-kernel`,向用户确认是否专项
124
+ 4. 默认不改 `vite.config.ts` / `build/**`;**例外**:按 `addon-enable.md` 恢复 FileViewer / VantResolver / Vconsole 等占位插件时允许改 `build/plugins/*`
108
125
  5. 效果匹配:
126
+ - 启用 echarts / vant / file-viewer / 富文本等已删 addon → 功能模块 + **`addon-enable`**
109
127
  - 弹窗 → `form-advanced`
110
128
  - 点一下复制 → `directives-advanced`(`v-copy`)
111
129
  - 标题字跟着宽度变小 → `directives-advanced`(`v-auto-font`)
@@ -118,10 +136,10 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
118
136
  - 列表→独立详情/编辑页 → `crud-pages` + `detail-page`
119
137
  6. 独立详情路由:跳转与 meta 见 `detail-page`(`toDetail` / `showLink` / `activePath` / `initToDetail`)
120
138
 
121
- ## 默记(细则见对应模块)
139
+ ## 速查约定(细则见对应模块)
122
140
 
123
141
  - HTTP:`import { http } from '@/utils/http'`;方法跟后端(允许 GET/POST);`Result<T>`;`VITE_API_BASE_URL` → `http-api`
124
- - 列表:`onSearch` / `reset` + 黄金样板 → `crud-pages`
142
+ - 列表:`onSearch` / `reset` + 标准样板 → `crud-pages`
125
143
  - 独立详情:`toDetail` **不能替代** `activePath` / `keepAlive` / `moreTags`;三件套 → `detail-page`
126
144
  - 权限:`meta.roles` + `v-auth`/`ReAuth` → `permission-auth`
127
145
  - 不二次挂 Layout;`script setup` + `defineOptions({ name })`;`$t('中文')`;样式契约 → `core-kernel`
@@ -129,22 +147,22 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
129
147
  ## 工作流
130
148
 
131
149
  1. **需求分析**:列出功能模块 ID(不含 `code-quality`)
132
- 2. **加载**:`core-kernel` + 命中模块;addon 时加读 `project-inventory`;设计规范/交接产出时加读 `design-handoff` 并执行 design-system Step 0(与业务的先后按需求)
133
- 3. **依赖**:缺包按 inventory 第九节精确版本,确认后再装
150
+ 2. **加载**:`core-kernel` + 命中模块;addon/缺包时加读 `project-inventory` + **`addon-enable`**;设计规范/交接产出时加读 `design-handoff`
151
+ 3. **依赖**:缺包按 inventory 第九节精确版本,确认后安装;**再按 `addon-enable` 对应章节改配置**
134
152
  4. **探查**:复用仓库 `Re*` / Hook / utils
135
153
  5. **生成**:可运行代码落盘
136
- 6. **code-quality**:按 `references/code-quality.md` 执行(重读清单 → 对照改动 → `pnpm lint:fix` + `pnpm type-check` → 修正 → 结果块)
137
- 7. **输出**:变更说明 + 待确认项
154
+ 6. **code-quality**:按 `references/code-quality.md` 执行
155
+ 7. **输出**:变更说明(含已改配置文件列表)+ 待确认项
138
156
 
139
157
  ### 最终回复结构
140
158
 
141
159
  ```markdown
142
160
  ## 命中模块
143
- - <功能模块…>
161
+ - <功能模块…>(缺包时含 addon-enable)
144
162
 
145
163
  ## 代码质量审查
146
164
  - 闸门:已执行 code-quality(生成后)
147
- - 清单:选型 / 类型 / 组件 / API / 安全 / 业务 / 列表→详情(如适用) / 列表布局(如适用) / 风格 → 通过 | 已修正:…
165
+ - 清单:选型 / 类型 / 组件 / API / 安全 / 业务 / 列表→详情(如适用) / 列表布局(如适用) / 风格 / addon启用(如适用) → 通过 | 已修正:…
148
166
  - 硬失败:无 | 已拦截并修正:…
149
167
  - 命令:`pnpm lint:fix` → …;`pnpm type-check` → …
150
168
  - 待确认:…
@@ -155,4 +173,4 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
155
173
 
156
174
  ## 文件索引
157
175
 
158
- `references/<模块名>.md` 与路由表 ID 一一对应。依赖安装见 `project-inventory.md` 第九节。
176
+ `references/<模块名>.md` 与路由表 ID 一一对应。依赖安装见 `project-inventory.md` 第九节;**精简模板配置恢复见 `addon-enable.md`**。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qilitt-mickey/vue3-temp-skill",
3
- "version": "1.1.18",
3
+ "version": "1.1.20",
4
4
  "description": "Vue 3 企业级中后台项目开发规范技能包 — core-kernel 架构、按需功能模块",
5
5
  "bin": {
6
6
  "vue3-temp-skill": "./bin/cli.js"
@@ -0,0 +1,418 @@
1
+ ---
2
+ skill: addon-enable
3
+ description: 精简模板 addon 启用手册。记录出厂删除的依赖及须恢复的每一处代码/配置;命中 chart/vant/file-viewer 等 addon 或装依赖时必读。
4
+ scope: project
5
+ tags: [addon, enable, restore, tsconfig, vant, echarts, file-viewer, slim-template]
6
+ ---
7
+
8
+ # 精简模板 addon 启用手册(代码级恢复)
9
+
10
+ > **读者**:AI 与开发者。
11
+ > **何时读**:`package.json` 缺某 addon,且业务要启用该能力时(与功能模块、`project-inventory` 第九/十节同读)。
12
+ > **原则**:`pnpm add` **不会**自动改配置;须按本节**逐文件落盘**。禁止 `@latest`。版本以 inventory 为准。
13
+
14
+ ## 总流程
15
+
16
+ 1. 查 `package.json` → 列缺失包
17
+ 2. 展示精确版本命令 → **用户确认**
18
+ 3. `pnpm add` / `pnpm add -D`
19
+ 4. 按对应章节改 `tsconfig` / `build` / `src`
20
+ 5. `pnpm type-check`
21
+ 6. 再写业务代码 / 引用 `Re*`
22
+
23
+ 未完成第 4 步就引用组件 → 视为未通过。
24
+
25
+ ---
26
+
27
+ ## A. 通用:`tsconfig.json` exclude
28
+
29
+ 启用时**只删用到的行**(保留 `__tests__` / `node_modules` / `dist` / `**/*.js`):
30
+
31
+ ```json
32
+ "src/components/ReEchart/**",
33
+ "src/components/ReRichText/**",
34
+ "src/components/ReFileViewer/**",
35
+ "src/components/ReCheckCard/**",
36
+ "src/components/ReQrcode/**",
37
+ "src/components/ReBarcode/**",
38
+ "src/components/ReTypeit/**",
39
+ "src/components/ReVerify/**",
40
+ "src/components/ReSelectVant/**",
41
+ "src/components/RePopupPicker/**",
42
+ "src/utils/wechat/**",
43
+ "src/hooks/useWechat.ts",
44
+ "src/api/wechat/**",
45
+ "src/utils/vantRules.ts",
46
+ "types/file-viewer.d.ts"
47
+ ```
48
+
49
+ ---
50
+
51
+ ## B. chart-echarts
52
+
53
+ ```bash
54
+ pnpm add echarts@6.1.0
55
+ # 词云:
56
+ pnpm add echarts-wordcloud@2.1.0
57
+ ```
58
+
59
+ | 文件 | 动作 |
60
+ |------|------|
61
+ | `tsconfig.json` | 删 exclude:`src/components/ReEchart/**` |
62
+ | `build/optimize.ts` | 建议 `include` 追加: |
63
+
64
+ ```ts
65
+ 'echarts/core',
66
+ 'echarts/charts',
67
+ 'echarts/components',
68
+ 'echarts/features',
69
+ 'echarts/renderers',
70
+ ```
71
+
72
+ ```ts
73
+ import { ReEchart } from '@/components/ReEchart'
74
+ ```
75
+
76
+ 组件源码已在 `src/components/ReEchart/`。业务样板见 `chart-echarts.md`。
77
+
78
+ ---
79
+
80
+ ## C. rich-text
81
+
82
+ ```bash
83
+ pnpm add @wangeditor/editor@5.1.23
84
+ ```
85
+
86
+ | 文件 | 动作 |
87
+ |------|------|
88
+ | `tsconfig.json` | 删:`src/components/ReRichText/**` |
89
+ | `build/optimize.ts` | 可选:`'@wangeditor/editor'` |
90
+
91
+ ```ts
92
+ import ReRichText from '@/components/ReRichText'
93
+ ```
94
+
95
+ 样板见 `rich-text.md`。
96
+
97
+ ---
98
+
99
+ ## D. file-management
100
+
101
+ ```bash
102
+ pnpm add @file-viewer/core@2.1.14 @file-viewer/vue3@2.1.14 @file-viewer/preset-all@2.1.14 browser-image-compression@2.0.2
103
+ pnpm add -D @file-viewer/vite-plugin@2.1.14
104
+ ```
105
+
106
+ ### D1. `tsconfig.json`
107
+
108
+ 删:`src/components/ReFileViewer/**`、`types/file-viewer.d.ts`
109
+
110
+ ### D2. `build/plugins/FileViewer.ts`(替换占位 `return []`)
111
+
112
+ ```ts
113
+ import { fileViewerRenderers } from '@file-viewer/vite-plugin'
114
+
115
+ /**
116
+ * @file-viewer/vite-plugin 封装(2.1.14)
117
+ * preset-all;renderer 分包见 build/chunks.ts
118
+ */
119
+ export function FileViewerPlugin() {
120
+ return fileViewerRenderers({
121
+ preset: 'all',
122
+ autoPresets: false,
123
+ inject: false,
124
+ scan: false,
125
+ copyAssets: true,
126
+ chunkStrategy: 'none',
127
+ })
128
+ }
129
+ ```
130
+
131
+ `build/plugins/index.ts` 已有 `FileViewerPlugin()`,一般不用改。
132
+
133
+ ### D3. `types/env.d.ts` — 在 `declare module 'js-md5'` 后增加
134
+
135
+ ```ts
136
+ declare module 'virtual:file-viewer-renderers' {
137
+ import type { FileViewerRendererPlugin } from '@file-viewer/core'
138
+ export const configuredFileViewerRenderers: FileViewerRendererPlugin[]
139
+ const renderers: FileViewerRendererPlugin[]
140
+ export default renderers
141
+ }
142
+ ```
143
+
144
+ ### D4. 图片压缩
145
+
146
+ `src/utils/imageCompression.ts` 已支持未装包时 Canvas 降级;装 `browser-image-compression` 后动态加载,**通常无需改该文件**。
147
+
148
+ ```ts
149
+ import { ReFileViewer } from '@/components/ReFileViewer'
150
+ ```
151
+
152
+ 样板见 `file-management.md`。
153
+
154
+ ---
155
+
156
+ ## E. form-advanced(ReCheckCard)
157
+
158
+ ```bash
159
+ pnpm add plus-pro-components@0.1.31
160
+ # 常一起:
161
+ pnpm add address-parse@1.2.19
162
+ ```
163
+
164
+ | 文件 | 动作 |
165
+ |------|------|
166
+ | `tsconfig.json` | 删:`src/components/ReCheckCard/**`(`address-parse` 无 exclude) |
167
+
168
+ ```ts
169
+ import { ReCheckCard } from '@/components/ReCheckCard'
170
+ ```
171
+
172
+ ---
173
+
174
+ ## F. qrcode-barcode
175
+
176
+ ```bash
177
+ pnpm add qrcode@1.5.4 jsbarcode@3.12.3
178
+ pnpm add -D @types/qrcode@1.5.6
179
+ ```
180
+
181
+ | 文件 | 动作 |
182
+ |------|------|
183
+ | `tsconfig.json` | 删:`ReQrcode/**`、`ReBarcode/**` |
184
+ | `build/optimize.ts` | 可选:`'qrcode'`、`'jsbarcode'` |
185
+
186
+ ```ts
187
+ import { ReQrcode } from '@/components/ReQrcode'
188
+ import { ReBarcode } from '@/components/ReBarcode'
189
+ ```
190
+
191
+ ---
192
+
193
+ ## G. feedback-ui(ReTypeit)
194
+
195
+ ```bash
196
+ pnpm add typeit@8.8.7
197
+ ```
198
+
199
+ | 文件 | 动作 |
200
+ |------|------|
201
+ | `tsconfig.json` | 删:`src/components/ReTypeit/**` |
202
+ | `build/optimize.ts` | 可选:`'typeit'` |
203
+
204
+ ```ts
205
+ import { ReTypeit } from '@/components/ReTypeit'
206
+ ```
207
+
208
+ ---
209
+
210
+ ## H. verify-captcha(ReVerify)
211
+
212
+ ```bash
213
+ pnpm add vue3-puzzle-vcode@1.1.7
214
+ ```
215
+
216
+ | 文件 | 动作 |
217
+ |------|------|
218
+ | `tsconfig.json` | 删:`src/components/ReVerify/**` |
219
+
220
+ `ReDragVerify` / `ReImageVerify` / `ReSmsCode` 自研,无需此包。
221
+
222
+ ```ts
223
+ import { ReVerify } from '@/components/ReVerify'
224
+ ```
225
+
226
+ ---
227
+
228
+ ## I. wechat-js
229
+
230
+ ```bash
231
+ pnpm add weixin-js-sdk@1.6.5
232
+ ```
233
+
234
+ | 文件 | 动作 |
235
+ |------|------|
236
+ | `tsconfig.json` | 删:`src/utils/wechat/**`、`src/hooks/useWechat.ts`、`src/api/wechat/**` |
237
+
238
+ ```ts
239
+ import { useWechat } from '@/hooks/useWechat'
240
+ ```
241
+
242
+ 源码已在仓库。样板见 `wechat-js.md`。
243
+
244
+ ---
245
+
246
+ ## J. mobile-h5(Vant)— 改动最多
247
+
248
+ 完整步骤与片段亦见 **`mobile-h5.md`「精简模板启用清单」**;本节为权威代码副本。
249
+
250
+ ```bash
251
+ pnpm add vant@4.10.0 vconsole@3.15.1
252
+ pnpm add -D @vant/auto-import-resolver@1.3.0 vite-plugin-vconsole@2.1.1
253
+ ```
254
+
255
+ ### J1. `tsconfig.json`
256
+
257
+ 删:`ReSelectVant/**`、`RePopupPicker/**`、`src/utils/vantRules.ts`
258
+
259
+ ### J2. `src/main.ts` — Element Plus 样式后追加
260
+
261
+ ```ts
262
+ import 'vant/lib/index.css'
263
+ import 'vant/es/toast/style'
264
+ import 'vant/es/dialog/style'
265
+ import 'vant/es/notify/style'
266
+ import 'vant/es/image-preview/style'
267
+ ```
268
+
269
+ ### J3. `src/locales/index.ts` — 整文件恢复为
270
+
271
+ ```ts
272
+ import elenLocale from 'element-plus/es/locale/lang/en'
273
+ import elzhLocale from 'element-plus/es/locale/lang/zh-cn'
274
+ import venLocale from 'vant/es/locale/lang/en-US'
275
+ import vzhLocale from 'vant/es/locale/lang/zh-CN'
276
+ import { createI18n } from 'vue-i18n'
277
+ import { getLanguage } from '@/utils/i18n'
278
+ import enLocale from './en-US.json'
279
+ import zhLocale from './zh-Cn.json'
280
+
281
+ const messages = {
282
+ en: {
283
+ ...elenLocale,
284
+ ...venLocale,
285
+ ...enLocale,
286
+ },
287
+ zh: {
288
+ ...elzhLocale,
289
+ ...vzhLocale,
290
+ ...zhLocale,
291
+ },
292
+ }
293
+
294
+ export const i18n = createI18n({
295
+ legacy: false,
296
+ locale: getLanguage(),
297
+ fallbackLocale: 'zh',
298
+ messages,
299
+ globalInjection: true,
300
+ })
301
+
302
+ export const $t: typeof i18n.global.t = i18n.global.t
303
+ export default i18n
304
+ ```
305
+
306
+ ### J4. `src/styles/index.scss`
307
+
308
+ `src/styles/vant.scss` 已存在。在 `@use 'dark';` 后加:
309
+
310
+ ```scss
311
+ @use 'vant';
312
+ ```
313
+
314
+ ### J5. `build/plugins/AutoImportComponents.ts` — 整文件
315
+
316
+ ```ts
317
+ import type { Plugin } from 'vite'
318
+ import { VantResolver } from '@vant/auto-import-resolver'
319
+ import AutoImport from 'unplugin-auto-import/vite'
320
+ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
321
+ import Components from 'unplugin-vue-components/vite'
322
+
323
+ export function AutoComponentsPlugin(): Plugin[] {
324
+ const plugins: Plugin[] = []
325
+
326
+ const autoImportPlugin = AutoImport({
327
+ resolvers: [ElementPlusResolver({ importStyle: false }), VantResolver()],
328
+ include: [/\.[tj]sx?$/, /\.vue$/, /\.vue?$/],
329
+ dts: './types/auto-imports.d.ts',
330
+ imports: [
331
+ 'vue',
332
+ 'vue-router',
333
+ 'pinia',
334
+ '@vueuse/core',
335
+ { axios: [['default', 'axios']] },
336
+ ],
337
+ eslintrc: { enabled: false },
338
+ })
339
+ plugins.push(...(Array.isArray(autoImportPlugin) ? autoImportPlugin : [autoImportPlugin]))
340
+
341
+ const componentsPlugin = Components({
342
+ resolvers: [ElementPlusResolver({ importStyle: false }), VantResolver()],
343
+ dts: './types/components.d.ts',
344
+ })
345
+ plugins.push(...(Array.isArray(componentsPlugin) ? componentsPlugin : [componentsPlugin]))
346
+
347
+ return plugins
348
+ }
349
+ ```
350
+
351
+ ### J6. `build/plugins/Vconsole.ts` — 替换占位
352
+
353
+ ```ts
354
+ import path from 'node:path'
355
+ import { viteVConsole } from 'vite-plugin-vconsole'
356
+
357
+ export function createViteVConsole() {
358
+ return viteVConsole({
359
+ entry: [path.resolve('src/main.ts')],
360
+ enabled: true,
361
+ config: {
362
+ maxLogNumber: 1000,
363
+ theme: 'light',
364
+ },
365
+ })
366
+ }
367
+ ```
368
+
369
+ `build/plugins/index.ts` 已有 `VITE_VCONSOLE` 开关,一般不用改。`.env.development`:`VITE_VCONSOLE = true`。
370
+
371
+ ### J7. `build/optimize.ts` — include 追加
372
+
373
+ ```ts
374
+ 'vant/es',
375
+ 'vant/es/locale/lang/zh-CN',
376
+ 'vant/es/locale/lang/en-US',
377
+ ```
378
+
379
+ ### J8. 业务资产
380
+
381
+ | 资产 | 路径 |
382
+ |------|------|
383
+ | `ReSelectVant` | `src/components/ReSelectVant` |
384
+ | `RePopupPicker` | `src/components/RePopupPicker` |
385
+ | `vantRules` | `src/utils/vantRules.ts` |
386
+ | 移动路由 | `src/router/mobileModules/**` |
387
+
388
+ 页面样板见 `mobile-h5.md`。
389
+
390
+ ---
391
+
392
+ ## K. 出厂未装、无 exclude 的 addon
393
+
394
+ 通常**只装包 + 业务代码**(见各模块 md / inventory 第九节):
395
+
396
+ | 模块 | 命令摘要 |
397
+ |------|----------|
398
+ | `table-vxe` | `vxe-table@4.19.21` `vxe-pc-ui@4.15.19` |
399
+ | `graph-relation` | `relation-graph-vue3@2.2.11` |
400
+ | `workflow-bpmn` | `bpmn-js@18.19.0` |
401
+ | `flowchart-g6` | `@antv/g6@5.1.1` `g6-extension-vue@0.1.0` |
402
+ | `data-mapping` | `jsplumb@2.15.6` |
403
+ | `data-screen` | `grid-layout-plus@1.1.1` |
404
+ | `particles` | `@tsparticles/slim@4.3.1` `@tsparticles/vue3@4.3.1` + `main.ts` 注册(见 `particles.md`) |
405
+
406
+ ---
407
+
408
+ ## L. AI 变更说明模板
409
+
410
+ ```text
411
+ 已启用 <模块>:
412
+ - 安装:…
413
+ - tsconfig exclude 已移除:…
414
+ - 已改文件:…
415
+ - type-check:通过 | 失败原因
416
+ ```
417
+
418
+ 装了包却仍 exclude 对应路径 → `code-quality` **硬失败**。
@@ -9,7 +9,7 @@ tags: [api, backend, integration, contract, http, checklist, mock]
9
9
 
10
10
  写法与示例 → **`http-api`**。本文件只做联调核对。权威源:`types/global.d.ts`、`src/utils/http.ts`、`src/api/**`、`mock/**`、`useTableSearch`。
11
11
 
12
- **抗略读**:联调阶段仍须核对「下载是否带 blob」「分页字段是否 content/totalCount」;契约不过 = API 未完成,禁止只靠 lint 放行。
12
+ **完整性守则**:联调阶段仍须核对「下载是否带 blob」「分页字段是否 content/totalCount」;契约不过 = API 未完成,禁止只靠 lint 放行。
13
13
 
14
14
  ## 基本信息
15
15
 
@@ -17,6 +17,8 @@ tags: [echarts, ReEchart, chart, wordcloud]
17
17
  | `echarts` | `6.1.0` | 图表必装 |
18
18
  | `echarts-wordcloud` | `2.1.0` | 仅词云 |
19
19
 
20
+ 安装后从 `tsconfig.json` 的 `exclude` 移除 `src/components/ReEchart/**`,并按 **`addon-enable.md` 章节 B** 完成配置恢复,再引用 `ReEchart`。
21
+
20
22
  ```bash
21
23
  pnpm add echarts@6.1.0
22
24
  # 词云时追加:
@@ -30,7 +30,7 @@ tags: [code-review, quality, checklist, lint, typescript, vue3, security, perfor
30
30
 
31
31
  ## 硬失败(对照落盘文件;命中即未通过)
32
32
 
33
- lint / type-check **过了也不能放过**下列项。发现即改代码,禁止「已知问题后续再说」。
33
+ lint / type-check **过了也不能放过**下列项。发现即改代码,禁止搁置已知问题。
34
34
 
35
35
  | 触发条件(改动里出现) | 未通过条件 | 正确做法 |
36
36
  |------------------------|------------|----------|
@@ -45,16 +45,17 @@ lint / type-check **过了也不能放过**下列项。发现即改代码,禁
45
45
  | 按钮权限需求 | 裸 `v-if` 角色判断,未用 `v-auth`/`ReAuth` | `permission-auth` |
46
46
  | 新菜单路由 | 父级无 `icon` 或业务页二次挂 `Layout` | `icons` + `core-kernel` |
47
47
  | 列表查询区 `el-form` / 查询按钮 | 写了 `size="small"`(紧凑主题用户未要求) | 不写 size,用 default=`--control-height` |
48
+ | 本轮新增 addon 并引用对应 `Re*` / Vant / 微信 | 已装包但 `tsconfig exclude` 仍含该路径,或 `addon-enable` 要求的 build/src 未改 | 按 **`addon-enable.md`** 对应章节恢复后重跑 type-check |
48
49
 
49
50
  ## 选型与硬约束
50
51
 
51
- - [ ] 已读 `core-kernel`;addon/缺依赖时已读 `project-inventory`
52
+ - [ ] 已读 `core-kernel`;addon/缺依赖时已读 `project-inventory` + **`addon-enable`**
52
53
  - [ ] 复用已有 Re* / Hook / utils;选型库未擅自替换;新依赖已待确认
53
- - [ ] addon 缺包按 inventory 第九节精确版本(禁止 `@latest`)
54
+ - [ ] addon 缺包按 inventory 第九节精确版本(禁止 `@latest`);装包后已按 **`addon-enable`** 恢复配置与 `tsconfig exclude`
54
55
  - [ ] 列表方法名 `onSearch` / `reset`;HTTP 用 `@/utils/http` + `Result<T>`
55
56
  - [ ] 业务路由未二次挂 Layout
56
57
  - [ ] 独立详情:对照路由文件确认 `showLink:false` + `activePath` + `keepAlive`/`moreTags`(默认)+ `toDetail` + `initToDetail`
57
- - [ ] 列表布局按 `crud-pages` 黄金样板(`el-card.vts-page-card`+`content`、无 `100vh` 减顶栏、`tableHeight`、`otherRef`、分页在 ReTableBar 内;内容区无外层滚动条)
58
+ - [ ] 列表布局按 `crud-pages` 标准样板(`el-card.vts-page-card`+`content`、无 `100vh` 减顶栏、`tableHeight`、`otherRef`、分页在 ReTableBar 内;内容区无外层滚动条)
58
59
  - [ ] 顶栏高度仅 `--header-height` 等 CSS 令牌;禁止 JS 测顶栏 / `platform-config` 顶栏像素字段 / `useApp` 导出顶栏高度
59
60
 
60
61
  ## TypeScript
@@ -105,14 +106,14 @@ lint / type-check **过了也不能放过**下列项。发现即改代码,禁
105
106
  - [ ] 冲突清单已逐条处理(见 `design-system`)
106
107
  - [ ] 有上游设计产出时已读 `design-handoff`:JSON 优先;**原子步骤**含 `Theme=default`(深色侧栏)+ `--sidebar-*` + **`Version++`** + 主色阶;禁止只改 EpThemeColor;错误色 `#F5222D`
107
108
  - [ ] **无**设计落地时未改出厂主色 / ShowModel / 壳层 / 弹窗几何默认
108
- - [ ] 组件尺寸三档已落地并桥接 `--el-component-size*`;缺档落到 default;未全局强制 `size="small"`;**查询区不写 size**(三档对照表 ≠ 查询区要用 small)
109
+ - [ ] 组件尺寸三档已落地并桥接 `--el-component-size*`;缺档回退至 default;未全局强制 `size="small"`;**查询区不写 size**(三档对照表 ≠ 查询区要用 small)
109
110
 
110
111
  ## 业务
111
112
 
112
113
  - [ ] 提交前 `validate()`;删除有确认;提交有 loading;列表有 `v-loading`
113
114
  - [ ] 编辑回显正确(`Object.assign`);分页切换会拉数
114
115
 
115
- ### 列表→详情(改动含 toDetail / *Detail 路由时强制,禁止 N/A 糊弄)
116
+ ### 列表→详情(改动含 toDetail / *Detail 路由时强制,禁止以 N/A 跳过)
116
117
 
117
118
  - [ ] **打开落盘路由文件**核对:兄弟绝对 path;`showLink:false`;`activePath`=列表 path;非空 `title`;默认 `keepAlive`+`moreTags`
118
119
  - [ ] 仅 `toDetail`;详情 `initToDetail`;`name` 对齐;`toDetail` 第 3 参 title 可辨识