feat: 初始提交

This commit is contained in:
siujamo committed 2025-12-25 16:12:01 +08:00
commit faff32475f
77 files changed
+6123

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import type { GetProps } from "antd"
import type Icon from "@ant-design/icons"
export type AntIconComponentProps = GetProps<typeof Icon>
export interface AntTreeSelectOption<T> {
value: T
label: string
children: AntTreeSelectOption<T>[]
disabled?: boolean
disableCheckbox?: boolean
selectable?: boolean
checkable?: boolean
}
+14
View File
@@ -0,0 +1,14 @@
/**
* WeCom config
*/
export type WecomConfig = {
/**
* Corporation ID
*/
corpId: string
/**
* Application ID
*/
agentId: string
}
+6
View File
@@ -0,0 +1,6 @@
/**
* Status
*/
export type Status = "ACTIVE" | "INACTIVE"
export type UserStatus = Status | "LOCKED"
+73
View File
@@ -0,0 +1,73 @@
import type { Status, UserStatus } from "@/types/constant"
import type { CountryCode as RegionAbbreviation } from "libphonenumber-js"
import type { Dayjs } from "dayjs"
/**
* User information
*/
export interface User {
id: number
username: string
password: string
fullName: string
email: string
regionAbbreviation: RegionAbbreviation
phoneNumber: string
avatarUrl: string
status: UserStatus
departmentId: number
positionId: number
createdAt: string
updatedAt: string
}
/**
* Menu Item
*/
export interface MenuItem {
id: number
name: string
parentId: number | null
code: string
sort: number
isExternalLink: boolean
isVisible: boolean
status: Status
authorityCode: string | null
icon: string | null
createdAt: string
updatedAt: string
}
export interface Department {
id: number
name: string
parentId: number | null
sort: number
status: Status
createdAt: string
updatedAt: string
}
export interface Position {
id: number
name: string
code: string | null
description: string | null
sort: number
status: Status
createdAt: string
updatedAt: string
}
export interface Role {
id: number | string
name: string
code: string
sort: number
defaultValue: boolean
description: string | null
status: Status
createdAt: Dayjs | string
updatedAt: Dayjs | string
}
+31
View File
@@ -0,0 +1,31 @@
import type { User } from "@/types/entity"
import type { CountryCode as RegionAbbreviation } from "libphonenumber-js"
import type { Status } from "@/types/constant"
import type { Dayjs } from "dayjs"
export interface UserFormValues extends Omit<
User,
"id" | "password" | "regionAbbreviation" | "departmentId" | "positionId" | "createdAt" | "updatedAt"
> {
id: number | string | null
password: string | null
regionAbbreviation: RegionAbbreviation | null
departmentId: number | null
positionId: number | null
}
export interface QueryRoleForm {
qName: string | null
qCode: string | null
qStatus: Status | null
}
export interface QueryUserForm {
qDepartmentId: number | null
qUsername: string | null
qRegionAbbreviation: RegionAbbreviation | null
qPhoneNumber: string | null
qStatus: Status | null
qCreatedAtStart: Dayjs | null
qCreatedAtEnd: Dayjs | null
}
View File
Whitespace-only changes.
+14
View File
@@ -0,0 +1,14 @@
export interface Sortable {
empty: boolean
sorted: boolean
unsorted: boolean
}
export interface Pageable {
pageNumber: number
pageSize: number
sort: Sortable
offset: number
paged: boolean
unpaged: boolean
}
+6
View File
@@ -0,0 +1,6 @@
/**
* React Router Metadata
*/
export interface RouteHandle {
label: string
}
+37
View File
@@ -0,0 +1,37 @@
/**
* Represents a single node within a tree structure.
*
* Each node holds a data item of type T and an array of its children.
*
* @template T the type of the data item stored in the node
*/
export interface TreeNode<T> {
/**
* The actual data item contained within this node.
*/
item: T
/**
* A list of child nodes belonging to this node.
*
* This array will be empty if the node is a leaf node.
*/
children: TreeNode<T>[]
}
/**
* Defines a tree structure, which is simply a top-level tree node.
*
* It represents the root of the hierarchical data structure.
*
* @template T the type of the data items within the tree
*/
export type Tree<T> = TreeNode<T>
/**
* Defines a forest, which is an array of zero or more disjoint trees.
*
* Each element in the array is the root of an independent tree.
*
* @template T the type of the data items within the trees
*/
export type Forest<T> = TreeNode<T>[]
+54
View File
@@ -0,0 +1,54 @@
import type { CountryCode as RegionAbbreviation } from "libphonenumber-js"
import type { Status, UserStatus } from "@/types/constant"
import type { User } from "@/types/entity"
export interface PageRequest {
pageNum?: number
pageSize?: number
}
export interface UsernamePasswordLoginRequest {
username: string
password: string
captcha?: string
uuid?: string
}
export interface QueryUserRequest extends PageRequest {
departmentId: number | null
username: string | null
regionAbbreviation: RegionAbbreviation | null
phoneNumber: string | null
status: Status | null
createdAtStart: string | null
createdAtEnd: string | null
}
export interface QueryPositionRequest extends PageRequest {
}
export interface AddUserRequest extends Omit<User, "id" | "createdAt" | "updatedAt">{
roleIds: number[] | null
}
export interface EditUserRequest {
id: number | string
username: string | null
fullName: string | null
email: string | null
regionAbbreviation: string | null
phoneNumber: string | null
avatarUrl: string | null
status: UserStatus | null
departmentId: number | null
positionId: number | null
roleIds: number[] | null
}
export interface QueryRoleRequest extends PageRequest {
name: string | null
code: string | null
status: Status | null
}
+39
View File
@@ -0,0 +1,39 @@
import type { Role, User } from "@/types/entity"
import type { Pageable, Sortable } from "@/types/page"
export interface PageResponse<T> {
content: T[]
last: boolean
totalPages: number
totalElements: number
size: number
sort: Sortable
first: boolean
numberOfElements: number
empty: boolean,
pageable: Pageable
}
export interface UserAuthResponse {
user: User
accessToken: string
}
export interface UserDetailResponse extends User {
departmentName: string
positionName: string
}
export interface CaptchaResponse {
uuid: string
captcha: string
}
export interface GeneralErrorResponse {
message: string
timestamp: string
}
export interface RoleResponse extends PageResponse<Role> {
}