Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
18e466f
feat(migration): create department, position, and user association ta…
zds-s Mar 2, 2025
0c6a843
feat(database): enhance department and position tables with comments …
zds-s Mar 2, 2025
299ec61
feat(model): update DataPermissionPolicy to use PolicyType enum for p…
zds-s Mar 2, 2025
8d19574
feat: refactor DataPermissionPolicy and PolicyType to improve namespa…
zds-s Mar 2, 2025
ccd5355
feat: enhance role and policy management with new schema and properties
zds-s Mar 5, 2025
7a4d7c1
feat: enhance user management with policy handling in requests and se…
zds-s Mar 5, 2025
dc92609
feat: ensure policy deletion on role and user removal
zds-s Mar 5, 2025
8befc9c
feat: add Department management functionality with controller, servic…
zds-s Mar 5, 2025
8f25dd9
Merge branch 'master' into master-department
kanyxmo Mar 10, 2025
7372b18
fix:(data seeder) 修复填充部门菜单数据bug
kanyxmo Mar 10, 2025
d895cc5
feat: 部门管理前端页面.
kanyxmo Mar 10, 2025
55a9a07
fix
zds-s Mar 10, 2025
1ab2925
feat: enhance Department management with transaction handling and val…
zds-s Mar 10, 2025
e49cfd5
feat: update operation IDs in DepartmentController for clarity and co…
zds-s Mar 10, 2025
b6ed70f
feat: 部门管理前端页面. - 2
kanyxmo Mar 10, 2025
8c39632
feat: implement cascading delete for related models on Department del…
zds-s Mar 10, 2025
a52dab9
Merge remote-tracking branch 'origin/master-department' into master-d…
kanyxmo Mar 10, 2025
fe28f9d
styles: remove el-tag border (#557) (#558)
kanyxmo Mar 10, 2025
0675c38
补充岗位模块文件 (#559)
onekb Mar 10, 2025
dbe139e
feat: enhance User and Department models with relationships and valid…
zds-s Mar 10, 2025
d60baff
部门
kanyxmo Mar 10, 2025
c41a31b
feat: implement data permission management with DataScope and related…
zds-s Mar 11, 2025
aea2d49
feat: implement data permission rules and context management with cac…
zds-s Mar 12, 2025
c603c54
部门
kanyxmo Mar 12, 2025
b6e1f60
用户管理适配部门、数据权限功能 - 未完成
kanyxmo Mar 13, 2025
fe8d686
用户管理适配部门、数据权限功能 - 未完成
kanyxmo Mar 14, 2025
1603cc5
feat: add endpoint to retrieve positions by department ID with permis…
zds-s Mar 25, 2025
ed466c9
feat: remove super admin check from getPositionsByDepartmentId method
zds-s Mar 25, 2025
8626340
feat: add positions relationship to department query and remove unuse…
zds-s Mar 25, 2025
67c4f65
Merge branch 'master' into master-department
kanyxmo Mar 26, 2025
10802b8
feat: 完善用户管理模块,新增数据权限设置功能并优化部门管理
kanyxmo Mar 27, 2025
6baf202
feat: 部门下的岗位管理
kanyxmo Mar 28, 2025
d23bd7b
feat: update role to position relationship and add batch data permiss…
zds-s Mar 28, 2025
2606069
feat: add positions and users relationships to Policy model
zds-s Mar 28, 2025
fad0faf
更新
kanyxmo Apr 8, 2025
576611c
部门岗位
kanyxmo Apr 9, 2025
d528dd8
部门岗位
kanyxmo Apr 9, 2025
54b70e8
Merge branch 'master' into master-department
kanyxmo Apr 11, 2025
4fd68e6
部门领导接口
kanyxmo Apr 15, 2025
8b3b4ff
ma-select-table
kanyxmo Apr 17, 2025
a2c5f6d
ma-select-table
kanyxmo Apr 18, 2025
673ea5a
部门负责人
kanyxmo Apr 21, 2025
0bea420
Merge branch 'master' into master-department
kanyxmo Apr 22, 2025
3b33606
up
kanyxmo Apr 23, 2025
d3516cd
fix: 修复部门负责人设置页面显示问题及配置调试模式
kanyxmo Apr 23, 2025
27d6685
feat: 重构部门领导删除逻辑,支持按部门ID和用户ID批量删除
kanyxmo Apr 24, 2025
b586c69
feat: 移除未使用的下载工具函数 downloadFile
kanyxmo Apr 24, 2025
77fad47
Merge branch 'master' into master-department
kanyxmo Apr 24, 2025
d358b0c
feat: 部门查看用户列表
kanyxmo Apr 24, 2025
ab854f6
Merge branch 'master' into master-department
kanyxmo Apr 24, 2025
3b78975
fix: 优化用户权限策略验证结构并移除冗余菜单权限项
kanyxmo Apr 25, 2025
fc683a2
feat: 部门功能分支完成
kanyxmo Apr 25, 2025
46b11fd
fix: UserRequest
kanyxmo Apr 25, 2025
287e823
fix: README.md
kanyxmo Apr 28, 2025
362ec56
chore(deps): 升级 @mineadmin/form 和 @mineadmin/pro-table 依赖版本更新
kanyxmo Apr 28, 2025
7b07024
chore(deps): 升级 @mineadmin/form 和 @mineadmin/pro-table 依赖版本更新
kanyxmo Apr 28, 2025
9cfaf12
chore(deps): 升级 @mineadmin/form 依赖版本至 ^1.0.33
kanyxmo Apr 28, 2025
74bbded
refactor(ma-dict-select): 重构字典选择组件模板结构并升级element-plus至2.9.9
kanyxmo Apr 29, 2025
c5a9f63
feat: 升级依赖
kanyxmo Apr 29, 2025
0e23078
fix: 修复 ma-form 支持 children 配置项后,造成组件默认插槽参数丢失以及 render 函数里 jsx 语法的子组件…
kanyxmo Apr 30, 2025
5e58d1a
fix: 还原 ma-dict-select 组件
kanyxmo Apr 30, 2025
4e92f6b
chore(deps): 升级 @mineadmin/form 依赖版本至 ^1.0.51
kanyxmo Apr 30, 2025
8beb22f
fix: 还原mineadmin/search下的style.css。
kanyxmo May 9, 2025
ae3045d
fix: 更新用户信息时,数据权限值非数组问题
kanyxmo May 14, 2025
f3bfbd4
feat:
kanyxmo May 20, 2025
ecbe81a
fix: 修复子部门未获取岗位数据
kanyxmo May 22, 2025
30deb48
refactor(permission): 重构权限管理模块
zds-s May 23, 2025
4a62512
feat(data-permission): 优化数据权限处理逻辑
zds-s May 24, 2025
c9f41c5
feat(DataPermission): 添加数据权限全局作用域
zds-s May 24, 2025
64e85ea
feat(data-permission): 添加自定义数据权限功能
zds-s May 24, 2025
e753a6d
fix(department):修复部门管理问题 (#612)
westng May 26, 2025
60e0fac
refactor(Permission): 优化部门和服务用户权限处理逻辑
zds-s May 26, 2025
d5f330e
refactor(user): 优化用户策略数据同步逻辑
zds-s May 26, 2025
d066605
refactor(user): 优化用户部门下拉清除和单点删除选择事件对数据的同步清空逻辑
kanyxmo May 26, 2025
7b0e5f3
fix(icons): 修复生成图标命令报缺少`inquirer`库
kanyxmo May 26, 2025
ba2b0c7
Merge branch 'master' into master-department
zds-s May 27, 2025
3217ab0
style(UserService): 优化空值判断逻辑
zds-s May 27, 2025
4148453
refactor(data-permission): 优化数据权限相关代码
zds-s May 27, 2025
3a858b8
feat(user): 点击搜索重置按钮,也清空部门筛选
kanyxmo May 28, 2025
1f816fb
Merge remote-tracking branch 'origin/master-department' into master-d…
kanyxmo May 28, 2025
76f5ba6
fix(login): 修复用户登录后未设置语言标记,造成默认为英文的bug
kanyxmo May 28, 2025
3ea87e2
fix(permission): 修复用户模型与策略关联的错误,并优化数据权限全局作用域的实现
kywrl May 28, 2025
9b191a7
refactor(data-permission): simplify Factory usage in DataScope and re…
zds-s May 28, 2025
ad9ce65
refactor(data-permission): use Arr::get for safer attribute retrieval…
zds-s May 28, 2025
c17fe0c
fix(CreatedByIdsExecute): replace whereIn with where for department I…
zds-s May 29, 2025
69f0294
fix(CreatedByIdsExecute): ensure unique user IDs are returned in exec…
zds-s May 29, 2025
ee8a401
fix(CreatedByIdsExecute): remove unnecessary department list processi…
zds-s May 29, 2025
18bc1a6
feat(CreatedByIdsExecute): add user ID retrieval for department and d…
zds-s May 29, 2025
e644364
refactor: remove final keyword from classes in DataPermission module
zds-s May 29, 2025
fec538b
fix(User): 修复 policy 关系方向错误,改为 hasOne 正确体现一对一关系 (#620)
westng May 31, 2025
00809ed
fix(DeptExecute): ensure department list is correctly updated after m…
zds-s Jun 3, 2025
cd5acf6
Update package.json
kanyxmo Jun 6, 2025
d185edd
fix(department): 岗位更新后页面未刷新问题 (#630)
westng Jun 16, 2025
c921b3c
chore: 更新依赖包版本,包括 @mineadmin/pro-table、@mineadmin/search、element-plus…
kanyxmo Jun 16, 2025
e10ace0
Merge remote-tracking branch 'origin/master-department' into master-d…
kanyxmo Jun 16, 2025
a57e8ca
chore(user): 创建用户返回实体model
kanyxmo Jun 16, 2025
bb501d3
update: 升级 vue-i18n 依赖版本至 11.1.6 (#632)
kanyxmo Jun 18, 2025
9abea17
Merge remote-tracking branch 'origin/master'
kanyxmo Jun 18, 2025
b047449
Revert "update: 升级 vue-i18n 依赖版本至 11.1.6"
kanyxmo Jun 18, 2025
d01887e
fix(package): 降低vue-i18n版本号 (#635)
westng Jun 20, 2025
c7f2dd9
feat: add redis connection check. Prevent the "DNS Lookup resolution …
luckydog-sunny Jun 23, 2025
58ebe82
Update RedisConnectionCheckSubscriber.php
luckydog-sunny Jun 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README-en.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Chinese](./README.md) | English
# Project Introduction
[中文](./README.md) | English
# Projects

<p align="center">
<img src="https://doc.mineadmin.com/logo.svg" width="120" />
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ PHP有很多优秀的后台管理系统,但基于Swoole的后台管理系统
如果觉着还不错的话,就请点个 ⭐star 支持一下吧,这将是对我最大的支持和鼓励!
在使用 MineAdmin 前请认真阅读[《免责声明》](https://doc.mineadmin.com/guide/start/declaration.html)并同意该声明。

## 部门岗位分支(包含数据权限功能)
当前默认分支不带部门、岗位、数据权限等功能,如需使用这些功能请移步 [`【包含部门岗位的MineAdmin----master-department】`](https://github.com/mineadmin/MineAdmin/tree/master-department) 分支代码下载
## 默认主分支(不包含部门、岗位、数据权限功能)
当前分支带有部门、岗位、数据权限等功能,如果不需要使用这些功能请移步 [`【主分支】`](https://github.com/mineadmin/MineAdmin) 下载代码


## 官方交流群
> QQ群用于交流学习,请勿水群
Expand All @@ -41,7 +42,10 @@ PHP有很多优秀的后台管理系统,但基于Swoole的后台管理系统
4. 操作日志,用户对系统的一些正常操作的查询
5. 登录日志,用户登录系统的记录查询
6. 附件管理,管理当前系统上传的文件及图片等信息
7. 应用市场,可下载各种基础应用、插件、前端组件等等
7. 部门管理,可以管理组织架构
8. 岗位管理,在部门内管理,可以为部门设置岗位,再为用户分配岗位
9. 数据权限,数据权限功能跟随岗位而设置,同时,也可以对用户单独设置数据权限,使岗位的数据权限失效。
10. 应用市场,可下载各种基础应用、插件、前端组件等等

## 环境需求

Expand Down
117 changes: 117 additions & 0 deletions app/Http/Admin/Controller/Permission/DepartmentController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?php

declare(strict_types=1);
/**
* This file is part of MineAdmin.
*
* @link https://www.mineadmin.com
* @document https://doc.mineadmin.com
* @contact [email protected]
* @license https://github.com/mineadmin/MineAdmin/blob/master/LICENSE
*/

namespace App\Http\Admin\Controller\Permission;

use App\Http\Admin\Controller\AbstractController;
use App\Http\Admin\Middleware\PermissionMiddleware;
use App\Http\Admin\Request\Permission\DepartmentRequest;
use App\Http\Common\Middleware\AccessTokenMiddleware;
use App\Http\Common\Middleware\OperationMiddleware;
use App\Http\Common\Result;
use App\Http\CurrentUser;
use App\Schema\DepartmentSchema;
use App\Service\Permission\DepartmentService;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\Swagger\Annotation\Delete;
use Hyperf\Swagger\Annotation\Get;
use Hyperf\Swagger\Annotation\HyperfServer;
use Hyperf\Swagger\Annotation\JsonContent;
use Hyperf\Swagger\Annotation\Post;
use Hyperf\Swagger\Annotation\Put;
use Hyperf\Swagger\Annotation\RequestBody;
use Mine\Access\Attribute\Permission;
use Mine\Swagger\Attributes\PageResponse;
use Mine\Swagger\Attributes\ResultResponse;

#[HyperfServer(name: 'http')]
#[Middleware(middleware: AccessTokenMiddleware::class, priority: 100)]
#[Middleware(middleware: PermissionMiddleware::class, priority: 99)]
#[Middleware(middleware: OperationMiddleware::class, priority: 98)]
class DepartmentController extends AbstractController
{
public function __construct(
protected readonly CurrentUser $currentUser,
protected readonly DepartmentService $service
) {}

#[Get(
path: '/admin/department/list',
operationId: 'departmentList',
summary: '部门列表',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['部门管理'],
)]
#[PageResponse(instance: DepartmentSchema::class)]
#[Permission(code: 'permission:department:index')]
public function pageList(): Result
{
return $this->success([
'list' => $this->service->getList($this->getRequestData()),
]);
}

#[Post(
path: '/admin/department',
operationId: 'departmentCreate',
summary: '创建部门',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['部门管理'],
)]
#[RequestBody(
content: new JsonContent(ref: DepartmentRequest::class)
)]
#[Permission(code: 'permission:department:save')]
#[ResultResponse(instance: new Result())]
public function create(DepartmentRequest $request): Result
{
$this->service->create(array_merge($request->validated(), [
'created_by' => $this->currentUser->id(),
]));
return $this->success();
}

#[Put(
path: '/admin/department/{id}',
operationId: 'departmentSave',
summary: '保存部门',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['部门管理'],
)]
#[RequestBody(
content: new JsonContent(ref: DepartmentRequest::class)
)]
#[Permission(code: 'permission:department:update')]
#[ResultResponse(instance: new Result())]
public function save(int $id, DepartmentRequest $request): Result
{
$this->service->updateById($id, array_merge($request->validated(), [
'updated_by' => $this->currentUser->id(),
]));
return $this->success();
}

