refactor: 优化 queryForm 的 Query 类型使用

This commit is contained in:
2024-05-02 20:22:10 +08:00
parent 05ab89d03f
commit 5b71369251
22 changed files with 82 additions and 96 deletions

View File

@@ -4,7 +4,7 @@ import type * as Monitor from './type'
const BASE_URL = '/monitor/online'
/** @desc 查询在线用户列表 */
export function listOnlineUser(query: Monitor.OnlineUserQuery) {
export function listOnlineUser(query: Monitor.OnlineUserPageQuery) {
return http.get<PageRes<Monitor.OnlineUserResp[]>>(`${BASE_URL}`, query)
}

View File

@@ -13,10 +13,12 @@ export interface OnlineUserResp {
createUserString: string
createTime: string
}
export interface OnlineUserQuery extends PageQuery {
export interface OnlineUserQuery {
nickname?: string
loginTime?: string
sort: Array<string>
}
export interface OnlineUserPageQuery extends OnlineUserQuery, PageQuery {}
/** 系统日志类型 */
export interface LogResp {
@@ -52,4 +54,4 @@ export interface LogQuery {
status?: number
sort: Array<string>
}
export interface LogPageQuery extends PageQuery, LogQuery {}
export interface LogPageQuery extends LogQuery, PageQuery {}

View File

@@ -4,7 +4,7 @@ import type * as System from './type'
const BASE_URL = '/system/dict'
/** @desc 查询字典列表 */
export function listDict(query: System.DictQuery) {
export function listDict(query: System.DictPageQuery) {
return http.get<PageRes<System.DictResp[]>>(`${BASE_URL}`, query)
}
@@ -29,7 +29,7 @@ export function deleteDict(id: string) {
}
/** @desc 查询字典项列表 */
export function listDictItem(query: System.DictItemQuery) {
export function listDictItem(query: System.DictItemPageQuery) {
return http.get<PageRes<System.DictItemResp[]>>(`${BASE_URL}/item`, query)
}

View File

@@ -4,7 +4,7 @@ import type * as System from './type'
const BASE_URL = '/system/file'
/** @desc 查询文件列表 */
export function listFile(query: System.FileQuery) {
export function listFile(query: System.FilePageQuery) {
return http.get<PageRes<System.FileItem[]>>(`${BASE_URL}`, query)
}

View File

@@ -4,7 +4,7 @@ import type * as System from './type'
const BASE_URL = '/system/notice'
/** @desc 查询公告列表 */
export function listNotice(query: System.NoticeQuery) {
export function listNotice(query: System.NoticePageQuery) {
return http.get<PageRes<System.NoticeResp[]>>(`${BASE_URL}`, query)
}

View File

@@ -4,7 +4,7 @@ import type * as System from './type'
const BASE_URL = '/system/role'
/** @desc 查询角色列表 */
export function listRole(query: System.RoleQuery) {
export function listRole(query: System.RolePageQuery) {
return http.get<PageRes<System.RoleResp[]>>(`${BASE_URL}`, query)
}

View File

@@ -4,7 +4,7 @@ import type * as System from './type'
const BASE_URL = '/system/storage'
/** @desc 查询存储列表 */
export function listStorage(query: System.StorageQuery) {
export function listStorage(query: System.StoragePageQuery) {
return http.get<PageRes<System.StorageResp[]>>(`${BASE_URL}`, query)
}

View File

@@ -29,7 +29,7 @@ export interface UserQuery {
deptId?: string
sort: Array<string>
}
export interface UserPageQuery extends PageQuery, UserQuery {}
export interface UserPageQuery extends UserQuery, PageQuery {}
/** 系统角色类型 */
export interface RoleResp {
@@ -62,9 +62,11 @@ export interface RoleDetailResp {
updateTime: string
disabled: boolean
}
export interface RoleQuery extends PageQuery {
export interface RoleQuery {
description?: string
sort: Array<string>
}
export interface RolePageQuery extends RoleQuery, PageQuery {}
/** 系统菜单类型 */
export interface MenuResp {
@@ -116,25 +118,6 @@ export interface DeptQuery {
sort: Array<string>
}
/** 系统公告类型 */
export interface NoticeResp {
id: string
title: string
content: string
status: number
type: string
effectiveTime: string
terminateTime: string
createUserString: string
createTime: string
updateUserString: string
updateTime: string
}
export interface NoticeQuery extends PageQuery {
title?: string
type?: string
}
/** 系统字典类型 */
export interface DictResp {
id: string
@@ -147,9 +130,11 @@ export interface DictResp {
updateUserString: string
updateTime: string
}
export interface DictQuery extends PageQuery {
export interface DictQuery {
description?: string
sort: Array<string>
}
export interface DictPageQuery extends DictQuery, PageQuery {}
export type DictItemResp = {
id: string
label: string
@@ -164,11 +149,34 @@ export type DictItemResp = {
updateUserString: string
updateTime: string
}
export interface DictItemQuery extends PageQuery {
export interface DictItemQuery {
description?: string
status?: number
sort: Array<string>
dictId: string
}
export interface DictItemPageQuery extends DictItemQuery, PageQuery {}
/** 系统公告类型 */
export interface NoticeResp {
id: string
title: string
content: string
status: number
type: string
effectiveTime: string
terminateTime: string
createUserString: string
createTime: string
updateUserString: string
updateTime: string
}
export interface NoticeQuery {
title?: string
type?: string
sort: Array<string>
}
export interface NoticePageQuery extends NoticeQuery, PageQuery {}
/** 系统文件类型 */
export type FileItem = {
@@ -184,18 +192,19 @@ export type FileItem = {
updateUserString: string
updateTime: string
}
export interface FileQuery extends PageQuery {
name?: string
type?: string
}
/** 文件资源统计 */
/** 文件资源统计信息 */
export interface FileStatisticsResp {
type: string
size: number
formattedSize: string
number: number
data: Array<FileStatisticsResp>
}
export interface FileQuery {
name?: string
type?: string
sort: Array<string>
}
export interface FilePageQuery extends FileQuery, PageQuery {}
/** 系统存储类型 */
export type StorageResp = {
@@ -217,10 +226,12 @@ export type StorageResp = {
updateUserString: string
updateTime: string
}
export interface StorageQuery extends PageQuery {
export interface StorageQuery {
description?: string
status?: number
sort: Array<string>
}
export interface StoragePageQuery extends StorageQuery, PageQuery {}
/** 系统参数类型 */
export interface OptionResp {
@@ -232,7 +243,6 @@ export interface OptionResp {
export interface OptionQuery {
code: Array<string>
}
/** 基础配置类型 */
export interface BasicConfigResp {
site_favicon: string