feat: 新增菜单管理

This commit is contained in:
2024-04-13 22:53:02 +08:00
parent b30a3345a7
commit 98b249a3a2
288 changed files with 846 additions and 153 deletions

View File

@@ -1,3 +1,4 @@
export * from './menu'
export * from './dept'
export * from './log'
export * from './dict'

29
src/apis/system/menu.ts Normal file
View File

@@ -0,0 +1,29 @@
import http from '@/utils/http'
import type * as System from './type'
const BASE_URL = '/system/menu'
/** @desc 查询菜单列表 */
export function listMenu(query: System.MenuQuery) {
return http.get<System.MenuResp[]>(`${BASE_URL}/tree`, query)
}
/** @desc 查询菜单详情 */
export function getMenu(id: string) {
return http.get<System.MenuResp>(`${BASE_URL}/${id}`)
}
/** @desc 新增菜单 */
export function addMenu(data: any) {
return http.post<boolean>(`${BASE_URL}`, data)
}
/** @desc 修改菜单 */
export function updateMenu(data: any, id: string) {
return http.put(`${BASE_URL}/${id}`, data)
}
/** @desc 删除菜单 */
export function deleteMenu(id: string) {
return http.del(`${BASE_URL}/${id}`)
}

View File

@@ -1,3 +1,32 @@
/** 系统菜单类型 */
export interface MenuResp {
id: string
title: string
parentId: string
type: 1 | 2 | 3
path: string
name: string
component: string
redirect: string
icon: string
isExternal: boolean
isCache: boolean
isHidden: boolean
permission: string
sort: number
status: 1 | 2
createUserString: string
createTime: string
updateUserString: string
updateTime: string
children: MenuResp[]
}
export interface MenuQuery {
title?: string
status?: number
sort: Array<string>
}
/** 系统部门类型 */
export interface DeptResp {
id: string
@@ -16,7 +45,7 @@ export interface DeptResp {
export interface DeptQuery {
description?: string
status?: number
sort?: Array<string>
sort: Array<string>
}
/** 系统日志类型 */