MineAdmin icon indicating copy to clipboard operation
MineAdmin copied to clipboard

Merge master

Open zds-s opened this issue 6 months ago • 1 comments

Summary by CodeRabbit

  • 新功能

    • 新增部门、岗位、数据权限策略等相关后端模型、控制器、服务与数据库迁移,支持部门管理与数据权限策略配置。
    • 部门管理菜单及权限点自动生成,支持前端部门管理功能。
    • 用户、角色支持数据权限策略的创建与更新,前端展示同步支持。
    • 新增全局组件类型声明 MaRemoteSfcLoader。
    • 插件配置新增 loginBefore 钩子,可在登录前处理数据。
  • 功能优化

    • 用户和角色表单支持配置数据权限策略。
    • 部门管理页面优化,按钮权限仅筛选类型为 'B' 的子项。
    • 登录流程支持插件钩子与语言同步设置。
  • 依赖升级

    • 前端依赖库版本升级,新增 inquirer 依赖。
  • 样式优化

    • 多处 el-link 组件 underline 属性由布尔值 false 改为字符串 'never',提升样式一致性。
  • 文档

    • 修正贡献者链接及部分文档链接。
  • 其他

    • Docker Compose 项目名规范化为小写 mineadmin。

zds-s avatar Jun 30 '25 06:06 zds-s

[!CAUTION]

Review failed

The pull request is closed.

📝 Walkthrough

"""

Walkthrough

本次更新引入了部门与岗位管理的完整数据模型、服务、控制器和数据库迁移,增加了数据权限策略(Policy)及其相关校验和序列化支持。同步完善了角色和用户的权限策略关联、前端依赖升级、菜单权限同步、README修正、Swagger文档和登录流程插件钩子等内容。

Changes

文件/分组 变更摘要
app/Http/Admin/Controller/Permission/DepartmentController.php
app/Http/Admin/Request/Permission/DepartmentRequest.php
app/Model/Permission/Department.php
app/Model/Permission/Position.php
app/Repository/Permission/DepartmentRepository.php
app/Service/Permission/DepartmentService.php
app/Schema/DepartmentSchema.php
新增部门与岗位管理的控制器、请求校验、模型、仓库、服务及Swagger Schema。
app/Model/DataPermission/Policy.php
app/Model/Enums/DataPermission/PolicyType.php
app/Schema/PolicySchema.php
新增数据权限策略模型、类型枚举及其Swagger序列化Schema。
app/Model/Permission/Role.php
app/Model/Permission/User.php
app/Schema/RoleSchema.php
app/Schema/UserSchema.php
app/Repository/Permission/RoleRepository.php
app/Repository/Permission/UserRepository.php
app/Service/Permission/RoleService.php
app/Service/Permission/UserService.php
app/Http/Admin/Request/Permission/RoleRequest.php
app/Http/Admin/Request/Permission/UserRequest.php
角色与用户模型、服务、请求校验、仓库、Schema等增加policy关联、校验与序列化,支持数据权限策略。
app/Service/Permission/MenuService.php
web/src/modules/base/views/permission/menu/menu-form.vue
菜单服务与前端表单同步优化按钮权限的增删改逻辑,修正按钮权限筛选。
databases/migrations/2025_02_24_195620_create_department_tables.php 新增部门、岗位、用户-部门、用户-岗位、部门负责人、数据权限策略等6张表的数据库迁移。
databases/seeders/user_dept_20250310.php 新增部门权限相关菜单数据的Seeder。
app/Http/Common/Swagger/Server.php Swagger文档外部链接URL修正。
app/Service/AttachmentService.php 上传文件参数类型由UploadedFile改为UploadedFileInterface,提升兼容性。
docker-compose.yml 项目名由"MineAdmin"小写为"mineadmin"。
README.md
README-en.md
修正贡献者链接URL。
web/package.json 升级@mineadmin/pro-table@mineadmin/searchelement-plus等依赖,新增inquirer依赖,锁定vue-i18n版本。
web/src/components/ma-dialog/index.vue
web/src/plugins/mine-admin/app-store/views/notice.vue
web/src/modules/base/views/log/userLoginLogData/UserLoginLogColumn.tsx
前端el-link组件underline属性由false改为'never',部分刷新操作await化。
web/src/store/modules/useUserStore.ts
web/types/global.d.ts
用户登录流程支持插件钩子loginBefore,登录参数类型扩展,应用设置时同步语言。
web/types/components.d.ts 新增MaRemoteSfcLoader全局组件类型声明。

Sequence Diagram(s)

sequenceDiagram
    participant 用户
    participant Controller
    participant Service
    participant Repository
    participant Model

    用户->>Controller: 提交部门相关请求
    Controller->>Service: 调用业务方法
    Service->>Repository: 查询/操作部门数据
    Repository->>Model: 读写Department/Position等表
    Model-->>Repository: 返回数据
    Repository-->>Service: 返回结果
    Service-->>Controller: 返回处理结果
    Controller-->>用户: 返回API响应
sequenceDiagram
    participant 用户
    participant Controller
    participant Service
    participant Model
    participant PolicyModel

    用户->>Controller: 创建/更新角色或用户(含policy)
    Controller->>Service: create/updateById(data)
    Service->>Model: 创建/更新实体
    Service->>PolicyModel: 创建/更新policy关联
    PolicyModel-->>Service: 返回policy结果
    Service-->>Controller: 返回实体结果
    Controller-->>用户: 返回API响应

Possibly related PRs

Suggested labels

enhancement, size:L

Suggested reviewers

  • kanyxmo
  • People-Sea
  • develop-chen

Poem

兔子挖洞忙,部门岗位新登场,
数据权限策略强,角色用户皆安康。
前后端齐升级,菜单权限细又长,
代码如田园,春风吹又香。
(兔兔比心 🐰💻🌱) """


📜 Recent review details

Configuration used: .coderabbit.yaml Review profile: CHILL Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 420456c2acfbe840808455061d5e0644b46f01ae and dcb182677dfd7981d61e4ece3f10416da56573b0.

📒 Files selected for processing (15)
  • app/Model/Permission/Department.php (1 hunks)
  • app/Schema/PolicySchema.php (1 hunks)
  • app/Service/Permission/RoleService.php (2 hunks)
  • app/Service/Permission/UserService.php (2 hunks)
  • databases/seeders/user_dept_20250310.php (1 hunks)
  • web/src/modules/base/api/department.ts (1 hunks)
  • web/src/modules/base/locales/zh_CN[简体中文].yaml (2 hunks)
  • web/src/modules/base/views/permission/department/data/getFormItems.tsx (1 hunks)
  • web/src/modules/base/views/permission/department/data/getSearchItems.tsx (1 hunks)
  • web/src/modules/base/views/permission/department/data/getTableColumns.tsx (1 hunks)
  • web/src/modules/base/views/permission/department/form.vue (1 hunks)
  • web/src/modules/base/views/permission/department/index.vue (1 hunks)
  • web/src/modules/base/views/permission/department/setLeader.vue (1 hunks)
  • web/src/modules/base/views/permission/menu/index.vue (1 hunks)
  • web/types/components.d.ts (2 hunks)
✨ Finishing Touches
  • [ ] 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or PR title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jun 30 '25 06:06 coderabbitai[bot]