#[Delete(
path: '/admin/department',
operationId: 'departmentDelete',
summary: '删除部门',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['部门管理'],
)]
#[ResultResponse(instance: new Result())]
#[Permission(code: 'permission:department:delete')]
public function delete(): Result
{
$this->service->deleteById($this->getRequestData());
return $this->success();
}
}
100 changes: 100 additions & 0 deletions app/Http/Admin/Controller/Permission/LeaderController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?php

declare(strict_types=1);
/**
* This file is part of MineAdmin.
*
* @link https://www.mineadmin.com
* @document https://doc.mineadmin.com
* @contact [email protected]
* @license https://github.com/mineadmin/MineAdmin/blob/master/LICENSE
*/

namespace App\Http\Admin\Controller\Permission;

use App\Http\Admin\Controller\AbstractController;
use App\Http\Admin\Middleware\PermissionMiddleware;
use App\Http\Admin\Request\Permission\LeaderRequest;
use App\Http\Common\Middleware\AccessTokenMiddleware;
use App\Http\Common\Middleware\OperationMiddleware;
use App\Http\Common\Result;
use App\Http\CurrentUser;
use App\Schema\LeaderSchema;
use App\Service\Permission\LeaderService;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\Swagger\Annotation\Delete;
use Hyperf\Swagger\Annotation\Get;
use Hyperf\Swagger\Annotation\HyperfServer;
use Hyperf\Swagger\Annotation\JsonContent;
use Hyperf\Swagger\Annotation\Post;
use Hyperf\Swagger\Annotation\RequestBody;
use Mine\Access\Attribute\Permission;
use Mine\Swagger\Attributes\PageResponse;
use Mine\Swagger\Attributes\ResultResponse;

