Files
lgp-admin-plus-api/.cursor/rules/Code-Generation.mdc
2026-08-11 09:39:41 +08:00

32 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: 代码生成双端产出与 uniapp C 端三页模板约定
alwaysApply: true
---
# 代码生成(双端前端)
`CodeGenerationService::generate` 一次生成必须包含:
1. **后端**Controller / Service / Model / 路由 / 建表 / PC 菜单
2. **PC 前端 zip**`view/<dash-case>/` → `nl-admin-view/.../views/my-gen/`
3. **uniapp 前端 zip**`uniapp/<dash-case>/` → `nl-admin-uniapp/src/pages-sub/my-gen/<dash-case>/`
模板目录:
- `app/template/view/` — Vben Admin
- `app/template/uniapp/` — 移动超管C 端)
# uniapp 生成物强制
- 兼容 **微信小程序 + App + H5**
- **交互必须是三页**`pages/list.vue` → `pages/detail.vue` → `pages/form.vue`
- 列表点击进详情;新增/编辑用全屏表单;**禁止**底部抽屉做主 CRUD
- **C 端 UI**大留白卡片、DetailHero、InfoGroup、BottomBar、PageForm禁止 PC 宽表
- 复用:`AppCardList` / `AppFilterBar` / `AppSearchBar` / `AppDetailHero` / `AppInfoGroup` / `AppBottomBar` / `AppPageForm`
- `AppFormDrawer` 不得作为生成主路径
- zip 内附带 `PAGES_JSON_SNIPPET.md`(注册 list/detail/form 三页 + features.ts
# 与移动端规则对齐
以 `nl-admin-uniapp` 的 `Code-Standards.mdc` 为准;本仓库生成模板不得与之冲突。