refactor: 系统管理接口和页面重构

Former-commit-id: d16371370c6bf6928bcf0883e1511a1a91ea388d
This commit is contained in:
haoxr
2023-03-11 21:21:54 +08:00
parent 314789ad09
commit 00082202dd
22 changed files with 1664 additions and 1549 deletions

View File

@@ -1,13 +1,13 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DeptForm, DeptQuery, Dept } from './types';
import { DeptForm, DeptQuery, DeptVO } from './types';
/**
* 部门树形表格
*
* @param queryParams
*/
export function listDepartments(queryParams?: DeptQuery): AxiosPromise<Dept[]> {
export function listDepts(queryParams?: DeptQuery): AxiosPromise<DeptVO[]> {
return request({
url: '/api/v1/dept',
method: 'get',
@@ -18,7 +18,7 @@ export function listDepartments(queryParams?: DeptQuery): AxiosPromise<Dept[]> {
/**
* 部门下拉列表
*/
export function listDeptOptions(): AxiosPromise<OptionType[]> {
export function listDeptOptions(): AxiosPromise<[]> {
return request({
url: '/api/v1/dept/options',
method: 'get'
@@ -30,7 +30,7 @@ export function listDeptOptions(): AxiosPromise<OptionType[]> {
*
* @param id
*/
export function getDeptForm(id: string): AxiosPromise<DeptForm> {
export function getDeptForm(id: number): AxiosPromise<DeptForm> {
return request({
url: '/api/v1/dept/' + id + '/form',
method: 'get'
@@ -56,7 +56,7 @@ export function addDept(data: DeptForm) {
* @param id
* @param data
*/
export function updateDept(id: string, data: DeptForm) {
export function updateDept(id: number, data: DeptForm) {
return request({
url: '/api/v1/dept/' + id,
method: 'put',

View File

@@ -2,33 +2,70 @@
* 部门查询参数
*/
export interface DeptQuery {
keywords: string | undefined;
status: number | undefined;
keywords?: string;
status?: number;
}
/**
* 部门类型
*/
export interface Dept {
id: string;
name: string;
parentId: string;
treePath: string;
sort: number;
status: number;
leader?: string;
mobile?: string;
email?: string;
children: Dept[];
export interface DeptVO {
/**
* 子部门
*/
children?: DeptVO[];
/**
* 创建时间
*/
createTime?: Date;
/**
* 部门ID
*/
id?: number;
/**
* 部门名称
*/
name?: string;
/**
* 父部门ID
*/
parentId?: number;
/**
* 排序
*/
sort?: number;
/**
* 状态(1:启用0:禁用)
*/
status?: number;
/**
* 修改时间
*/
updateTime?: Date;
}
/**
* 部门表单类型
*/
export interface DeptForm {
id?: string;
parentId: string;
name: string;
sort: number;
status: number;
/**
* 部门ID(新增不填)
*/
id?: number;
/**
* 部门名称
*/
name?: string;
/**
* 父部门ID
*/
parentId: number;
/**
* 排序
*/
sort?: number;
/**
* 状态(1:启用0禁用)
*/
status?: number;
}