#[HyperfServer(name: 'http')]
#[Middleware(middleware: AccessTokenMiddleware::class, priority: 100)]
#[Middleware(middleware: PermissionMiddleware::class, priority: 99)]
#[Middleware(middleware: OperationMiddleware::class, priority: 98)]
class LeaderController extends AbstractController
{
public function __construct(
protected readonly CurrentUser $currentUser,
protected readonly LeaderService $service
) {}

#[Get(
path: '/admin/leader/list',
operationId: 'leaderList',
summary: '部门领导列表',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['部门领导管理'],
)]
#[PageResponse(instance: LeaderSchema::class)]
#[Permission(code: 'permission:leader:index')]
public function pageList(): Result
{
return $this->success(
$this->service->page(
$this->getRequestData(),
$this->getCurrentPage(),
$this->getPageSize()
)
);
}

#[Post(
path: '/admin/leader',
operationId: 'leaderCreate',
summary: '部门领导岗位',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['部门领导管理'],
)]
#[RequestBody(
content: new JsonContent(ref: LeaderRequest::class)
)]
#[Permission(code: 'permission:leader:save')]
#[ResultResponse(instance: new Result())]
public function create(LeaderRequest $request): Result
{
$this->service->create(array_merge($request->validated(), [
'created_by' => $this->currentUser->id(),
]));
return $this->success();
}

