# 前端约定 ## 优先参考的代码来源 - `ruoyi-modules/ruoyi-gen/src/main/resources/vm/ts/*.vm` - `ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/*.vm` - 前端工程中与目标模块最接近的现有页面 如果任务涉及前端,先看仓库里实际使用的前端目录和同类页面,不要直接套通用 Vue 习惯。 ## API 文件规则 - 从 `@/utils/request` 引入 `request`。 - 从 `axios` 引入 `AxiosPromise`。 - 从 `@/api///types` 引入本模块类型。 - 列表接口通常返回 `AxiosPromise>`。 - 常规接口命名和路由保持: `listXxx` -> `GET ///list` `getXxx` -> `GET ///{id}` `addXxx` -> `POST //` `updateXxx` -> `PUT //` `delXxx` -> `DELETE ///{id or ids}` ## 类型文件规则 - 定义 `VO`、`Form`、`Query`。 - `Form` 通常继承 `BaseEntity`。 - 非树表页面的 `Query` 通常继承 `PageQuery`。 - 各类 ID 字段通常用 `string | number`。 - Java 数值类型通常映射为 `number`。 - Boolean 映射为 `boolean`。 - 其他生成字段默认多为 `string`。 - 存在日期范围查询时保留 `params?: any`。 ## Vue 页面规则 - 使用 `