mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-10 03:24:12 +00:00
refactor(api): 统一详情接口使用路径参数替代查询参数
feat(utils): 新增部门树格式化工具函数 style(components): 调整通知组件样式和内容显示 fix(store): 修复通知公告获取逻辑并添加日志 perf(request): 优化请求拦截器仅对非GET请求显示成功消息 refactor(views): 重构多个模块的删除操作确认逻辑 docs(types): 移除未使用的全局类型定义 style(views): 调整表格列顺序和操作按钮样式 fix(components): 修复部门树组件数据加载和格式化 refactor(api): 重构用户、角色等模块的接口参数类型 style(views): 统一表单选择器宽度和布局
This commit is contained in:
@@ -144,6 +144,22 @@ export function listToTree(list: any[]) {
|
||||
return tree;
|
||||
}
|
||||
|
||||
// 加载部门选项
|
||||
export function formatDeptTree(nodes: any[]): any[] {
|
||||
return nodes.map(node => {
|
||||
const formattedNode = {
|
||||
value: node.id,
|
||||
label: node.name
|
||||
};
|
||||
|
||||
if (node.children && node.children.length > 0) {
|
||||
Object.assign(formattedNode, { children: formatDeptTree(node.children) });
|
||||
}
|
||||
|
||||
return formattedNode;
|
||||
});
|
||||
}
|
||||
|
||||
export function cloneDeep(obj: any) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user