refactor: 系统管理页面重构和ts类型声明优化

Former-commit-id: 40263bbb072596ada41ef33d9170841e7e66cd01
This commit is contained in:
郝先瑞
2022-06-15 00:48:17 +08:00
parent 928ba2dbd8
commit 321b584f9f
116 changed files with 1692 additions and 1485 deletions

View File

@@ -1,4 +1,9 @@
import { DeptFormData, DeptItem, DeptQueryParam, Option } from '@/types';
import {
DeptFormData,
DeptItem,
DeptQueryParam,
} from '@/types/api/system/dept';
import { Option } from '@/types/common';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
@@ -7,13 +12,13 @@ import { AxiosPromise } from 'axios';
*
* @param queryParams
*/
export function listTableDepartments(
export function listDepartments(
queryParams?: DeptQueryParam
): AxiosPromise<DeptItem[]> {
return request({
url: '/youlai-admin/api/v1/depts/table',
url: '/youlai-admin/api/v1/depts',
method: 'get',
params: queryParams
params: queryParams,
});
}
@@ -22,8 +27,8 @@ export function listTableDepartments(
*/
export function listSelectDepartments(): AxiosPromise<Option[]> {
return request({
url: '/youlai-admin/api/v1/depts/select',
method: 'get'
url: '/youlai-admin/api/v1/depts/select_list',
method: 'get',
});
}
@@ -32,10 +37,10 @@ export function listSelectDepartments(): AxiosPromise<Option[]> {
*
* @param id
*/
export function getDeptDetail(id: string): AxiosPromise<DeptFormData> {
export function getDeptForrmData(id: string): AxiosPromise<DeptFormData> {
return request({
url: '/youlai-admin/api/v1/depts/' + id,
method: 'get'
url: '/youlai-admin/api/v1/depts/' + id + '/form_data',
method: 'get',
});
}
@@ -48,7 +53,7 @@ export function addDept(data: DeptFormData) {
return request({
url: '/youlai-admin/api/v1/depts',
method: 'post',
data: data
data: data,
});
}
@@ -62,7 +67,7 @@ export function updateDept(id: string, data: DeptFormData) {
return request({
url: '/youlai-admin/api/v1/depts/' + id,
method: 'put',
data: data
data: data,
});
}
@@ -74,6 +79,6 @@ export function updateDept(id: string, data: DeptFormData) {
export function deleteDept(ids: string) {
return request({
url: '/youlai-admin/api/v1/depts/' + ids,
method: 'delete'
method: 'delete',
});
}