@qilitt-mickey/vue3-temp-skill 1.1.22 → 1.1.23
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/SKILL.md
CHANGED
|
@@ -77,7 +77,7 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
|
|
|
77
77
|
| 模块 | 关键词 |
|
|
78
78
|
|------|--------|
|
|
79
79
|
| **http-api** | 接口、http、加密、API |
|
|
80
|
-
| **crud-pages** | 列表、表格、查询、管理、CRUD
|
|
80
|
+
| **crud-pages** | 列表、表格、查询、管理、CRUD、新增编辑、操作列、行操作 |
|
|
81
81
|
| **detail-page** | 详情、编辑页、查看页、新开路由、toDetail、activePath、showLink、顶部 tag |
|
|
82
82
|
| **data-writeback** | 回显、回填、useFormCheck |
|
|
83
83
|
| **permission-auth** | 权限、v-auth、roles、ReAuth |
|
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@ lint / type-check **过了也不能放过**下列项。发现即改代码,禁
|
|
|
37
37
|
| `toDetail` / 独立 `*Detail` 路由 | 路由无 `activePath`,或 `showLink` 非 `false` | `detail-page` 三件套 |
|
|
38
38
|
| 同上 | 默认场景缺 `keepAlive`/`moreTags`(业务未声明不要缓存) | 样板默认写出;不要缓存再删 |
|
|
39
39
|
| 同上 | 详情页无 `initToDetail`,或 `name` 与路由不一致 | 对齐 `defineOptions` |
|
|
40
|
-
| 列表页 | 无 `el-card.vts-page-card` / `100vh` 减顶栏定高 / 无 `tableHeight` / 分页在 ReTableBar 外 / 操作列手写多按钮未用 `ReTableOperate` | `crud-pages` L1–L9 |
|
|
40
|
+
| 列表页 | 无 `el-card.vts-page-card` / `100vh` 减顶栏定高 / 无 `tableHeight` / 分页在 ReTableBar 外 / 操作列手写多按钮未用 `ReTableOperate` / 操作列写死 `width` 未用 `resolveOperateColumnWidth` / `ReTableOperate` 未传 `:size="size"` | `crud-pages` L1–L9 |
|
|
41
41
|
| `src/api/**` | 绕过 `@/utils/http`,或虚构 `/api` 前缀,或响应当 `success`/`code` | `http-api` |
|
|
42
42
|
| 下载/导出 API | 无 `responseType: "blob"` | `http-api` / `download-export` |
|
|
43
43
|
| 删除/危险操作 | 无确认框 | `feedback-loading` |
|
package/references/crud-pages.md
CHANGED
|
@@ -49,7 +49,7 @@ useTableSearch(formQuery, searchFn, url)
|
|
|
49
49
|
| L6 | 表格绑 `ref="multipleTableRef"` + `tableHeight`;分页在 `ReTableBar` `#default` 内、表格下方 |
|
|
50
50
|
| L7 | `RePagination`:`:pagination` + `@handle-current-change` / `@handle-size-change` |
|
|
51
51
|
| L8 | 查询与表之间的额外模块包一根元素绑 `otherRef`(须在表格上方,高度计入 `tableTop`) |
|
|
52
|
-
| L9 | 表格操作列 `ReTableOperate :list
|
|
52
|
+
| L9 | 表格操作列 **必须** `ReTableOperate :list` + `resolveOperateColumnWidth` + `:size="size"`;用户口述多项操作时按下文「需求→落盘」整段生成,禁止手写 `el-button` / 写死列宽 |
|
|
53
53
|
|
|
54
54
|
```vue
|
|
55
55
|
<script setup lang="ts">
|
|
@@ -312,6 +312,38 @@ resolveOperateColumnWidth({ list: operateButtons, limit: operateLimit, size, slo
|
|
|
312
312
|
|
|
313
313
|
操作列建议 `fixed="right"`。模版已在 `element-plus.scss` 为含 `.re-table-operate` 的单元格关闭省略号,避免列宽不足时出现 `..`。
|
|
314
314
|
|
|
315
|
+
### 需求 → 落盘(强制 · 自动生成清单)
|
|
316
|
+
|
|
317
|
+
用户只要提到「操作列有 A、B、C…」或「行操作:查看 / 编辑 / …」,**禁止追问是否用 ReTableOperate**,直接按本清单整段落盘(与模版 `views/table/base` 一致):
|
|
318
|
+
|
|
319
|
+
1. **解析按钮序列**:按用户口述顺序写入 `operateButtons: OperateButton[]`(顺序固定,勿按行改数组)。
|
|
320
|
+
2. **折叠阈值**:声明 `const operateLimit = 3`(除非用户明确要求其它平铺数);可见数 > `limit` 时组件自动「更多」,业务页勿自造下拉。
|
|
321
|
+
3. **显隐 / 权限**:状态相关写 `show: row => …`;权限写 `auth`;危险操作用 `type: 'danger'`;图标用 `i-ep:*`。
|
|
322
|
+
4. **列宽动态推算**(禁止写死 `width="200"`):
|
|
323
|
+
```ts
|
|
324
|
+
resolveOperateColumnWidth({ list: operateButtons, limit: operateLimit, size })
|
|
325
|
+
```
|
|
326
|
+
5. **密度联动**:在 `ReTableBar` `#default="{ size }"` 内同时传给 `el-table`、`ReTableOperate`、`resolveOperateColumnWidth`。
|
|
327
|
+
6. **模板落点**:
|
|
328
|
+
```vue
|
|
329
|
+
<ReTableOperate
|
|
330
|
+
:list="operateButtons"
|
|
331
|
+
:row="row"
|
|
332
|
+
:index="$index"
|
|
333
|
+
:limit="operateLimit"
|
|
334
|
+
:size="size"
|
|
335
|
+
/>
|
|
336
|
+
```
|
|
337
|
+
7. **回调**:每个 `onClick` 落真实函数(跳详情 / 确认框 / API),禁止只写 `console.log` 占位(演示页除外)。
|
|
338
|
+
|
|
339
|
+
**口述示例 → 生成预期**
|
|
340
|
+
|
|
341
|
+
| 用户口述 | 生成要点 |
|
|
342
|
+
|----------|----------|
|
|
343
|
+
| 操作列有查看、编辑、删除 | 3 项 ≤ limit → 全部平铺,无「更多」;列宽按最长「查看/编辑/删除」推算 |
|
|
344
|
+
| 操作列有填报、查看、催办、审核、快速通过、发起修订 | 固定顺序;`show` 按状态;>3 自动「更多」;列宽按最长「发起修订」推算 |
|
|
345
|
+
| 已完成可发起修订、导出、审核记录 | 至少 4 项可见时平铺「查看\|发起修订\|更多」 |
|
|
346
|
+
|
|
315
347
|
**反例**:
|
|
316
348
|
- 写死 `width="260"` / 不传 `:size="size"` → 与表格密度不一致、切换紧凑/宽松后按钮错位
|
|
317
349
|
- 列宽 `resolveOperateColumnWidth` 未传 `size` 或与组件 `:size` 不一致 → 推算宽度与实渲染不符
|
|
@@ -319,6 +351,7 @@ resolveOperateColumnWidth({ list: operateButtons, limit: operateLimit, size, slo
|
|
|
319
351
|
- 平铺项按内容宽度自然撑开、无等宽槽 → 「发起修订」等比二字项把「更多」挤偏
|
|
320
352
|
- 给「更多」写 `ml-2` 或用 `type="primary" link` → 与 text 按钮档位不一致
|
|
321
353
|
- 按行拼接不同顺序的 `list` → 同名操作无法对应
|
|
354
|
+
- 用户已列多项操作仍手写 `el-button` 或省略 `resolveOperateColumnWidth` → 违反 L9
|
|
322
355
|
|
|
323
356
|
## 列表 → 详情/编辑
|
|
324
357
|
|
|
@@ -432,6 +465,6 @@ async function onSubmit() {
|
|
|
432
465
|
| 裸 `router.push` 开详情 | `toDetail` + meta(见 detail-page) |
|
|
433
466
|
| 详情根节点 `vts-page-fill` / `h-full` / `overflow-hidden` | `min-height: 100%` + `bg-bg_color`;滚动交给壳层 `el-scrollbar`(见 detail-page ④) |
|
|
434
467
|
| `ReTableOperate :buttons` | `:list` |
|
|
435
|
-
| 操作列手写多颗 `el-button` / 自造更多菜单 | `ReTableOperate`;过多靠 `limit`(默认 3)进「更多」 |
|
|
436
|
-
| 「更多」单独 `ml-2` /
|
|
468
|
+
| 操作列手写多颗 `el-button` / 自造更多菜单 / 写死列宽 | `ReTableOperate` + `resolveOperateColumnWidth` + `:size="size"`;过多靠 `limit`(默认 3)进「更多」 |
|
|
469
|
+
| 「更多」单独 `ml-2` / `link` / 隐藏项占位导致空档 | 从左等宽槽 + text 主题色;见上文「对齐 / 需求→落盘」 |
|
|
437
470
|
| `@show-collapse` | `@should-show-collapse` |
|
|
@@ -212,7 +212,7 @@ AI 生成业务代码时:以 Skill 模块标准样板为准;先查 `package.
|
|
|
212
212
|
| **ReSmsCode** | 短信倒计时 | `ReSmsCode/` | `verify-captcha` |
|
|
213
213
|
| **ReSvgIcon** | SVG / Iconify | `ReSvgIcon/` | `icons` |
|
|
214
214
|
| **ReTableBar** | 表格工具栏 | `ReTableBar/` | `crud-pages` |
|
|
215
|
-
| **ReTableOperate** | 行操作(`limit` 默认 3
|
|
215
|
+
| **ReTableOperate** | 行操作(`limit` 默认 3;超出进「更多」;列宽用 `resolveOperateColumnWidth`;`:size` 跟表格密度) | `ReTableOperate/` | `crud-pages` |
|
|
216
216
|
| **ReText** | 文本省略 | `ReText/` | `layout-theme` |
|
|
217
217
|
| **ReTimeLine** | 时间轴 | `ReTimeLine/` | `detail-page` / 业务 |
|
|
218
218
|
| **ReTreeLine** | 树连线 | `ReTreeLine/` | `tree-table` |
|