@qilitt-mickey/vue3-temp-skill 1.1.19 → 1.1.21

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
@@ -25,7 +25,10 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
25
25
  ## 模版约定
26
26
 
27
27
  - 面向由 **vue3-web-temp** 脚手架搭出的业务项目(目录名/安装路径因人而异,以当前工作区为准)
28
- - 业务写法以本包 `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`)以**当前项目**已有实现为准
29
32
  - **双轨**:无设计 handoff → 保持模版出厂;有设计落地 → 读 `design-handoff.md` **原子步骤**(`Theme`/`Version`/令牌整组,禁止只改主色)
30
33
 
31
34
  ## 使用方式
@@ -41,7 +44,7 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
41
44
  3. 按命中模块内**标准样板**整段编写(禁止只抄 API 签名、丢掉 meta/配套段落)
42
45
  4. 无对应能力 → 标注「待确认」,未经同意不引入新依赖
43
46
  5. 权威性优先级:`仓库已有封装` > `本 Skill 示例` > 通用 Vue 习惯
44
- 6. 命中 addon / 缺依赖时再读 `project-inventory.md` 第九节;精确版本安装,禁止 `@latest`
47
+ 6. 命中 addon / 缺依赖:读 `project-inventory` 第九/十节 + **`addon-enable.md`**(逐文件恢复代码);精确版本安装,禁止 `@latest`
45
48
 
46
49
  ## 完整性守则(全模块强制)
47
50
 
@@ -65,6 +68,7 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
65
68
  | 时机 | 文件 |
66
69
  |------|------|
67
70
  | addon / 查 Re* 名 / 装依赖 | `references/project-inventory.md` |
71
+ | **启用精简模板已删的 addon(装包 + 改配置)** | `references/addon-enable.md`(与功能模块同读) |
68
72
  | 写完代码后(闸门,非功能命中) | `references/code-quality.md` |
69
73
  | 设计交接块 / **design-handoff/v1 JSON** / 上游令牌产出落地 | `references/design-handoff.md`(+ `design-system`) |
70
74
 
@@ -117,8 +121,9 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
117
121
  1. 单模块 → 该模块 + `core-kernel`;结束后执行 `code-quality`
118
122
  2. 多模块 → 同时加载(例:客户列表 = `crud-pages` + `permission-auth` + `http-api`)
119
123
  3. 未命中模块 → 仅 `core-kernel`,向用户确认是否专项
120
- 4. 默认不改 `vite.config.ts` / `build/**`
124
+ 4. 默认不改 `vite.config.ts` / `build/**`;**例外**:按 `addon-enable.md` 恢复 FileViewer / VantResolver / Vconsole 等占位插件时允许改 `build/plugins/*`
121
125
  5. 效果匹配:
126
+ - 启用 echarts / vant / file-viewer / 富文本等已删 addon → 功能模块 + **`addon-enable`**
122
127
  - 弹窗 → `form-advanced`
123
128
  - 点一下复制 → `directives-advanced`(`v-copy`)
124
129
  - 标题字跟着宽度变小 → `directives-advanced`(`v-auto-font`)
@@ -142,22 +147,22 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
142
147
  ## 工作流
143
148
 
144
149
  1. **需求分析**:列出功能模块 ID(不含 `code-quality`)
145
- 2. **加载**:`core-kernel` + 命中模块;addon 时加读 `project-inventory`;设计规范/交接产出时加读 `design-handoff` 并执行 design-system Step 0(与业务的先后按需求)
146
- 3. **依赖**:缺包按 inventory 第九节精确版本,确认后再装
150
+ 2. **加载**:`core-kernel` + 命中模块;addon/缺包时加读 `project-inventory` + **`addon-enable`**;设计规范/交接产出时加读 `design-handoff`
151
+ 3. **依赖**:缺包按 inventory 第九节精确版本,确认后安装;**再按 `addon-enable` 对应章节改配置**
147
152
  4. **探查**:复用仓库 `Re*` / Hook / utils
148
153
  5. **生成**:可运行代码落盘
149
- 6. **code-quality**:按 `references/code-quality.md` 执行(重读清单 → 对照改动 → `pnpm lint:fix` + `pnpm type-check` → 修正 → 结果块)
150
- 7. **输出**:变更说明 + 待确认项
154
+ 6. **code-quality**:按 `references/code-quality.md` 执行
155
+ 7. **输出**:变更说明(含已改配置文件列表)+ 待确认项
151
156
 
152
157
  ### 最终回复结构
153
158
 
