feat: 新增部门管理

This commit is contained in:
2024-04-10 21:22:25 +08:00
parent 63da55ab03
commit 3533e020c6
7 changed files with 374 additions and 0 deletions

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

@@ -0,0 +1,29 @@
import http from '@/utils/http'
import type * as System from './type'
const BASE_URL = '/system/dept'
/** @desc 查询部门列表 */
export function listDept(query: System.DeptQuery) {
return http.get<System.DeptResp[]>(`${BASE_URL}/tree`, query)
}
/** @desc 查询部门详情 */
export function getDept(id: string) {
return http.get<System.DeptResp>(`${BASE_URL}/${id}`)
}
/** @desc 新增部门 */
export function addDept(data: any) {
return http.post<boolean>(`${BASE_URL}`, data)
}
/** @desc 修改部门 */
export function updateDept(data: any, id: string) {
return http.put(`${BASE_URL}/${id}`, data)
}
/** @desc 删除部门 */
export function deleteDept(id: string) {
return http.del(`${BASE_URL}/${id}`)
}

View File

@@ -1 +1,2 @@
export * from './dept'
export * from './log'

View File

@@ -1,3 +1,24 @@
/** 系统部门类型 */
export interface DeptResp {
id: string
name: string
sort: number
status: 1 | 2
isSystem: boolean
description: string
createUserString: string
createTime: string
updateUserString: string
updateTime: string
parentId: string
children: DeptResp[]
}
export interface DeptQuery {
description?: string
status?: number
sort?: Array<string>
}
/** 系统日志类型 */
export interface LogResp {
id: string