#[Delete(
path: '/admin/leader',
operationId: 'leaderDelete',
summary: '删除部门领导',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['部门领导管理'],
)]
#[ResultResponse(instance: new Result())]
#[Permission(code: 'permission:leader:delete')]
public function delete(): Result
{
$this->service->deleteByDoubleKey($this->getRequestData());
return $this->success();
}
}
137 changes: 137 additions & 0 deletions app/Http/Admin/Controller/Permission/PositionController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?php

declare(strict_types=1);
/**
* This file is part of MineAdmin.
*
* @link https://www.mineadmin.com
* @document https://doc.mineadmin.com
* @contact [email protected]
* @license https://github.com/mineadmin/MineAdmin/blob/master/LICENSE
*/

namespace App\Http\Admin\Controller\Permission;

use App\Http\Admin\Controller\AbstractController;
use App\Http\Admin\Middleware\PermissionMiddleware;
use App\Http\Admin\Request\Permission\BatchGrantDataPermissionForPositionRequest;
use App\Http\Admin\Request\Permission\PositionRequest;
use App\Http\Common\Middleware\AccessTokenMiddleware;
use App\Http\Common\Middleware\OperationMiddleware;
use App\Http\Common\Result;
use App\Http\CurrentUser;
use App\Schema\PositionSchema;
use App\Service\Permission\PositionService;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\Swagger\Annotation\Delete;
use Hyperf\Swagger\Annotation\Get;
use Hyperf\Swagger\Annotation\HyperfServer;
use Hyperf\Swagger\Annotation\JsonContent;
use Hyperf\Swagger\Annotation\Post;
use Hyperf\Swagger\Annotation\Put;
use Hyperf\Swagger\Annotation\RequestBody;
use Mine\Access\Attribute\Permission;
use Mine\Swagger\Attributes\PageResponse;
use Mine\Swagger\Attributes\ResultResponse;

