feat:增加主包(tabbar)、system(系统管理)、infra(基础设施)、bpm(工作流程)的页面
This commit is contained in:
45
src/api/system/dept/index.ts
Normal file
45
src/api/system/dept/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 部门信息 */
|
||||
export interface Dept {
|
||||
id?: number
|
||||
name: string
|
||||
parentId: number
|
||||
status: number
|
||||
sort: number
|
||||
leaderUserId?: number
|
||||
phone?: string
|
||||
email?: string
|
||||
createTime?: string
|
||||
children?: Dept[]
|
||||
}
|
||||
|
||||
/** 获取部门列表 */
|
||||
export function getDeptList(params?: { name?: string; status?: number }) {
|
||||
return http.get<Dept[]>('/system/dept/list', params)
|
||||
}
|
||||
|
||||
/** 获取部门精简列表 */
|
||||
export function getSimpleDeptList() {
|
||||
return http.get<Dept[]>('/system/dept/simple-list')
|
||||
}
|
||||
|
||||
/** 获取部门详情 */
|
||||
export function getDept(id: number) {
|
||||
return http.get<Dept>(`/system/dept/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建部门 */
|
||||
export function createDept(data: Dept) {
|
||||
return http.post<number>('/system/dept/create', data)
|
||||
}
|
||||
|
||||
/** 更新部门 */
|
||||
export function updateDept(data: Dept) {
|
||||
return http.put<boolean>('/system/dept/update', data)
|
||||
}
|
||||
|
||||
/** 删除部门 */
|
||||
export function deleteDept(id: number) {
|
||||
return http.delete<boolean>(`/system/dept/delete?id=${id}`)
|
||||
}
|
||||
20
src/api/system/dict/data/index.ts
Normal file
20
src/api/system/dict/data/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 字典数据 */
|
||||
export interface DictData {
|
||||
id?: number
|
||||
dictType: string
|
||||
label: string
|
||||
value: string
|
||||
colorType?: string
|
||||
cssClass?: string
|
||||
sort?: number
|
||||
status: number
|
||||
remark?: string
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/** 查询字典数据(精简)列表 */
|
||||
export function getSimpleDictDataList() {
|
||||
return http.get<DictData[]>('/system/dict-data/simple-list')
|
||||
}
|
||||
51
src/api/system/menu/index.ts
Normal file
51
src/api/system/menu/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 菜单信息 */
|
||||
export interface Menu {
|
||||
id?: number
|
||||
name: string
|
||||
permission: string
|
||||
type: number
|
||||
sort: number
|
||||
parentId: number
|
||||
path: string
|
||||
icon: string
|
||||
component: string
|
||||
componentName?: string
|
||||
status: number
|
||||
visible: boolean
|
||||
keepAlive: boolean
|
||||
alwaysShow?: boolean
|
||||
createTime?: string
|
||||
children?: Menu[]
|
||||
}
|
||||
|
||||
/** 获取菜单列表 */
|
||||
export function getMenuList(params?: { name?: string, status?: number }) {
|
||||
return http.get<Menu[]>('/system/menu/list', params)
|
||||
}
|
||||
|
||||
/** 获取菜单精简列表 */
|
||||
export function getSimpleMenuList() {
|
||||
return http.get<Menu[]>('/system/menu/simple-list')
|
||||
}
|
||||
|
||||
/** 获取菜单详情 */
|
||||
export function getMenu(id: number) {
|
||||
return http.get<Menu>(`/system/menu/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建菜单 */
|
||||
export function createMenu(data: Menu) {
|
||||
return http.post<number>('/system/menu/create', data)
|
||||
}
|
||||
|
||||
/** 更新菜单 */
|
||||
export function updateMenu(data: Menu) {
|
||||
return http.put<boolean>('/system/menu/update', data)
|
||||
}
|
||||
|
||||
/** 删除菜单 */
|
||||
export function deleteMenu(id: number) {
|
||||
return http.delete<boolean>(`/system/menu/delete?id=${id}`)
|
||||
}
|
||||
39
src/api/system/notify/index.ts
Normal file
39
src/api/system/notify/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 站内信消息 */
|
||||
export interface NotifyMessage {
|
||||
id: number
|
||||
userId: number
|
||||
userType: number
|
||||
templateId: number
|
||||
templateCode: string
|
||||
templateNickname: string
|
||||
templateContent: string
|
||||
templateType: number
|
||||
templateParams: string
|
||||
readStatus: boolean
|
||||
readTime: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
/** 获取我的站内信分页 */
|
||||
export function getMyNotifyMessagePage(params: PageParam) {
|
||||
return http.get<PageResult<NotifyMessage>>('/system/notify-message/my-page', params)
|
||||
}
|
||||
|
||||
/** 批量标记站内信已读 */
|
||||
export function updateNotifyMessageRead(ids: number | number[]) {
|
||||
const idsArray = Array.isArray(ids) ? ids : [ids]
|
||||
return http.put<boolean>('/system/notify-message/update-read', undefined, { ids: idsArray })
|
||||
}
|
||||
|
||||
/** 标记所有站内信为已读 */
|
||||
export function updateAllNotifyMessageRead() {
|
||||
return http.put<boolean>('/system/notify-message/update-all-read')
|
||||
}
|
||||
|
||||
/** 获取当前用户的未读站内信数量 */
|
||||
export function getUnreadNotifyMessageCount() {
|
||||
return http.get<number>('/system/notify-message/get-unread-count')
|
||||
}
|
||||
43
src/api/system/post/index.ts
Normal file
43
src/api/system/post/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 岗位信息 */
|
||||
export interface Post {
|
||||
id?: number
|
||||
name: string
|
||||
code: string
|
||||
sort: number
|
||||
status: number
|
||||
remark?: string
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/** 获取岗位分页列表 */
|
||||
export function getPostPage(params: PageParam) {
|
||||
return http.get<PageResult<Post>>('/system/post/page', params)
|
||||
}
|
||||
|
||||
/** 获取岗位精简列表 */
|
||||
export function getSimplePostList() {
|
||||
return http.get<Post[]>('/system/post/simple-list')
|
||||
}
|
||||
|
||||
/** 获取岗位详情 */
|
||||
export function getPost(id: number) {
|
||||
return http.get<Post>(`/system/post/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建岗位 */
|
||||
export function createPost(data: Post) {
|
||||
return http.post<number>('/system/post/create', data)
|
||||
}
|
||||
|
||||
/** 更新岗位 */
|
||||
export function updatePost(data: Post) {
|
||||
return http.put<boolean>('/system/post/update', data)
|
||||
}
|
||||
|
||||
/** 删除岗位 */
|
||||
export function deletePost(id: number) {
|
||||
return http.delete<boolean>(`/system/post/delete?id=${id}`)
|
||||
}
|
||||
46
src/api/system/role/index.ts
Normal file
46
src/api/system/role/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { http } from '@/http/http'
|
||||
import { PageParam, PageResult } from '@/http/types';
|
||||
|
||||
/** 角色信息 */
|
||||
export interface Role {
|
||||
id: number
|
||||
name: string
|
||||
code: string
|
||||
sort: number
|
||||
status: number
|
||||
type?: number
|
||||
remark?: string
|
||||
dataScope?: number
|
||||
dataScopeDeptIds?: number[]
|
||||
createTime: string
|
||||
}
|
||||
|
||||
/** 获取角色分页列表 */
|
||||
export function getRolePage(params: PageParam) {
|
||||
return http.get<PageResult<Role>>('/system/role/page', params)
|
||||
}
|
||||
|
||||
/** 获取角色详情 */
|
||||
export function getRole(id: number) {
|
||||
return http.get<Role>(`/system/role/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建角色 */
|
||||
export function createRole(data: Role) {
|
||||
return http.post<number>('/system/role/create', data)
|
||||
}
|
||||
|
||||
/** 更新角色 */
|
||||
export function updateRole(data: Role) {
|
||||
return http.put<boolean>('/system/role/update', data)
|
||||
}
|
||||
|
||||
/** 删除角色 */
|
||||
export function deleteRole(id: number) {
|
||||
return http.delete<boolean>(`/system/role/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 获取角色精简列表 */
|
||||
export function getSimpleRoleList() {
|
||||
return http.get<Role[]>('/system/role/simple-list')
|
||||
}
|
||||
72
src/api/system/user/index.ts
Normal file
72
src/api/system/user/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 用户信息 */
|
||||
export interface User {
|
||||
id?: number
|
||||
username: string
|
||||
nickname: string
|
||||
password?: string
|
||||
deptId?: number
|
||||
deptName?: string
|
||||
postIds?: number[]
|
||||
email?: string
|
||||
mobile?: string
|
||||
sex?: number
|
||||
avatar?: string
|
||||
status: number
|
||||
remark?: string
|
||||
loginIp?: string
|
||||
loginDate?: string
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/** 获取用户分页列表 */
|
||||
export function getUserPage(params: PageParam) {
|
||||
return http.get<PageResult<User>>('/system/user/page', params)
|
||||
}
|
||||
|
||||
/** 获取用户详情 */
|
||||
export function getUser(id: number) {
|
||||
return http.get<User>(`/system/user/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建用户 */
|
||||
export function createUser(data: User) {
|
||||
return http.post<number>('/system/user/create', data)
|
||||
}
|
||||
|
||||
/** 更新用户 */
|
||||
export function updateUser(data: User) {
|
||||
return http.put<boolean>('/system/user/update', data)
|
||||
}
|
||||
|
||||
/** 删除用户 */
|
||||
export function deleteUser(id: number) {
|
||||
return http.delete<boolean>(`/system/user/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 重置用户密码 */
|
||||
export function resetUserPassword(id: number, password: string) {
|
||||
return http.put<boolean>('/system/user/update-password', { id, password })
|
||||
}
|
||||
|
||||
/** 修改用户状态 */
|
||||
export function updateUserStatus(id: number, status: number) {
|
||||
return http.put<boolean>('/system/user/update-status', { id, status })
|
||||
}
|
||||
|
||||
/** 获取用户拥有的角色列表 */
|
||||
export function getUserRoleIds(userId: number) {
|
||||
return http.get<number[]>(`/system/permission/list-user-roles?userId=${userId}`)
|
||||
}
|
||||
|
||||
/** 分配用户角色 */
|
||||
export function assignUserRole(userId: number, roleIds: number[]) {
|
||||
return http.post<boolean>('/system/permission/assign-user-role', { userId, roleIds })
|
||||
}
|
||||
|
||||
/** 获取用户精简列表 */
|
||||
export function getSimpleUserList() {
|
||||
return http.get<User[]>('/system/user/simple-list')
|
||||
}
|
||||
48
src/api/system/user/profile/index.ts
Normal file
48
src/api/system/user/profile/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 用户个人中心信息 */
|
||||
export interface UserProfileVO {
|
||||
id: number
|
||||
username: string
|
||||
nickname: string
|
||||
email?: string
|
||||
mobile?: string
|
||||
sex?: number
|
||||
avatar?: string
|
||||
loginIp: string
|
||||
loginDate: string
|
||||
createTime: string
|
||||
roles: { id: number, name: string }[]
|
||||
dept: { id: number, name: string }
|
||||
posts: { id: number, name: string }[]
|
||||
}
|
||||
|
||||
/** 更新个人信息请求 */
|
||||
export interface UpdateProfileReqVO {
|
||||
nickname?: string
|
||||
email?: string
|
||||
mobile?: string
|
||||
sex?: number
|
||||
avatar?: string
|
||||
}
|
||||
|
||||
/** 更新密码请求 */
|
||||
export interface UpdatePasswordReqVO {
|
||||
oldPassword: string
|
||||
newPassword: string
|
||||
}
|
||||
|
||||
/** 获取登录用户个人信息 */
|
||||
export function getUserProfile() {
|
||||
return http.get<UserProfileVO>('/system/user/profile/get')
|
||||
}
|
||||
|
||||
/** 修改用户个人信息 */
|
||||
export function updateUserProfile(data: UpdateProfileReqVO) {
|
||||
return http.put<boolean>('/system/user/profile/update', data)
|
||||
}
|
||||
|
||||
/** 修改用户个人密码 */
|
||||
export function updateUserPassword(data: UpdatePasswordReqVO) {
|
||||
return http.put<boolean>('/system/user/profile/update-password', data)
|
||||
}
|
||||
Reference in New Issue
Block a user