mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-13 14:57:16 +08:00
新增:新增系统管理/部门管理/新增功能
This commit is contained in:
13
continew-admin-ui/src/api/common/index.ts
Normal file
13
continew-admin-ui/src/api/common/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import axios from 'axios';
|
||||
import qs from 'query-string';
|
||||
import { DeptParams } from '@/api/system/dept';
|
||||
import { TreeNodeData } from '@arco-design/web-vue';
|
||||
|
||||
export default function getDeptTree(params: DeptParams) {
|
||||
return axios.get<TreeNodeData[]>('/common/tree/dept', {
|
||||
params,
|
||||
paramsSerializer: (obj) => {
|
||||
return qs.stringify(obj);
|
||||
},
|
||||
});
|
||||
}
|
@@ -1,11 +1,10 @@
|
||||
import axios from 'axios';
|
||||
|
||||
import qs from 'query-string';
|
||||
|
||||
export interface DeptRecord {
|
||||
deptId: string;
|
||||
deptName: string;
|
||||
parentId: string;
|
||||
parentId: number;
|
||||
deptSort: number;
|
||||
description: string;
|
||||
status: number;
|
||||
@@ -14,10 +13,9 @@ export interface DeptRecord {
|
||||
children: Array<DeptRecord>,
|
||||
}
|
||||
|
||||
export interface DeptParams extends Partial<DeptRecord> {
|
||||
page: number;
|
||||
size: number;
|
||||
sort: Array<string>;
|
||||
export interface DeptParams {
|
||||
deptName?: string;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
export function getDeptList(params: DeptParams) {
|
||||
@@ -27,4 +25,14 @@ export function getDeptList(params: DeptParams) {
|
||||
return qs.stringify(obj);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export interface CreateDeptReq {
|
||||
parentId: number;
|
||||
deptName: string;
|
||||
deptSort: number;
|
||||
description: string;
|
||||
}
|
||||
export function createDept(req: CreateDeptReq) {
|
||||
return axios.post('/system/dept', req);
|
||||
}
|
Reference in New Issue
Block a user