diff --git a/.codex/skills/frontend-crud-coding/SKILL.md b/.codex/skills/frontend-crud-coding/SKILL.md index 1e23211..79c66da 100644 --- a/.codex/skills/frontend-crud-coding/SKILL.md +++ b/.codex/skills/frontend-crud-coding/SKILL.md @@ -17,10 +17,10 @@ description: 在当前 plus-ui-new 前端项目中按真实 Vue 3 + TypeScript + - 系统复杂页优先看 `src/views/system/user/index.vue`、`system/role`、`system/post`、`system/config`。 - workflow 业务页优先看 `src/views/workflow/*` 同类页面。 4. 新增标准页面前,对照项目内模板确认基础骨架: - - API 模板:`gen/ts/api.ts.vm` - - types 模板:`gen/ts/types.ts.vm` - - 标准单表页模板:`gen/vue/index.vue.vm` - - 树表页模板:`gen/vue/index-tree.vue.vm` + - API 模板:`gen/api.ts.vm` + - types 模板:`gen/types.ts.vm` + - 标准单表页模板:`gen/index.vue.vm` + - 树表页模板:`gen/index-tree.vue.vm` 5. 新增代码时通常同步维护 `src/api///index.ts`、`types.ts`、`src/views///index.vue`。 6. 增强已有页面时只做增量修改,保留原页面的树筛选、导入导出、列显隐、权限、字典、弹窗和路由跳转能力。 7. 修改完成后按影响范围运行验证:优先 `pnpm exec vue-tsc --noEmit`,改动页面或导入时再跑 `pnpm lint`,大范围变更再跑 `pnpm build`。 @@ -85,7 +85,7 @@ description: 在当前 plus-ui-new 前端项目中按真实 Vue 3 + TypeScript + ### 1. 标准单表 CRUD -以 `gen/vue/index.vue.vm`、`gen/ts/*.vm` 和 `src/views/demo/demo/index.vue` 为主要起点,补齐列表、搜索、分页、新增、编辑、删除、导出、权限、类型和验证。 +以 `gen/index.vue.vm`、`gen/api.ts.vm`、`gen/types.ts.vm` 和 `src/views/demo/demo/index.vue` 为主要起点,补齐列表、搜索、分页、新增、编辑、删除、导出、权限、类型和验证。 ### 2. 树表 CRUD diff --git a/.codex/skills/frontend-crud-coding/references/examples.md b/.codex/skills/frontend-crud-coding/references/examples.md index e816f1f..19af145 100644 --- a/.codex/skills/frontend-crud-coding/references/examples.md +++ b/.codex/skills/frontend-crud-coding/references/examples.md @@ -14,7 +14,7 @@ - 先看 `src/api/system/client/*` 和 `src/views/system/client/index.vue` 是否已存在。 - 再看 `src/views/demo/demo/index.vue` 的标准 hooks 版 CRUD 骨架。 -- 对照项目内 `gen/ts/api.ts.vm`、`gen/ts/types.ts.vm`、`gen/vue/index.vue.vm`。 +- 对照项目内 `gen/api.ts.vm`、`gen/types.ts.vm`、`gen/index.vue.vm`。 - 生成或修改 `api/index.ts`、`types.ts`、`views/.../index.vue`。 - 使用 `AxiosPromise` from `@/utils/api-types`、`PageResult` from `@/api/types`、`useLoading`、`useFormDialog`、`useSearchReset`、`useTableSelection`。 diff --git a/.codex/skills/frontend-crud-coding/references/frontend.md b/.codex/skills/frontend-crud-coding/references/frontend.md index 8b4d72d..46dc5f4 100644 --- a/.codex/skills/frontend-crud-coding/references/frontend.md +++ b/.codex/skills/frontend-crud-coding/references/frontend.md @@ -10,10 +10,10 @@ - 监控页:`src/views/monitor/*`、`src/api/monitor/*`。 - 公共 hooks:`src/hooks/async/useLoading.ts`、`src/hooks/dialog/*`、`src/hooks/form/*`、`src/hooks/table/*`、`src/hooks/tree/*`。 - 项目内 generator 模板: - `gen/ts/api.ts.vm` - `gen/ts/types.ts.vm` - `gen/vue/index.vue.vm` - `gen/vue/index-tree.vue.vm` + `gen/api.ts.vm` + `gen/types.ts.vm` + `gen/index.vue.vm` + `gen/index-tree.vue.vm` ## 基础栈与格式 @@ -44,7 +44,7 @@ `changeXxxStatus` -> `PUT ///changeStatus` - query string 用 `params`,请求体用 `data`。 - 加密、防重复提交等 headers 直接写在请求配置里,例如用户重置密码中的 `isEncrypt`、`repeatSubmit`。 -- 当前仓库有些 API 使用 `export const`,有些使用 `export function`;新增标准 CRUD 优先跟随 `gen/ts/api.ts.vm` 和相邻模块。 +- 当前仓库有些 API 使用 `export const`,有些使用 `export function`;新增标准 CRUD 优先跟随 `gen/api.ts.vm` 和相邻模块。 - 只有相邻模块已有 `export default { ... }` 聚合时才新增默认导出。 ## 类型文件规则 @@ -128,8 +128,8 @@ ## 与 gen 模板的关系 - `gen` 是当前前端项目内的生成模板,优先于外部后端工程拷贝的模板。 -- 新增标准单表页面时读取 `gen/vue/index.vue.vm`、`gen/ts/api.ts.vm`、`gen/ts/types.ts.vm`。 -- 新增树表页面时读取 `gen/vue/index-tree.vue.vm`、`gen/ts/api.ts.vm`、`gen/ts/types.ts.vm`。 +- 新增标准单表页面时读取 `gen/index.vue.vm`、`gen/api.ts.vm`、`gen/types.ts.vm`。 +- 新增树表页面时读取 `gen/index-tree.vue.vm`、`gen/api.ts.vm`、`gen/types.ts.vm`。 - `gen` 模板是标准骨架,不是最终答案;落地时仍要对照目标模块真实页面和公共 hooks。 - 当前前端项目已经把生成页升级为 hooks 版:`useLoading`、`useFormDialog`、`useSearchReset`、`useTableSelection`、`useDateRangeQuery`。 - 新增标准 CRUD 时,先从 `gen` 确认字段、权限、导出、状态切换、排序、日期范围等,再落成当前项目的实际页面壳。 diff --git a/gen/ts/api.ts.vm b/gen/api.ts.vm similarity index 100% rename from gen/ts/api.ts.vm rename to gen/api.ts.vm diff --git a/gen/vue/index-tree.vue.vm b/gen/index-tree.vue.vm similarity index 100% rename from gen/vue/index-tree.vue.vm rename to gen/index-tree.vue.vm diff --git a/gen/vue/index.vue.vm b/gen/index.vue.vm similarity index 100% rename from gen/vue/index.vue.vm rename to gen/index.vue.vm diff --git a/gen/ts/types.ts.vm b/gen/types.ts.vm similarity index 100% rename from gen/ts/types.ts.vm rename to gen/types.ts.vm