#[HyperfServer(name: 'http')]
#[Middleware(middleware: AccessTokenMiddleware::class, priority: 100)]
#[Middleware(middleware: PermissionMiddleware::class, priority: 99)]
#[Middleware(middleware: OperationMiddleware::class, priority: 98)]
class PositionController extends AbstractController
{
public function __construct(
protected readonly CurrentUser $currentUser,
protected readonly PositionService $service
) {}

#[Get(
path: '/admin/position/list',
operationId: 'positionList',
summary: '岗位列表',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['岗位管理'],
)]
#[PageResponse(instance: PositionSchema::class)]
#[Permission(code: 'permission:position:index')]
public function pageList(): Result
{
return $this->success(
$this->service->page(
$this->getRequestData(),
$this->getCurrentPage(),
$this->getPageSize()
)
);
}

#[Put(
path: '/admin/position/{id}/data_permission',
operationId: 'positionDataPermission',
summary: '设置岗位数据权限',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['岗位管理'],
)]
#[Permission(code: 'permission:position:data_permission')]
#[ResultResponse(instance: new Result())]
public function batchDataPermission(int $id, BatchGrantDataPermissionForPositionRequest $request): Result
{
$this->service->batchDataPermission($id, $request->validated());
return $this->success();
}

#[Post(
path: '/admin/position',
operationId: 'positionCreate',
summary: '创建岗位',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['岗位管理'],
)]
#[RequestBody(
content: new JsonContent(ref: PositionRequest::class)
)]
#[Permission(code: 'permission:position:save')]
#[ResultResponse(instance: new Result())]
public function create(PositionRequest $request): Result
{
$this->service->create(array_merge($request->validated(), [
'created_by' => $this->currentUser->id(),
]));
return $this->success();
}

#[Put(
path: '/admin/position/{id}',
operationId: 'positionSave',
summary: '保存岗位',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['岗位管理'],
)]
#[RequestBody(
content: new JsonContent(ref: PositionRequest::class)
)]
#[Permission(code: 'permission:position:update')]
#[ResultResponse(instance: new Result())]
public function save(int $id, PositionRequest $request): Result
{
$this->service->updateById($id, array_merge($request->validated(), [
'updated_by' => $this->currentUser->id(),
]));
return $this->success();
}

#[Delete(
path: '/admin/position',
operationId: 'positionDelete',
summary: '删除岗位',
security: [['Bearer' => [], 'ApiKey' => []]],
tags: ['岗位管理'],
)]
#[ResultResponse(instance: new Result())]
#[Permission(code: 'permission:position:delete')]
public function delete(): Result
{
$this->service->deleteById($this->getRequestData());
return $this->success();
}
}
Loading