diff --git a/.cursor/cursorrules-frontend.md b/.cursor/cursorrules-frontend.md index dc73a707..16f524be 100644 --- a/.cursor/cursorrules-frontend.md +++ b/.cursor/cursorrules-frontend.md @@ -531,7 +531,89 @@ const moduleRouter: RouteRecordRaw = { export default moduleRouter; ``` -## 7. 项目架构规范 +## 7. 搜索表单布局规范(强制性) + +### 7.1 设计目标 + +1. **一致性**:所有列表页面的检索栏保持统一外观和交互。 +2. **响应式**:在 1920/1440/1280 等常用分辨率下均能保持整洁布局。 +3. **易维护**:通过统一的栅格 + 样式类,后续页面可快速复用。 + +### 7.2 栅格布局 + +1. 采用 Element Plus `el-row` / `el-col` 栅格系统。 +2. **每行固定 4 个检索元素**,每项 `:span="6"`(24 ÷ 4)。 +3. 若检索项不足 4 个,也应保持占位对齐,避免按钮漂移。 + +```vue + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + +``` + +### 7.3 按钮固定右侧 + +1. 统一在搜索表单尾部添加按钮行。 +2. 使用 `.search-btn-container` 类,将按钮通过 Flex **右对齐**。 + +```scss +/* 搜索按钮容器样式(全局复用,可写在组件 scoped 内部)*/ +.search-btn-container { + display: flex; + justify-content: flex-end; + margin-top: 10px; + + .el-form-item { + margin-bottom: 0 !important; // 清除默认 margin + } +} +``` + +### 7.4 应用示例 + +所有新页面或改造页面 **必须** 遵循以上规范。例如: + +* `hq/pm/repairOrder/index.vue` +* `hq/pm/repairCategory/index.vue` +* `hq/hallAudit/index.vue` +* `hq/hallInfo/index.vue` +* `hq/hallReservation/index.vue` + +### 7.5 代码检查要点 + +1. 检查是否存在 `:inline="true"`,如有应移除。 +2. 确认每行 4 列,使用 `span=6`。 +3. 搜索/重置按钮是否放置在 `.search-btn-container` 内。 +4. scoped 样式内是否包含上述 `.search-btn-container` 定义。 + +遵循此规范,可显著提升列表页检索区域的统一性与用户体验。 + +## 8. 项目架构规范 ### 目录结构 @@ -568,7 +650,7 @@ web/src/ - **工具文件**: camelCase,如 `formatUtils.ts` - **类型文件**: PascalCase,如 `UserTypes.ts` -## 8. 样式开发规范 +## 9. 样式开发规范 ### SCSS 变量使用 @@ -605,7 +687,7 @@ web/src/ ``` -## 9. 性能优化规范 +## 10. 性能优化规范 ### 组件懒加载 @@ -626,7 +708,7 @@ const AsyncComponent = defineAsyncComponent(() => import('@/components/HeavyComp ``` -## 10. 开发最佳实践 +## 11. 开发最佳实践 ### 代码规范 @@ -667,7 +749,7 @@ interface UserForm { const user = data as UserForm; ``` -## 11. 测试规范 +## 12. 测试规范 ### 单元测试 @@ -685,7 +767,7 @@ describe('UserForm', () => { }); ``` -## 12. 构建与部署 +## 13. 构建与部署 ### 环境配置 diff --git a/backend/ruoyi-modules/ruoyi-hq/src/main/java/org/dromara/hq/service/impl/HqPmRepairCategoryServiceImpl.java b/backend/ruoyi-modules/ruoyi-hq/src/main/java/org/dromara/hq/service/impl/HqPmRepairCategoryServiceImpl.java index 10ca6b1a..a7ef0251 100644 --- a/backend/ruoyi-modules/ruoyi-hq/src/main/java/org/dromara/hq/service/impl/HqPmRepairCategoryServiceImpl.java +++ b/backend/ruoyi-modules/ruoyi-hq/src/main/java/org/dromara/hq/service/impl/HqPmRepairCategoryServiceImpl.java @@ -78,7 +78,8 @@ public class HqPmRepairCategoryServiceImpl implements IHqPmRepairCategoryService lqw.orderByAsc(HqPmRepairCategory::getSortOrder).orderByAsc(HqPmRepairCategory::getId); lqw.like(StringUtils.isNotBlank(bo.getCategoryName()), HqPmRepairCategory::getCategoryName, bo.getCategoryName()); - lqw.eq(StringUtils.isNotBlank(bo.getCategoryCode()), HqPmRepairCategory::getCategoryCode, bo.getCategoryCode()); + lqw.like(StringUtils.isNotBlank(bo.getCategoryCode()), HqPmRepairCategory::getCategoryCode, + bo.getCategoryCode()); lqw.like(StringUtils.isNotBlank(bo.getCategoryDescription()), HqPmRepairCategory::getCategoryDescription, bo.getCategoryDescription()); lqw.eq(bo.getParentId() != null, HqPmRepairCategory::getParentId, bo.getParentId()); diff --git a/web/src/api/hq/pm/repairCategory.ts b/web/src/api/hq/pm/repairCategory.ts index 8f4a5aa6..a35a3d2a 100644 --- a/web/src/api/hq/pm/repairCategory.ts +++ b/web/src/api/hq/pm/repairCategory.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { RepairCategoryVO, RepairCategoryForm, RepairCategoryQuery } from '@/api/hq/hq/pm/types'; +import { RepairCategoryVO, RepairCategoryForm, RepairCategoryQuery } from '@/api/hq/pm/types'; /** * 查询维修类型列表 diff --git a/web/src/views/hq/hallAudit/index.vue b/web/src/views/hq/hallAudit/index.vue index 855ce1cb..8e7b5da5 100644 --- a/web/src/views/hq/hallAudit/index.vue +++ b/web/src/views/hq/hallAudit/index.vue @@ -3,31 +3,65 @@
- - - - - - - - - - - - - - - - - - - - - 搜索 - 重置 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + +
@@ -1617,6 +1651,16 @@ onMounted(() => { align-items: center; gap: 4px; } +/* 搜索按钮容器样式 */ +.search-btn-container { + display: flex; + justify-content: flex-end; + margin-top: 10px; + + .el-form-item { + margin-bottom: 0 !important; + } +} diff --git a/web/src/views/hq/hallReservation/index.vue b/web/src/views/hq/hallReservation/index.vue index 70e07195..d53dc8d2 100644 --- a/web/src/views/hq/hallReservation/index.vue +++ b/web/src/views/hq/hallReservation/index.vue @@ -3,28 +3,54 @@
- - - - - - - - - - - - - - - - - - 搜索 - 重置 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + +
@@ -1134,6 +1160,17 @@ onMounted(() => { } /* 页面容器样式 */ + +/* 搜索按钮容器样式 */ +.search-btn-container { + display: flex; + justify-content: flex-end; + margin-top: 10px; + + .el-form-item { + margin-bottom: 0 !important; + } +}