154
159
  ```markdown
155
160
  ## 命中模块
156
- - <功能模块…>
161
+ - <功能模块…>(缺包时含 addon-enable)
157
162
 
158
163
  ## 代码质量审查
159
164
  - 闸门:已执行 code-quality(生成后)
160
- - 清单:选型 / 类型 / 组件 / API / 安全 / 业务 / 列表→详情(如适用) / 列表布局(如适用) / 风格 → 通过 | 已修正:…
165
+ - 清单:选型 / 类型 / 组件 / API / 安全 / 业务 / 列表→详情(如适用) / 列表布局(如适用) / 风格 / addon启用(如适用) → 通过 | 已修正:…
161
166
  - 硬失败:无 | 已拦截并修正:…
162
167
  - 命令:`pnpm lint:fix` → …;`pnpm type-check` → …
163
168
  - 待确认:…
@@ -168,4 +173,4 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
168
173
 
169
174
  ## 文件索引
170
175
 
171
- `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.19",
3
+ "version": "1.1.21",
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` **硬失败**。
@@ -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
  # 词云时追加:
@@ -45,12 +45,13 @@ 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`
@@ -125,13 +125,25 @@ export function getCustomerList(data: CustomerQuery, url: string) {
125
125
 
126
126
  ### 独立功能页容器
127
127
 
128
- 定高且内部滚动(与列表卡同类场景)——优先 `el-card.vts-page-card`;非 Card 根节点用 `vts-page-fill`:
128
+ 页面容器分两类,**禁止混用**:
129
+
130
+ | 场景 | 根节点 | 滚动落点 |
131
+ |------|--------|----------|
132
+ | 查询列表 | `el-card.vts-page-card` | 仅表格体内(`tableHeight`) |
133
+ | 长表单 / 详情 / 说明 | `bg-bg_color p-5` + `min-height: 100%` | `.app-main` 内 `el-scrollbar` |
134
+ | 定高画布(地图 / 流程图 / 大屏) | `vts-page-fill` + `h-full` + `overflow-hidden` | **页面内部**自管滚动 |
129
135
 
130
136
  ```vue
137
+ <!-- ✅ 详情 / 长表单(默认) -->
138
+ <div class="bg-bg_color p-5" :style="{ minHeight: '100%' }">
139
+
140
+ <!-- ✅ 定高画布(仅地图/流程图/大屏等) -->
131
141
  <div class="vts-page-fill h-full pos-relative bg-bg_color p-5 overflow-hidden">
142
+
143
+ <!-- ❌ 详情页禁止 vts-page-fill / h-full / overflow-hidden(会裁切且外层滚不动) -->
132
144
  ```
133
145
 
134
- 查询列表定高卡 → `crud-pages`(`el-card.vts-page-card` + `tableHeight`,禁止 `100vh` 减顶栏定高)。
146
+ 查询列表定高卡 → `crud-pages`;详情容器与三件套 `detail-page`。
135
147
  ## 六、资产分层
136
148
 
137
149
  附加 Hook/组件按功能模块加载(WebSocket、微信、附件、图表等)→ 见各专项与 `project-inventory`。
@@ -142,7 +154,8 @@ export function getCustomerList(data: CustomerQuery, url: string) {
142
154
  |----|------|
143
155
  | 包管理 | pnpm;`dev` / `build` / `type-check` / `lint` / `lint:fix` |
144
156
  | 默认插件 | Vue/JSX、AutoImport、SVG、UnoCSS、Mock、Gzip 等 |
145
- | addon | FileViewer `file-management`;vConsole `mobile-h5`;安装见 inventory 第九节 |
157
+ | addon 构建 | FileViewer / vConsole 等在精简模板中为占位;安装后按对应模块恢复 `build/plugins/*` |
158
+ | addon 类型检查 | 未装 addon 时相关路径在 `tsconfig exclude`;**装包后须手动移除**对应项 → 见 `project-inventory` **第十节**(非自动) |
146
159
 
147
160
  非用户要求不改 `vite.config.ts` / `build/**`。
148
161
 
@@ -31,11 +31,11 @@ useTableSearch(formQuery, searchFn, url)
31
31
  |------|------|
32
32
  | 查询列表(定高) | `el-card.vts-page-card`(禁止 `100vh` 减顶栏定高);表格绑 `tableHeight`;仅表格体内滚动;分页在表格下方;整页无外层滚动条 |
33
33
  | 树 + 表分栏 | 同上;左侧树、右侧表共用定高卡,高度仍走 `useTableSearch` 几何实测 |
34
- | 长表单 / 详情 / 说明类 | 根节点 `min-height: 100%`(或 `:style="{ minHeight: '100%' }"`);超出由 `.app-main` 内 `el-scrollbar` 滚动 |
35
- | 非 Card 整页填满 | 根节点加 `class="vts-page-fill"` + `height: 100%` / `h-full` |
34
+ | 长表单 / 详情 / 说明类 | 根节点 `min-height: 100%`(或 `:style="{ minHeight: '100%' }"`);**禁止** `vts-page-fill` / `h-full` / `overflow-hidden`;超出由 `.app-main` 内 `el-scrollbar` 滚动 |
35
+ | 非 Card 整页填满(地图/流程图/大屏) | 根节点加 `class="vts-page-fill"` + `height: 100%` / `h-full`;**仅此类定高场景** |
36
36
  | Card 内边距 | 一律走 `--vts-card-padding`(桥接 `--card-padding`);换规范 / `--vts-margin` 变化由壳层 flex 链 + Hook 自动跟随 |
37
37
 
38
- > **壳层原理**(`lay-content`):`.main-content` 用 `padding: var(--vts-margin)`(不用 margin);定高页 `.main-content:has(.vts-page-card)` / `.vts-page-fill` 为 `height: 100%`;`.vts-page-card` 填满。`html/body/#app/.app-wrapper/.main-container/.app-main` 均为 `height:100%; overflow:hidden`。禁止业务页 `100vh` 减顶栏定高。
38
+ > **壳层原理**(`lay-content`):`.main-content` 用 `padding: var(--vts-margin)`(不用 margin);默认可滚动页 `el-scrollbar__view` / `.grow` 为 `min-height:100%; height:auto`;定高页 `.main-content:has(.vts-page-card|.vts-page-fill)` 为 `height: 100%` 并收回祖先链;`.vts-page-card` 填满。`html/body/#app/.app-wrapper/.main-container/.app-main` 均为 `height:100%; overflow:hidden`。禁止业务页 `100vh` 减顶栏定高。
39
39
 
40
40
  ## 列表标准样板(唯一完整示例)
41
41
 
@@ -377,6 +377,7 @@ async function onSubmit() {
377
377
  | 额外模块不绑 `otherRef` | L8 |
378
378
  | 只写 `toDetail`、详情路由缺 `activePath` | 三件套整段落盘(见 detail-page) |
379
379
  | 裸 `router.push` 开详情 | `toDetail` + meta(见 detail-page) |
380
+ | 详情根节点 `vts-page-fill` / `h-full` / `overflow-hidden` | `min-height: 100%` + `bg-bg_color`;滚动交给壳层 `el-scrollbar`(见 detail-page ④) |
380
381
  | `ReTableOperate :buttons` | `:list` |
381
382
  | 操作列手写多颗 `el-button` / 自造更多菜单 | `ReTableOperate`;过多靠 `limit`(默认 3)进「更多」 |
382
383
  | `@show-collapse` | `@should-show-collapse` |
@@ -58,6 +58,31 @@ const { id, mark } = getParameter as DetailParameter;
58
58
  </script>
59
59
  ```
60
60
 
61
+ ### ④ 详情页容器(滚动约定)
62
+
63
+ 详情 / 编辑 / 查看页是**长内容页**,滚动交给壳层 `.app-main` 内 `el-scrollbar`。**禁止**根节点使用 `vts-page-fill` / `h-full` / `overflow-hidden`(那是定高画布专用)。
64
+
65
+ ```vue
66
+ <template>
67
+ <div
68
+ v-loading.lock="pageLoading"
69
+ class="bg-bg_color p-5"
70
+ :style="{ minHeight: '100%' }"
71
+ >
72
+ <ReHeaderPage />
73
+ <!-- 表单 / 描述 / 版本记录等 -->
74
+ </div>
75
+ </template>
76
+ ```
77
+
78
+ | 禁止 | 原因 |
79
+ |------|------|
80
+ | `class="vts-page-fill"` | 触发定高链,内容被裁切、外层滚不动 |
81
+ | `h-full` + `overflow-hidden` | 把超出内容锁死在视口内 |
82
+ | `el-card.vts-page-card` 包整页长表单 | 列表定高卡专用;详情走外层滚动 |
83
+
84
+ 完整布局原理见 `layout-theme`「内容区高度与滚动」;列表页见 `crud-pages`。
85
+
61
86
  ## 概念
62
87
 
63
88
  | 能力 | 字段 / API | 谁负责 |
@@ -91,3 +116,4 @@ toDetail(name, parameter, title?, model = "query") // model: "query" | "params"
91
116
  2. `showLink: false` + `activePath` + 非空 `title` + 默认 `keepAlive`/`moreTags`
92
117
  3. 列表只用 `toDetail`,禁止裸 `router.push`
93
118
  4. 详情页必调 `initToDetail`;`name` 对齐;参数用 `getParameter`
119
+ 5. 详情根容器:`min-height: 100%` + `bg-bg_color`;**禁止** `vts-page-fill` / `h-full` / `overflow-hidden`
@@ -16,6 +16,8 @@
16
16
  pnpm add typeit@8.8.7
17
17
  ```
18
18
 
19
+ 装包后按 **`addon-enable.md` 章节 G** 移除 `ReTypeit/**` exclude。
20
+
19
21
  ## ReNoticeBar 通知栏
20
22
 
21
23
  ```vue
@@ -18,7 +18,7 @@ pnpm add @file-viewer/core@2.1.14 @file-viewer/vue3@2.1.14 @file-viewer/preset-a
18
18
  pnpm add -D @file-viewer/vite-plugin@2.1.14
19
19
  ```
20
20
 
21
- 先查 `package.json`;完整模板通常已装齐。缺插件接线时恢复 `build/plugins/FileViewer.ts`,勿擅自改 Vite 主配置。三件套必须同版本。
21
+ 先查 `package.json`;**精简模板默认未装**。装包后按 **`addon-enable.md` 章节 D** 恢复:`tsconfig exclude`、`build/plugins/FileViewer.ts`、`types/env.d.ts` 虚拟模块。三件套必须同版本。
22
22
 
23
23
  ## ReAttachment 附件管理
24
24
 
@@ -25,6 +25,8 @@ tags: [form, dialog, ReDialog, ReDialogResize, ReSelectQuery, ReCascader, iconPi
25
25
  pnpm add address-parse@1.2.19 plus-pro-components@0.1.31
26
26
  ```
27
27
 
28
+ 使用 `ReCheckCard` 时按 **`addon-enable.md` 章节 E** 移除 `tsconfig exclude` 中 `ReCheckCard/**`。`address-parse` 无 exclude。
29
+
28
30
  `ReDialog` / `ReDialogResize` / `ReSelectQuery` / `ReCascader` / `ReIconPicker` / `ReAnchor` 为项目封装,**无额外 npm 包**。
29
31
 
30
32
  ## ReSelectQuery(远程搜索下拉)
@@ -367,8 +367,8 @@ $sideBarWidth: var(--sidebar-width, 208px);
367
367
  |------|-------------|----------|
368
368
  | 查询列表 | `el-card.vts-page-card`(无 inline `100vh`);表格绑 `useTableSearch().tableHeight` | 仅 `el-table` 体内;分页在表格下方 |
369
369
  | 树 + 表分栏 | 同上定高卡;左右并排,高度走 Hook 几何实测 | 同查询列表 |
370
- | 非 Card 整页填满 | 根节点 `class="vts-page-fill"` + `height: 100%` / `h-full` | 内部区域自管滚动 |
371
- | 长表单 / 详情 / 说明 | `min-height: 100%`;不绑 `tableHeight` | `.app-main` 内 `el-scrollbar` |
370
+ | 非 Card 整页填满 | 根节点 `class="vts-page-fill"` + `height: 100%` / `h-full` | 内部区域自管滚动;**仅地图/流程图/大屏** |
371
+ | 长表单 / 详情 / 说明 | `min-height: 100%`;**禁止** `vts-page-fill` / `h-full` / `overflow-hidden`;不绑 `tableHeight` | `.app-main` 内 `el-scrollbar` |
372
372
  | Card 内边距 | `--vts-card-padding` → `--card-padding` | 换规范 / `--vts-margin` 只改令牌;列表高度由壳层 + Hook 跟随 |
373
373
 
374
374
  `.vts-page-card`:flex 填满 `.main-content:has(.vts-page-card)`,`overflow: hidden`,`.el-card__body` 高度 100%。样式在 `element-plus.scss` + `lay-content`。
@@ -7,9 +7,9 @@ tags: [vue3, mobile, h5, vant, wechat, miniprogram, responsive, touch]
7
7
 
8
8
  # 移动端 H5 与微信开发规范
9
9
 
10
- > 按本模块与 `wechat-js` 示例编写。
11
- > **构建附属**:`VITE_VCONSOLE` `build/plugins/Vconsole.ts`。
12
- > 微信 JS-SDK 细节优先加载 **`wechat-js`**;本模块侧重 Vant 页面与移动路由。
10
+ > 按本模块与 `wechat-js` 示例编写。
11
+ > 微信 JS-SDK 细节优先加载 **`wechat-js`**;本模块侧重 Vant 页面与移动路由。
12
+ > **精简模板(vue3-web-temp)出厂未装 Vant**:仅 `pnpm add` **不够**,须按下方「启用清单」改配置;**不会自动恢复**,须 AI/人工按本文件逐步落盘。
13
13
 
14
14
  ## 依赖(缺则先装)
15
15
 
@@ -25,7 +25,129 @@ pnpm add vant@4.10.0 vconsole@3.15.1
25
25
  pnpm add -D @vant/auto-import-resolver@1.3.0 vite-plugin-vconsole@2.1.1
26
26
  ```
27
27
 
28
- 核对 AutoImport 中 Vant resolver 与 `build/plugins/Vconsole.ts` 是否仍在;模板已接线则勿改 Vite。微信能力另装 `weixin-js-sdk@1.6.5`(见 wechat-js)。
28
+ 微信能力另装 `weixin-js-sdk@1.6.5`(见 `wechat-js`)。装包后**必须**继续执行下一节启用清单;完整代码副本亦见 **`addon-enable.md` 章节 J**。
29
+
30
+ ---
31
+
32
+ ## 精简模板启用清单(Vant 恢复)
33
+
34
+ > **是否自动?** 否。`pnpm add` 不会改 `main.ts` / `tsconfig` / 插件。
35
+ > **Skill 能否恢复?** 能:AI 命中 `mobile-h5` 后须按本清单**逐文件改回**(用户确认装包后执行),再写业务页。
36
+ > 完成后跑 `pnpm type-check`。
37
+
38
+ ### 0. 依赖(见上)
39
+
40
+ 用户确认后执行安装命令。
41
+
42
+ ### 1. `tsconfig.json` — 移除 exclude
43
+
44
+ 删除下列行(勿删整个 `exclude`):
45
+
46
+ ```json
47
+ "src/components/ReSelectVant/**",
48
+ "src/components/RePopupPicker/**",
49
+ "src/utils/vantRules.ts"
50
+ ```
51
+
52
+ 若同时启用微信,再删:`src/utils/wechat/**`、`src/hooks/useWechat.ts`、`src/api/wechat/**`(见 `wechat-js` / inventory 第十节)。
53
+
54
+ ### 2. `src/main.ts` — 引入 Vant 样式
55
+
56
+ 在 Element Plus 样式之后增加:
57
+
58
+ ```ts
59
+ import 'vant/lib/index.css'
60
+ import 'vant/es/toast/style'
61
+ import 'vant/es/dialog/style'
62
+ import 'vant/es/notify/style'
63
+ import 'vant/es/image-preview/style'
64
+ ```
65
+
66
+ ### 3. `src/locales/index.ts` — 合并 Vant 语言包
67
+
68
+ ```ts
69
+ import elenLocale from 'element-plus/es/locale/lang/en'
70
+ import elzhLocale from 'element-plus/es/locale/lang/zh-cn'
71
+ import venLocale from 'vant/es/locale/lang/en-US'
72
+ import vzhLocale from 'vant/es/locale/lang/zh-CN'
73
+ // ... 其余 import 不变
74
+
75
+ const messages = {
76
+ en: { ...elenLocale, ...venLocale, ...enLocale },
77
+ zh: { ...elzhLocale, ...vzhLocale, ...zhLocale },
78
+ }
79
+ ```
80
+
81
+ ### 4. `src/styles/index.scss` — 挂回 vant 主题覆盖
82
+
83
+ 文件 `src/styles/vant.scss` **仍在仓库**,只需恢复引用:
84
+
85
+ ```scss
86
+ @use 'dark';
87
+ @use 'vant';
88
+ ```
89
+
90
+ ### 5. `build/plugins/AutoImportComponents.ts` — 恢复 VantResolver
91
+
92
+ ```ts
93
+ import { VantResolver } from '@vant/auto-import-resolver'
94
+ import AutoImport from 'unplugin-auto-import/vite'
95
+ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
96
+ import Components from 'unplugin-vue-components/vite'
97
+
98
+ // AutoImport / Components 的 resolvers 均改为:
99
+ resolvers: [ElementPlusResolver({ importStyle: false }), VantResolver()],
100
+ ```
101
+
102
+ ### 6. `build/plugins/Vconsole.ts` — 恢复真实插件
103
+
104
+ 将占位 `return []` 换回:
105
+
106
+ ```ts
107
+ import path from 'node:path'
108
+ import { viteVConsole } from 'vite-plugin-vconsole'
109
+
110
+ export function createViteVConsole() {
111
+ return viteVConsole({
112
+ entry: [path.resolve('src/main.ts')],
113
+ enabled: true,
114
+ config: { maxLogNumber: 1000, theme: 'light' },
115
+ })
116
+ }
117
+ ```
118
+
119
+ 说明:`build/plugins/index.ts` 已有 `if (viteEnv.VITE_VCONSOLE) plugins.push(createViteVConsole())`,一般**不用改**。本地调试在 `.env.development` 设 `VITE_VCONSOLE = true`。
120
+
121
+ ### 7. `build/optimize.ts` — 预构建(建议)
122
+
123
+ 在 `include` 数组中追加(装包后):
124
+
125
+ ```ts
126
+ 'vant/es',
127
+ 'vant/es/locale/lang/zh-CN',
128
+ 'vant/es/locale/lang/en-US',
129
+ ```
130
+
131
+ ### 8. 启用后可用资产
132
+
133
+ | 资产 | 路径 |
134
+ |------|------|
135
+ | `ReSelectVant` | `src/components/ReSelectVant` |
136
+ | `RePopupPicker` | `src/components/RePopupPicker` |
137
+ | `vantRules` | `src/utils/vantRules.ts` |
138
+ | 移动路由扫描 | `src/router/mobileModules/**`(见 `router/index.ts`) |
139
+
140
+ ### AI 变更说明模板
141
+
142
+ ```text
143
+ 已启用 mobile-h5 / Vant:
144
+ - pnpm add vant@4.10.0 vconsole@3.15.1 + -D @vant/auto-import-resolver@1.3.0 vite-plugin-vconsole@2.1.1
145
+ - tsconfig:移除 ReSelectVant / RePopupPicker / vantRules exclude
146
+ - 已改:main.ts、locales/index.ts、styles/index.scss、AutoImportComponents.ts、Vconsole.ts、optimize.ts
147
+ - type-check:…
148
+ ```
149
+
150
+ ---
29
151
 
30
152
  ## 移动端页面结构
31
153
 
@@ -8,6 +8,16 @@
8
8
  - 版本对齐模板 `package.json`(2026-08 冻结);先查业务项目 `package.json`
9
9
  - 缺失 →「九、专项能力依赖安装表」精确版本 `pnpm` 命令,确认后再装;禁止 `@latest` / 无版本号
10
10
 
11
+ ## 精简模板(vue3-web-temp)策略
12
+
13
+ | 层级 | 说明 |
14
+ |------|------|
15
+ | **core** | 已在模板 `package.json`(如 `axios@1.19.0`、`element-plus`、`pinia`) |
16
+ | **addon** | 专项 npm 包**默认不装**;`ReEchart` 等扩展组件源码保留,使用前按**第九节**安装 |
17
+ | **标准样板** | 列表/详情/表单等完整示例在本 Skill `references/`,不在模板 `views/` 堆演示页 |
18
+
19
+ AI 生成业务代码时:以 Skill 模块标准样板为准;先查 `package.json` 是否已有 addon,缺失则先列安装命令征得确认。
20
+
11
21
  ---
12
22
 
13
23
  ## 一、三方库清单(按功能分类)
@@ -71,7 +81,7 @@
71
81
 
72
82
  | 库 | 版本 | scope | 用途 | 备注 |
73
83
  |---|---|---|---|---|
74
- | `axios` | `1.18.1` | core | HTTP | 仅经 `@/utils/http` |
84
+ | `axios` | `1.19.0` | core | HTTP | 仅经 `@/utils/http` |
75
85
  | `crypto-js` | `4.2.0` | core | AES | + `@types/crypto-js@4.2.2` |
76
86
  | `jsencrypt` | `3.5.4` | core | RSA | |
77
87
  | `js-md5` | `0.8.3` | core | MD5 签名 | + `@types/js-md5@0.8.0` |
@@ -340,30 +350,29 @@
340
350
 
341
351
  ## 九、专项能力依赖安装表(addon)
342
352
 
343
- > **何时用**:裁剪过的派生项目、或 `package.json` 中找不到对应包时。
353
+ > **何时用**:精简模板默认**未装** addon;裁剪过的派生项目、或 `package.json` 中找不到对应包时。
344
354
  > **包管理**:统一 `pnpm`。`-D` 表示写入 `devDependencies`。
345
- > **AI 流程**:① 查 `package.json` → ② 列出缺失包 → ③ 展示下方命令并征得确认 → ④ 执行安装 → ⑤ 再写业务代码。
346
- > 完整模板通常已装齐,**不要**重复安装。
355
+ > **AI 流程**:① 查 `package.json` → ② 列出缺失包 → ③ 展示下方命令并征得确认 → ④ 执行安装 → ⑤ **读 `addon-enable.md` 对应章节逐文件改配置**(含第十节 `tsconfig exclude`)→ ⑥ 再写业务代码。
347
356
 
348
357
  | Skill 模块 | 生产依赖(精确版本) | 开发依赖(精确版本) | 构建/接线附属 | 一键安装命令 |
349
358
  |---|---|---|---|---|
350
- | **table-vxe** | `vxe-table@4.19.21` `vxe-pc-ui@4.15.19` | — | `main.ts` 中 vxe 注册(以仓库为准) | `pnpm add vxe-table@4.19.21 vxe-pc-ui@4.15.19` |
351
- | **form-advanced**(地址解析 / CheckCard) | `address-parse@1.2.19` `plus-pro-components@0.1.31` | — | | `pnpm add address-parse@1.2.19 plus-pro-components@0.1.31` |
352
- | **file-management** | `@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` | `@file-viewer/vite-plugin@2.1.14` | `build/plugins/FileViewer.ts`;chunks 大体积 vendor | `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` + `pnpm add -D @file-viewer/vite-plugin@2.1.14` |
353
- | **rich-text** | `@wangeditor/editor@5.1.23` | — | | `pnpm add @wangeditor/editor@5.1.23` |
354
- | **chart-echarts** | `echarts@6.1.0` | — | | `pnpm add echarts@6.1.0` |
355
- | **chart-echarts**(词云) | 上 + `echarts-wordcloud@2.1.0` | — | 业务侧 `import 'echarts-wordcloud'` | `pnpm add echarts@6.1.0 echarts-wordcloud@2.1.0` |
356
- | **data-screen** | `grid-layout-plus@1.1.1`(图表另见 chart-echarts) | — | 大屏缩放按模块示例 | `pnpm add grid-layout-plus@1.1.1` |
357
- | **graph-relation** | `relation-graph-vue3@2.2.11` | — | chunks 拆包(若模板有) | `pnpm add relation-graph-vue3@2.2.11` |
358
- | **workflow-bpmn** | `bpmn-js@18.19.0` | — | Viewer | `pnpm add bpmn-js@18.19.0` |
359
- | **flowchart-g6** | `@antv/g6@5.1.1` `g6-extension-vue@0.1.0` | — | chunks:`antv-g6` / `antv-vendor` | `pnpm add @antv/g6@5.1.1 g6-extension-vue@0.1.0` |
360
- | **data-mapping** | `jsplumb@2.15.6` | — | | `pnpm add jsplumb@2.15.6` |
361
- | **mobile-h5** | `vant@4.10.0` `vconsole@3.15.1` | `@vant/auto-import-resolver@1.3.0` `vite-plugin-vconsole@2.1.1` | `build/plugins/Vconsole.ts`;`VITE_VCONSOLE`;AutoImport Vant resolver | `pnpm add vant@4.10.0 vconsole@3.15.1` + `pnpm add -D @vant/auto-import-resolver@1.3.0 vite-plugin-vconsole@2.1.1` |
362
- | **wechat-js** | `weixin-js-sdk@1.6.5` | — | `utils/wechat` + `useWechat` + `api/wechat` | `pnpm add weixin-js-sdk@1.6.5` |
363
- | **verify-captcha** | `vue3-puzzle-vcode@1.1.7` | — | | `pnpm add vue3-puzzle-vcode@1.1.7` |
364
- | **qrcode-barcode** | `qrcode@1.5.4` `jsbarcode@3.12.3` | `@types/qrcode@1.5.6` | | `pnpm add qrcode@1.5.4 jsbarcode@3.12.3` + `pnpm add -D @types/qrcode@1.5.6` |
365
- | **feedback-ui**(打字机) | `typeit@8.8.7` | — | | `pnpm add typeit@8.8.7` |
366
- | **particles** | `@tsparticles/slim@4.3.1` `@tsparticles/vue3@4.3.1` | — | `main.ts` `Particles` + `loadSlim`;可选 `build/chunks.ts` 的 `tsparticles-vendor` | `pnpm add @tsparticles/slim@4.3.1 @tsparticles/vue3@4.3.1` |
359
+ | **table-vxe** | `vxe-table@4.19.21` `vxe-pc-ui@4.15.19` | — | `main.ts` 中 vxe 注册(以仓库为准);启用细节见 `addon-enable` K | `pnpm add vxe-table@4.19.21 vxe-pc-ui@4.15.19` |
360
+ | **form-advanced**(地址解析 / CheckCard) | `address-parse@1.2.19` `plus-pro-components@0.1.31` | — | **`addon-enable` E** | `pnpm add address-parse@1.2.19 plus-pro-components@0.1.31` |
361
+ | **file-management** | `@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` | `@file-viewer/vite-plugin@2.1.14` | **`addon-enable` D**(FileViewer.ts / env.d.ts) | `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` + `pnpm add -D @file-viewer/vite-plugin@2.1.14` |
362
+ | **rich-text** | `@wangeditor/editor@5.1.23` | — | **`addon-enable` C** | `pnpm add @wangeditor/editor@5.1.23` |
363
+ | **chart-echarts** | `echarts@6.1.0` | — | **`addon-enable` B** | `pnpm add echarts@6.1.0` |
364
+ | **chart-echarts**(词云) | 上 + `echarts-wordcloud@2.1.0` | — | 业务侧 `import 'echarts-wordcloud'`;**`addon-enable` B** | `pnpm add echarts@6.1.0 echarts-wordcloud@2.1.0` |
365
+ | **data-screen** | `grid-layout-plus@1.1.1`(图表另见 chart-echarts) | — | `addon-enable` K | `pnpm add grid-layout-plus@1.1.1` |
366
+ | **graph-relation** | `relation-graph-vue3@2.2.11` | — | `addon-enable` K | `pnpm add relation-graph-vue3@2.2.11` |
367
+ | **workflow-bpmn** | `bpmn-js@18.19.0` | — | `addon-enable` K | `pnpm add bpmn-js@18.19.0` |
368
+ | **flowchart-g6** | `@antv/g6@5.1.1` `g6-extension-vue@0.1.0` | — | `addon-enable` K | `pnpm add @antv/g6@5.1.1 g6-extension-vue@0.1.0` |
369
+ | **data-mapping** | `jsplumb@2.15.6` | — | `addon-enable` K | `pnpm add jsplumb@2.15.6` |
370
+ | **mobile-h5** | `vant@4.10.0` `vconsole@3.15.1` | `@vant/auto-import-resolver@1.3.0` `vite-plugin-vconsole@2.1.1` | **`addon-enable` J** + `mobile-h5` 启用清单 | `pnpm add vant@4.10.0 vconsole@3.15.1` + `pnpm add -D @vant/auto-import-resolver@1.3.0 vite-plugin-vconsole@2.1.1` |
371
+ | **wechat-js** | `weixin-js-sdk@1.6.5` | — | **`addon-enable` I** | `pnpm add weixin-js-sdk@1.6.5` |
372
+ | **verify-captcha** | `vue3-puzzle-vcode@1.1.7` | — | **`addon-enable` H** | `pnpm add vue3-puzzle-vcode@1.1.7` |
373
+ | **qrcode-barcode** | `qrcode@1.5.4` `jsbarcode@3.12.3` | `@types/qrcode@1.5.6` | **`addon-enable` F** | `pnpm add qrcode@1.5.4 jsbarcode@3.12.3` + `pnpm add -D @types/qrcode@1.5.6` |
374
+ | **feedback-ui**(打字机) | `typeit@8.8.7` | — | **`addon-enable` G** | `pnpm add typeit@8.8.7` |
375
+ | **particles** | `@tsparticles/slim@4.3.1` `@tsparticles/vue3@4.3.1` | — | `addon-enable` K + `particles.md` | `pnpm add @tsparticles/slim@4.3.1 @tsparticles/vue3@4.3.1` |
367
376
  | **api-check** / Mock | —(运行时无额外包) | `vite-plugin-fake-server@2.2.4`(core 通常已有) | `build/plugins/ViteMockServe.ts`;`VITE_USE_MOCK` | 缺失时:`pnpm add -D vite-plugin-fake-server@2.2.4` |
368
377
  | **websocket-realtime** / **data-compare** / **seamless-scroll** / **directives-advanced** / **download-export** / **tree-table** | 无额外 npm 包(用项目封装) | — | 见各模块 | 无需安装 |
369
378
 
@@ -380,3 +389,43 @@
380
389
  ```
381
390
 
382
391
  未经用户确认**不得**擅自改 `package.json` 或执行安装。
392
+
393
+ ---
394
+
395
+ ## 十、精简模板 addon 启用清单(`tsconfig exclude`)
396
+
397
+ > **非自动**:`pnpm add` 不会删除 `tsconfig exclude`,也不会改 `main.ts` / 插件。
398
+ > **完整逐文件代码**:见 **`addon-enable.md`**(B–J 章)。本节仅索引。
399
+ > AI 装包后**必须**按 `addon-enable` 改配置,并在变更说明中列出文件。
400
+
401
+ ### 启用步骤(每次命中 addon)
402
+
403
+ 1. 查 `package.json` → 第九节精确版本安装(用户确认)
404
+ 2. 打开 `addon-enable.md` 对应章节,逐文件落盘
405
+ 3. 按下表从 `tsconfig.json` 的 `exclude` **删除**对应行
406
+ 4. `pnpm type-check` → 再写业务代码
407
+
408
+ ### exclude 路径 ↔ Skill 模块 ↔ addon-enable 章节
409
+
410
+ | Skill 模块 | 须移除的 `exclude` 项 | 代码恢复章节 |
411
+ |---|---|---|
412
+ | **chart-echarts** | `src/components/ReEchart/**` | **B** |
413
+ | **rich-text** | `src/components/ReRichText/**` | **C** |
414
+ | **file-management** | `src/components/ReFileViewer/**`、`types/file-viewer.d.ts` | **D** |
415
+ | **form-advanced**(ReCheckCard) | `src/components/ReCheckCard/**` | **E** |
416
+ | **qrcode-barcode** | `ReQrcode/**`、`ReBarcode/**` | **F** |
417
+ | **feedback-ui**(打字机) | `src/components/ReTypeit/**` | **G** |
418
+ | **verify-captcha** | `src/components/ReVerify/**` | **H** |
419
+ | **wechat-js** | `wechat/**`、`useWechat.ts`、`api/wechat/**` | **I** |
420
+ | **mobile-h5** | `ReSelectVant/**`、`RePopupPicker/**`、`vantRules.ts` | **J**(+ `mobile-h5.md`) |
421
+
422
+ `browser-image-compression` 随 **D**;`imageCompression.ts` 未 exclude(可 Canvas 降级)。
423
+
424
+ ### AI 输出示例
425
+
426
+ ```text
427
+ 已启用 chart-echarts(addon-enable B):
428
+ - pnpm add echarts@6.1.0
429
+ - tsconfig:移除 ReEchart/**
430
+ - type-check:通过
431
+ ```
@@ -17,6 +17,8 @@ pnpm add qrcode@1.5.4 jsbarcode@3.12.3
17
17
  pnpm add -D @types/qrcode@1.5.6
18
18
  ```
19
19
 
20
+ 装包后按 **`addon-enable.md` 章节 F** 移除 `ReQrcode/**`、`ReBarcode/**` exclude。
21
+
20
22
  ## 组件选型
21
23
 
22
24
  | 场景 | 组件 | 底层库 |
@@ -14,6 +14,8 @@
14
14
  pnpm add @wangeditor/editor@5.1.23
15
15
  ```
16
16
 
17
+ 装包后按 **`addon-enable.md` 章节 C**:移除 `tsconfig exclude` 中 `ReRichText/**`,再引用组件。
18
+
17
19
  ## 组件
18
20
 
19
21
  使用 `ReRichText` 封装 `@wangeditor/editor`。
@@ -14,6 +14,8 @@
14
14
  pnpm add vue3-puzzle-vcode@1.1.7
15
15
  ```
16
16
 
17
+ 装包后按 **`addon-enable.md` 章节 H** 移除 `ReVerify/**` exclude。
18
+
17
19
  `ReDragVerify` / `ReImageVerify` / `ReSmsCode` 为项目自研,无需额外 npm 包。
18
20
 
19
21
  ## 组件选型
@@ -20,6 +20,8 @@ tags: [wechat, weixin, js-sdk, useWechat]
20
20
  pnpm add weixin-js-sdk@1.6.5
21
21
  ```
22
22
 
23
+ 装包后按 **`addon-enable.md` 章节 I** 移除 wechat 相关 `tsconfig exclude`。
24
+
23
25
  ## 完整示例
24
26
 
25
27
  ```vue