mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-25 06:57:12 +08:00
feat: 新增部门管理
This commit is contained in:
29
src/apis/system/dept.ts
Normal file
29
src/apis/system/dept.ts
Normal 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}`)
|
||||
}
|
@@ -1 +1,2 @@
|
||||
export * from './dept'
|
||||
export * from './log'
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user