mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 13:09:19 +08:00
feat: 权限树前端改造
- PermissionVO 新增 parentId、sortOrder、children 字段 - 新增 getPermissionTreeApi 接口 - 权限管理页新增树状视图(表格/树状切换) - 职位权限分配页改为树状多选(父→子级联勾选) - 公司权限分配页改为树状多选(父→子级联勾选) - 勾选父节点自动勾选所有子权限和父节点链
This commit is contained in:
@@ -48,3 +48,10 @@ export async function getPermissionDetailApi(permissionId: number) {
|
||||
export async function getAllPermissionsApi() {
|
||||
return requestClient.get<PermissionVO.PermissionInfoVO[]>('/permission/list');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限树(树状结构)
|
||||
*/
|
||||
export async function getPermissionTreeApi() {
|
||||
return requestClient.get<PermissionVO.PermissionInfoVO[]>('/permission/tree');
|
||||
}
|
||||
|
||||
@@ -7,16 +7,22 @@ export namespace PermissionVO {
|
||||
export interface PermissionInfoVO {
|
||||
/** 权限ID */
|
||||
id: number;
|
||||
/** 父权限ID(NULL=顶级模块) */
|
||||
parentId?: number | null;
|
||||
/** 权限码(唯一标识,如 user:add, order:approve) */
|
||||
code: string;
|
||||
/** 权限名称(用于显示,如 用户新增、订单审核) */
|
||||
name: string;
|
||||
/** 权限类型(api-接口权限,button-按钮权限,data-数据权限) */
|
||||
/** 权限类型(api-接口权限,button-按钮权限,data-数据权限,module-模块分组) */
|
||||
type: string;
|
||||
/** 状态:1-启用 0-禁用 */
|
||||
status: number;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 同级排序 */
|
||||
sortOrder?: number;
|
||||
/** 子权限列表(树结构) */
|
||||
children?: PermissionInfoVO[];
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
|
||||
Reference in New Issue
Block a user