@qilitt-mickey/vue3-temp-skill 1.0.12 → 1.1.2
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 +66 -214
- package/SKILL.md +165 -527
- package/package.json +2 -2
- package/references/api-check.md +187 -128
- package/references/base-code-dict.md +49 -48
- package/references/chart-echarts.md +61 -0
- package/references/code-quality.md +44 -15
- package/references/core-kernel.md +305 -0
- package/references/crud-pages.md +87 -261
- package/references/data-compare.md +502 -501
- package/references/data-mapping.md +218 -213
- package/references/data-screen.md +94 -79
- package/references/data-writeback.md +104 -104
- package/references/detail-page.md +100 -99
- package/references/directives-advanced.md +27 -4
- package/references/download-export.md +70 -68
- package/references/feedback-loading.md +62 -60
- package/references/feedback-ui.md +125 -111
- package/references/file-management.md +28 -7
- package/references/flowchart-g6.md +249 -244
- package/references/form-advanced.md +264 -26
- package/references/graph-relation.md +12 -7
- package/references/http-api.md +138 -103
- package/references/icons.md +326 -0
- package/references/layout-theme.md +1 -1
- package/references/mobile-h5.md +20 -0
- package/references/particles.md +143 -0
- package/references/permission-auth.md +8 -31
- package/references/project-inventory.md +175 -120
- package/references/qrcode-barcode.md +107 -92
- package/references/rich-text.md +85 -73
- package/references/seamless-scroll.md +40 -38
- package/references/table-vxe.md +114 -0
- package/references/tree-table.md +2 -1
- package/references/ui-components.md +5 -1
- package/references/verify-captcha.md +110 -96
- package/references/websocket-realtime.md +2 -1
- package/references/wechat-js.md +58 -0
- package/references/workflow-bpmn.md +207 -206
- package/references/advanced-ui.md +0 -302
- package/references/build-optim.md +0 -282
- package/references/vue-core.md +0 -209
|
@@ -7,7 +7,22 @@ tags: [code-review, quality, checklist, lint, typescript, vue3, security, perfor
|
|
|
7
7
|
|
|
8
8
|
# 代码质量审查清单
|
|
9
9
|
|
|
10
|
-
>
|
|
10
|
+
> **使用说明**:生成或修改代码后逐项对照。不通过必须修正后再输出。
|
|
11
|
+
> 须按 Skill 模块内示例与本清单审查。
|
|
12
|
+
|
|
13
|
+
## 〇、项目选型(最高优先级)
|
|
14
|
+
|
|
15
|
+
- [ ] 已加载 `core-kernel` + `project-inventory`
|
|
16
|
+
- [ ] 复用已有 Re* / Hook / utils;未另起同能力实现
|
|
17
|
+
- [ ] 选型表指定库未擅自替换;新依赖已标注待确认
|
|
18
|
+
- [ ] 命中 addon 时已核对 `package.json`;缺失包已按第九节**精确版本**安装(或已展示命令并征得确认)
|
|
19
|
+
- [ ] Vite 相关插件(FileViewer / vConsole / Vant resolver / Fake Server)版本与接线文件已核对
|
|
20
|
+
- [ ] 未使用 `@latest` 或不带版本号安装选型表内的库
|
|
21
|
+
- [ ] 列表方法名为 **`onSearch` / `reset`**(不是 handleSearch/handleReset)
|
|
22
|
+
- [ ] HTTP 为 `import { http } from '@/utils/http'` + 全局 `Result<T>`
|
|
23
|
+
- [ ] 业务路由未二次挂 Layout
|
|
24
|
+
- [ ] 使用对应 `references/<模块>.md` 示例与约定写法
|
|
25
|
+
|
|
11
26
|
|
|
12
27
|
## 一、TypeScript 类型检查
|
|
13
28
|
|
|
@@ -49,7 +64,6 @@ function getListApi(params: ListQuery): Promise<Result<ListResult>> {
|
|
|
49
64
|
|
|
50
65
|
- [ ] 使用 `<script setup lang="ts">`,不使用 Options API。
|
|
51
66
|
- [ ] 使用 `defineOptions({ name: "ComponentName" })` 声明组件名。
|
|
52
|
-
- [ ] `script` 标签第一行是 `import type { ... } from "./type"`。
|
|
53
67
|
- [ ] Props 和 Emits 类型定义在同目录 `type.ts` 文件中。
|
|
54
68
|
- [ ] 样式使用 `<style lang="scss" scoped>`。
|
|
55
69
|
- [ ] 组件 class 名使用 `re-` 前缀(自定义组件)或有意义的业务前缀。
|
|
@@ -81,30 +95,44 @@ function increment() { count.value++; }
|
|
|
81
95
|
### 必须通过
|
|
82
96
|
|
|
83
97
|
- [ ] API 调用封装在 `src/api/` 目录的函数中,不在组件中直接写 `http.request`。
|
|
84
|
-
- [ ]
|
|
85
|
-
- [ ]
|
|
86
|
-
- [ ]
|
|
98
|
+
- [ ] 请求方法与后端文档一致(**允许 GET / POST**);POST 用 `data`,GET 用 `params`。
|
|
99
|
+
- [ ] 真实接口 URL 使用 `import.meta.env.VITE_API_BASE_URL` 拼接;未硬编码域名。
|
|
100
|
+
- [ ] 未把 `/mock/...` 或虚构的 `/api/...` 当成前后端标准前缀。
|
|
101
|
+
- [ ] 返回类型为 `Result<T>`(`status` / `statusText` / `data`);分页用 `content` / `totalCount` / `pageNo` / `pageSize`。
|
|
102
|
+
- [ ] 字段命名为驼峰(如 `userName`),与后端一致;`Long` / `BigDecimal` 用 `string`。
|
|
87
103
|
- [ ] 下载请求设置了 `responseType: "blob"`。
|
|
88
|
-
- [ ]
|
|
104
|
+
- [ ] 加解密依赖环境变量 `VITE_ENCODE_SWITCH`(无单请求 `crypto: true`)。
|
|
89
105
|
- [ ] 组件中 API 调用有 `try/finally` 或 `try/catch` 处理异常。
|
|
90
106
|
|
|
91
107
|
### 常见错误示例
|
|
92
108
|
|
|
93
109
|
```typescript
|
|
94
|
-
|
|
110
|
+
import { http } from "@/utils/http";
|
|
111
|
+
|
|
112
|
+
// ❌ 错误:在组件中直接调用 http,且使用虚构 /api 前缀
|
|
95
113
|
const res = await http.request("post", "/api/user/list", { data: params });
|
|
96
114
|
|
|
97
|
-
// ✅ 正确:封装到 api
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
115
|
+
// ✅ 正确:封装到 api/,真实地址走环境变量
|
|
116
|
+
export function getUserListApi(data: CombinedQueryData) {
|
|
117
|
+
return http.request<Result<Data>>(
|
|
118
|
+
"post",
|
|
119
|
+
`${import.meta.env.VITE_API_BASE_URL}/console/user/list`,
|
|
120
|
+
{ data },
|
|
121
|
+
);
|
|
101
122
|
}
|
|
102
123
|
|
|
103
|
-
// ❌
|
|
104
|
-
http.request("
|
|
124
|
+
// ❌ 错误:方法与参数位置错配(POST 却用 params)
|
|
125
|
+
http.request("post", `${import.meta.env.VITE_API_BASE_URL}/console/user/list`, { params });
|
|
126
|
+
|
|
127
|
+
// ✅ 正确:POST → data;后端约定 GET → params(项目允许)
|
|
128
|
+
http.request("post", `${import.meta.env.VITE_API_BASE_URL}/console/user/list`, { data: params });
|
|
129
|
+
http.request("get", `${import.meta.env.VITE_API_BASE_URL}/console/common/downLoadTemplate`, {
|
|
130
|
+
params: { fileName: name },
|
|
131
|
+
responseType: "blob",
|
|
132
|
+
});
|
|
105
133
|
|
|
106
|
-
//
|
|
107
|
-
http.request("post",
|
|
134
|
+
// ❌ 错误:不存在的单请求加密开关
|
|
135
|
+
http.request("post", url, { data: params, crypto: true });
|
|
108
136
|
```
|
|
109
137
|
|
|
110
138
|
## 四、安全规范检查
|
|
@@ -175,6 +203,7 @@ const fullName = computed(() => `${user.firstName} ${user.lastName}`);
|
|
|
175
203
|
- [ ] 样式使用 `scoped`,不会污染全局。
|
|
176
204
|
- [ ] 颜色使用 CSS 变量(`var(--el-color-primary)`),不硬编码。
|
|
177
205
|
- [ ] 优先使用 UnoCSS 原子类(`flex-center`、`mb-4`)。
|
|
206
|
+
- [ ] 业务图标优先 `<svg-icon name="..." />`(本地无冒号 / Iconify 含 `:`);菜单 `meta.icon` 为 string;细则见 `icons`。
|
|
178
207
|
- [ ] 不使用 `!important`,除非覆盖第三方组件样式且有注释说明。
|
|
179
208
|
- [ ] 不使用深层嵌套选择器(不超过 3 层)。
|
|
180
209
|
- [ ] 移动端不使用固定 `px` 宽度,使用 `rem` 或百分比。
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
---
|
|
2
|
+
skill: core-kernel
|
|
3
|
+
description: 始终加载的架构内核。硬约束、应用壳、CRUD 积木、工程摘要、核心/附加资产分层。业务开发前必读;不因「改 Vite/入口」单独命中。
|
|
4
|
+
scope: project
|
|
5
|
+
tags: [vue3, kernel, conventions, layout, router, http, crud, inventory]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# 核心内核(core-kernel)
|
|
9
|
+
|
|
10
|
+
> **始终加载。** 覆盖「中后台默认骨架」。
|
|
11
|
+
> Vite / 包管理 / 入口启动链 **不是**独立 Skill,仅在本文件做只读摘要。
|
|
12
|
+
> 完整库与组件清单见同目录 `project-inventory.md`(一并查阅)。
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 一、硬约束(违反即不合格)
|
|
18
|
+
|
|
19
|
+
| # | 约定 |
|
|
20
|
+
|---|------|
|
|
21
|
+
| 1 | HTTP 只用 `import { http } from '@/utils/http'`,禁止页面内直接 axios/fetch |
|
|
22
|
+
| 2 | 响应类型用全局 **`Result<T>`**(`types/global.d.ts`):常用 `status` / `statusText` / `data` |
|
|
23
|
+
| 3 | 默认 **POST**,参数放 **`data`** |
|
|
24
|
+
| 4 | 列表用 `useTableSearch`,方法名 **`onSearch` / `reset`** |
|
|
25
|
+
| 5 | 业务路由模块 **禁止** 再次 `component: Layout` |
|
|
26
|
+
| 6 | 页面权限 `meta.roles`;按钮 `v-auth` / `ReAuth` |
|
|
27
|
+
| 7 | 环境只用 `import.meta.env.VITE_*`,禁止硬编码域名 |
|
|
28
|
+
| 8 | i18n:`$t('中文key')`,key 即中文文案 |
|
|
29
|
+
| 9 | 禁止用 `v-html` 渲染不可信内容 |
|
|
30
|
+
| 10 | 新三方依赖必须用户确认;已有封装须复用,选型表指定库勿擅自替换 |
|
|
31
|
+
| 11 | addon 缺失时按 `project-inventory` 第九节**精确版本**安装;禁止 `@latest` / 无版本号;Vite 插件与 `build/plugins/*` 成套核对 |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 二、应用壳(架构整体)
|
|
36
|
+
|
|
37
|
+
### 路由
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
// src/router/modules/xxx.ts
|
|
41
|
+
export default {
|
|
42
|
+
path: "/xxx",
|
|
43
|
+
redirect: "/xxx/list",
|
|
44
|
+
meta: { title: "客户管理", icon: "ep:user", rank: 10 }, // 图标约定见 references/icons.md
|
|
45
|
+
children: [
|
|
46
|
+
{
|
|
47
|
+
path: "/xxx/list",
|
|
48
|
+
name: "XxxList",
|
|
49
|
+
component: () => import("@/views/xxx/list/index.vue"),
|
|
50
|
+
meta: { title: "客户列表", roles: ["admin", "common"] },
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
} satisfies RouteConfigsTable;
|
|
54
|
+
// ❌ 不要在业务模块根上再挂 Layout
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 权限
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<el-button v-auth="['admin']">{{ $t('删除') }}</el-button>
|
|
61
|
+
<ReAuth :value="['admin']"><!-- 区域 --></ReAuth>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Store / 多标签 / 主题
|
|
65
|
+
|
|
66
|
+
- 核心 Store:`user` / `app` / `setting` / `theme` / `lang` / `router` / `multiTags` / `baseCode`
|
|
67
|
+
- 详情跳转写标签:`useDetail`(见 `detail-page`)
|
|
68
|
+
- 主题:`useTheme` + `--vts-*` / `--vts-theme-*`(详见 `layout-theme`)
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 三、数据通道
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { http } from "@/utils/http";
|
|
76
|
+
|
|
77
|
+
/** 分页列表 — 可被 useTableSearch 作为 searchFn */
|
|
78
|
+
export function getCustomerList(data: CustomerQuery, url: string) {
|
|
79
|
+
return http.request<Result<CustomerPage>>("post", url, { data });
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** 详情 */
|
|
83
|
+
export function getCustomerDetail(data: { id: string }) {
|
|
84
|
+
return http.request<Result<Customer>>(
|
|
85
|
+
"post",
|
|
86
|
+
`${import.meta.env.VITE_API_BASE_URL}/console/customer/detail`,
|
|
87
|
+
{ data },
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- 方法以后端为准,允许 GET/POST;POST→`data`,GET→`params`。细节见 `http-api` / `api-check`
|
|
93
|
+
- 加解密由 `VITE_ENCODE_SWITCH` 全局控制(**无**单请求 `crypto: true`),细节见 `http-api`
|
|
94
|
+
- 字典:`useApp().baseCodeGet` / `filterValue`,见 `base-code-dict`
|
|
95
|
+
- 提示:`import { message } from '@/utils/message'`
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 四、CRUD 积木(核心组件 / Hook)
|
|
100
|
+
|
|
101
|
+
### 核心 Hook
|
|
102
|
+
|
|
103
|
+
| Hook | 用途 |
|
|
104
|
+
|------|------|
|
|
105
|
+
| `useApp` | headerHeight、字典、svgLoading 等 |
|
|
106
|
+
| `useTableSearch` | 列表查询分页(`onSearch`/`reset`) |
|
|
107
|
+
| `useDetail` | 详情跳转与参数 |
|
|
108
|
+
| `useFormCheck` | 多表单校验聚合 |
|
|
109
|
+
| `useTags` / `useTheme` | 标签 / 主题 |
|
|
110
|
+
|
|
111
|
+
### 核心 Re*(默认应存在于模板)
|
|
112
|
+
|
|
113
|
+
ReAuth、ReDialog、ReGrid、ReGridItem、RePagination、ReTableBar、ReTableOperate、ReHeaderPage、ReSvgIcon(图标细则见 `icons`)、ReText、ReLanguageSwitch、ReSegmented、ReSelectQuery、ReCascader、ReDatePicker、ReDateRangePicker、ReCollapsible
|
|
114
|
+
|
|
115
|
+
> **弹窗写法**:`ReDialog` / `ReDialogResize` 完整示例见 `form-advanced`(关键词「弹窗」即命中),勿业务页直接裸写 `el-dialog`。
|
|
116
|
+
|
|
117
|
+
### 列表黄金样板
|
|
118
|
+
|
|
119
|
+
```vue
|
|
120
|
+
<script setup lang="ts">
|
|
121
|
+
import type { Customer, CustomerQuery } from "@/api/customer";
|
|
122
|
+
import { getCustomerList } from "@/api/customer";
|
|
123
|
+
import { ReGrid } from "@/components/ReGrid";
|
|
124
|
+
import { ReGridItem } from "@/components/ReGridItem";
|
|
125
|
+
import { RePagination } from "@/components/RePagination";
|
|
126
|
+
import { ReTableBar } from "@/components/ReTableBar";
|
|
127
|
+
import { ReTableOperate } from "@/components/ReTableOperate";
|
|
128
|
+
import { useApp } from "@/hooks/useApp";
|
|
129
|
+
import { useTableSearch } from "@/hooks/useTableSearch";
|
|
130
|
+
import { message } from "@/utils/message";
|
|
131
|
+
|
|
132
|
+
defineOptions({ name: "CustomerList" });
|
|
133
|
+
|
|
134
|
+
const { headerHeight, svgLoading } = useApp();
|
|
135
|
+
const formQuery = reactive<CustomerQuery>({ keyword: "", status: undefined });
|
|
136
|
+
|
|
137
|
+
const {
|
|
138
|
+
content,
|
|
139
|
+
tableHeight,
|
|
140
|
+
paginationRef,
|
|
141
|
+
loading,
|
|
142
|
+
formRef,
|
|
143
|
+
multipleTableRef,
|
|
144
|
+
pagination,
|
|
145
|
+
onSearch,
|
|
146
|
+
tableData,
|
|
147
|
+
gridRef,
|
|
148
|
+
showCollapse,
|
|
149
|
+
collapsed,
|
|
150
|
+
collapsedToggle,
|
|
151
|
+
upBold,
|
|
152
|
+
downBold,
|
|
153
|
+
reset,
|
|
154
|
+
} = useTableSearch(
|
|
155
|
+
formQuery,
|
|
156
|
+
getCustomerList,
|
|
157
|
+
`${import.meta.env.VITE_API_BASE_URL}/console/customer/list`,
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
const tableList = computed(() => tableData.value.tableList as Customer[]);
|
|
161
|
+
|
|
162
|
+
onMounted(() => {
|
|
163
|
+
onSearch();
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
function handleDelete(row: Customer) {
|
|
167
|
+
message($t("删除成功"), { type: "success" });
|
|
168
|
+
onSearch();
|
|
169
|
+
}
|
|
170
|
+
</script>
|
|
171
|
+
|
|
172
|
+
<template>
|
|
173
|
+
<div
|
|
174
|
+
ref="content"
|
|
175
|
+
:style="{ minHeight: `calc(100vh - 2 * var(--vts-margin) - ${headerHeight}px)` }"
|
|
176
|
+
class="bg-[var(--el-bg-color)] p-2"
|
|
177
|
+
>
|
|
178
|
+
<el-form ref="formRef" :model="formQuery" @keyup.enter="onSearch">
|
|
179
|
+
<ReGrid ref="gridRef" :collapsed="collapsed" @show-collapse="showCollapse = $event">
|
|
180
|
+
<ReGridItem :index="0">
|
|
181
|
+
<el-form-item :label="$t('关键词')" prop="keyword">
|
|
182
|
+
<el-input v-model="formQuery.keyword" clearable :placeholder="$t('请输入')" />
|
|
183
|
+
</el-form-item>
|
|
184
|
+
</ReGridItem>
|
|
185
|
+
<ReGridItem :index="1">
|
|
186
|
+
<el-form-item :label="$t('状态')" prop="status">
|
|
187
|
+
<el-select v-model="formQuery.status" clearable :placeholder="$t('请选择')">
|
|
188
|
+
<el-option :label="$t('启用')" :value="1" />
|
|
189
|
+
<el-option :label="$t('禁用')" :value="0" />
|
|
190
|
+
</el-select>
|
|
191
|
+
</el-form-item>
|
|
192
|
+
</ReGridItem>
|
|
193
|
+
<ReGridItem :index="99" :collapsed="false">
|
|
194
|
+
<el-form-item>
|
|
195
|
+
<el-button type="primary" :loading="loading" @click="onSearch">{{ $t("查询") }}</el-button>
|
|
196
|
+
<el-button @click="reset()">{{ $t("重置") }}</el-button>
|
|
197
|
+
<el-button
|
|
198
|
+
v-if="showCollapse"
|
|
199
|
+
text
|
|
200
|
+
type="primary"
|
|
201
|
+
@click="collapsedToggle"
|
|
202
|
+
>
|
|
203
|
+
{{ collapsed ? $t("展开") : $t("收起") }}
|
|
204
|
+
<component :is="collapsed ? downBold : upBold" class="ml-1" />
|
|
205
|
+
</el-button>
|
|
206
|
+
</el-form-item>
|
|
207
|
+
</ReGridItem>
|
|
208
|
+
</ReGrid>
|
|
209
|
+
</el-form>
|
|
210
|
+
|
|
211
|
+
<ReTableBar
|
|
212
|
+
:columns="[]"
|
|
213
|
+
@refresh="onSearch"
|
|
214
|
+
>
|
|
215
|
+
<template #buttons>
|
|
216
|
+
<el-button type="primary" v-auth="['admin']">{{ $t("新增") }}</el-button>
|
|
217
|
+
</template>
|
|
218
|
+
</ReTableBar>
|
|
219
|
+
|
|
220
|
+
<el-table
|
|
221
|
+
ref="multipleTableRef"
|
|
222
|
+
v-loading="loading"
|
|
223
|
+
:element-loading-svg="svgLoading"
|
|
224
|
+
:data="tableList"
|
|
225
|
+
:height="tableHeight"
|
|
226
|
+
border
|
|
227
|
+
row-key="id"
|
|
228
|
+
>
|
|
229
|
+
<el-table-column prop="code" :label="$t('编号')" min-width="120" />
|
|
230
|
+
<el-table-column prop="name" :label="$t('名称')" min-width="140" />
|
|
231
|
+
<el-table-column :label="$t('操作')" width="160" fixed="right">
|
|
232
|
+
<template #default="{ row }">
|
|
233
|
+
<ReTableOperate
|
|
234
|
+
:buttons="[
|
|
235
|
+
{ label: $t('编辑'), onClick: () => {} },
|
|
236
|
+
{ label: $t('删除'), type: 'danger', onClick: () => handleDelete(row) },
|
|
237
|
+
]"
|
|
238
|
+
/>
|
|
239
|
+
</template>
|
|
240
|
+
</el-table-column>
|
|
241
|
+
</el-table>
|
|
242
|
+
|
|
243
|
+
<RePagination
|
|
244
|
+
ref="paginationRef"
|
|
245
|
+
v-model:current-page="pagination.currentPage"
|
|
246
|
+
v-model:page-size="pagination.pageSize"
|
|
247
|
+
:total="pagination.total"
|
|
248
|
+
@change="onSearch"
|
|
249
|
+
/>
|
|
250
|
+
</div>
|
|
251
|
+
</template>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
`useTableSearch(formQuery, searchFn, url)`:`searchFn` 签名为 `(query, url) => Promise<Result<T>>`,分页字段为 `pageNo` / `pageSize`,列表数据取 `data.content`,总数 `data.totalCount`。
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 五、资产分层(核心 vs 附加)
|
|
259
|
+
|
|
260
|
+
### 附加 Hook(按功能模块加载,勿塞进每个 CRUD)
|
|
261
|
+
|
|
262
|
+
| Hook | 模块 |
|
|
263
|
+
|------|------|
|
|
264
|
+
| `useWebSocket` | websocket-realtime |
|
|
265
|
+
| `useWechat` | wechat-js / mobile-h5 |
|
|
266
|
+
|
|
267
|
+
### 附加组件(示例)
|
|
268
|
+
|
|
269
|
+
附件/预览、ECharts、富文本、验证码、码、图谱、工作流、移动选择器、反馈展示类等 → 见各专项模块与 `project-inventory.md`。
|
|
270
|
+
|
|
271
|
+
### 附加 Utils
|
|
272
|
+
|
|
273
|
+
`uploadManager` / `imageCompression` → file;`changeSummaryService` → data-compare;`websocket/**` / `wechat/**` / `vantRules` → 对应专项;`particles` / `particlesOptions` → **particles**;`motion` → feedback-ui / 登录页入场动画。
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## 六、工程摘要(只读,非日常生成目标)
|
|
278
|
+
|
|
279
|
+
| 项 | 说明 |
|
|
280
|
+
|----|------|
|
|
281
|
+
| 包管理 | pnpm;脚本 `dev` / `build` / `type-check` / `lint` |
|
|
282
|
+
| 默认插件 | Vue/JSX、AutoImport、SVG、UnoCSS、Favicon、Mock(`VITE_USE_MOCK`)、Gzip、Visualizer、混淆、DevTools |
|
|
283
|
+
| 去 console | `build/build.ts`:非 `VITE_DEBUGGER` 时 Terser `drop_console`(**无** vite-plugin-remove-console) |
|
|
284
|
+
| 功能附属插件 | FileViewer → `file-management`;vConsole → `mobile-h5`;精确版本与 `pnpm` 命令见 `project-inventory` 第九节 |
|
|
285
|
+
| addon 安装 | 裁剪项目缺依赖时:查 `package.json` → 按第九节精确版本征得确认后 `pnpm add` / `pnpm add -D` |
|
|
286
|
+
|
|
287
|
+
除非用户明确要求改构建配置,否则生成业务代码时**不要**改 `vite.config.ts` / `build/**`。
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## 七、环境变量(骨架)
|
|
292
|
+
|
|
293
|
+
`VITE_TITLE` / `VITE_PUBLIC_PATH` / `VITE_USE_MOCK` / `VITE_API_BASE_URL` / `VITE_ENCODE_*` / `VITE_SSO` / `VITE_NO_CUS_LOGO` / `VITE_GZIP` / `VITE_VSUALIZER` / `VITE_BUNDLE_OBFUSCATOR` / `VITE_DEBUGGER`
|
|
294
|
+
|
|
295
|
+
附加:`VITE_WS_URL`、`VITE_VCONSOLE`(随专项模块)。
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## 八、与其它模块的衔接
|
|
300
|
+
|
|
301
|
+
- 写接口细节 → `http-api`
|
|
302
|
+
- 完整 CRUD 变体、表单页 → `crud-pages`
|
|
303
|
+
- 详情跳转 → `detail-page`
|
|
304
|
+
- 主题布局深挖 → `layout-theme`
|
|
305
|
+
- 选型对照与全量组件表 → `project-inventory.md`
|