多租户平台

This commit is contained in:
2025-06-26 15:29:07 +08:00
commit 796acccf16
355 changed files with 27974 additions and 0 deletions

View File

@ -0,0 +1,73 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DeptForm, DeptQuery, DeptTreeVO, DeptVO } from './types';
// 查询部门列表
export const listDept = (query?: DeptQuery) => {
return request({
url: '/system/dept/list',
method: 'get',
params: query
});
};
/**
* 通过deptIds查询部门
* @param deptIds
*/
export const optionSelect = (deptIds: (number | string)[]): AxiosPromise<DeptVO[]> => {
return request({
url: '/system/dept/optionselect?deptIds=' + deptIds,
method: 'get'
});
};
// 查询部门列表(排除节点)
export const listDeptExcludeChild = (deptId: string | number): AxiosPromise<DeptVO[]> => {
return request({
url: '/system/dept/list/exclude/' + deptId,
method: 'get'
});
};
// 查询部门详细
export const getDept = (deptId: string | number): AxiosPromise<DeptVO> => {
return request({
url: '/system/dept/' + deptId,
method: 'get'
});
};
// 查询部门下拉树结构
export const treeselect = (): AxiosPromise<DeptTreeVO[]> => {
return request({
url: '/system/dept/treeselect',
method: 'get'
});
};
// 新增部门
export const addDept = (data: DeptForm) => {
return request({
url: '/system/dept',
method: 'post',
data: data
});
};
// 修改部门
export const updateDept = (data: DeptForm) => {
return request({
url: '/system/dept',
method: 'put',
data: data
});
};
// 删除部门
export const delDept = (deptId: number | string) => {
return request({
url: '/system/dept/' + deptId,
method: 'delete'
});
};

View File

@ -0,0 +1,60 @@
/**
* 部门查询参数
*/
export interface DeptQuery extends PageQuery {
deptName?: string;
deptCategory?: string;
status?: number;
}
/**
* 部门类型
*/
export interface DeptVO extends BaseEntity {
id: number | string;
parentName: string;
parentId: number | string;
children: DeptVO[];
deptId: number | string;
deptName: string;
deptCategory: string;
orderNum: number;
leader: string;
phone: string;
email: string;
status: string;
delFlag: string;
ancestors: string;
menuId: string | number;
}
/**
* 部门类型
*/
export interface DeptTreeVO extends BaseEntity {
id: number | string;
label: string;
parentId: number | string;
weight: number;
children: DeptTreeVO[];
disabled: boolean;
}
/**
* 部门表单类型
*/
export interface DeptForm {
parentName?: string;
parentId?: number | string;
children?: DeptForm[];
deptId?: number | string;
deptName?: string;
deptCategory?: string;
orderNum?: number;
leader?: string;
phone?: string;
email?: string;
status?: string;
delFlag?: string;
ancestors?: string;
}