Skip to content

Commit

Permalink
optimize(projects): optimize type
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Sep 8, 2024
1 parent 01d962a commit 4679b17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/typings/antd.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ declare namespace AntDesign {

type TableColumn<T> = SetTableColumnKey<TableColumnType<T>, T> | SetTableColumnKey<TableColumnGroupType<T>, T>;

type TableApiFn<T = any, R = Api.SystemManage.CommonSearchParams> = (
type TableApiFn<T = any, R = Api.Common.CommonSearchParams> = (
params: R
) => Promise<FlatResponseData<Api.Common.PaginatingQueryRecord<T>>>;

Expand Down
9 changes: 5 additions & 4 deletions src/typings/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ declare namespace Api {
records: T[];
}

/** common search params of table */
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>;

/**
* enable status
*
Expand Down Expand Up @@ -88,8 +91,6 @@ declare namespace Api {
* backend api module: "systemManage"
*/
namespace SystemManage {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>;

/** role */
type Role = Common.CommonRecord<{
/** role name */
Expand All @@ -102,7 +103,7 @@ declare namespace Api {

/** role search params */
type RoleSearchParams = Partial<
Pick<Api.SystemManage.Role, 'roleName' | 'roleCode' | 'status'> & CommonSearchParams
Pick<Api.SystemManage.Role, 'roleName' | 'roleCode' | 'status'> & Common.CommonSearchParams
>;

/** role list */
Expand Down Expand Up @@ -138,7 +139,7 @@ declare namespace Api {
/** user search params */
type UserSearchParams = Partial<
Pick<Api.SystemManage.User, 'userName' | 'userGender' | 'nickName' | 'userPhone' | 'userEmail' | 'status'> &
CommonSearchParams
Common.CommonSearchParams
>;

/** user list */
Expand Down

0 comments on commit 4679b17

Please sign in to comment.