feat(project): 添加vben5前端
This commit is contained in:
77
Yi.Vben5.Vue3/apps/web-antd/src/api/system/client/index.ts
Normal file
77
Yi.Vben5.Vue3/apps/web-antd/src/api/system/client/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import type { Client } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
clientChangeStatus = '/client/changeStatus',
|
||||
clientExport = '/client/export',
|
||||
clientList = '/client/list',
|
||||
root = '/client',
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户端分页列表
|
||||
* @param params 请求参数
|
||||
* @returns 列表
|
||||
*/
|
||||
export function clientList(params?: PageQuery) {
|
||||
return requestClient.get<PageResult<Client>>(Api.clientList, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户端excel
|
||||
* @param data 请求参数
|
||||
*/
|
||||
export function clientExport(data: Partial<Client>) {
|
||||
return commonExport(Api.clientExport, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户端详情
|
||||
* @param id id
|
||||
* @returns 详情
|
||||
*/
|
||||
export function clientInfo(id: ID) {
|
||||
return requestClient.get<Client>(`${Api.root}/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户端新增
|
||||
* @param data 参数
|
||||
*/
|
||||
export function clientAdd(data: Partial<Client>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户端修改
|
||||
* @param data 参数
|
||||
*/
|
||||
export function clientUpdate(data: Partial<Client>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户端状态修改
|
||||
* @param data 状态
|
||||
*/
|
||||
export function clientChangeStatus(data: any) {
|
||||
const requestData = {
|
||||
clientId: data.clientId,
|
||||
status: data.status,
|
||||
};
|
||||
return requestClient.putWithMsg<void>(Api.clientChangeStatus, requestData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户端删除
|
||||
* @param ids id集合
|
||||
*/
|
||||
export function clientRemove(ids: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: ids.join(',') },
|
||||
});
|
||||
}
|
||||
12
Yi.Vben5.Vue3/apps/web-antd/src/api/system/client/model.d.ts
vendored
Normal file
12
Yi.Vben5.Vue3/apps/web-antd/src/api/system/client/model.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
export interface Client {
|
||||
id: number;
|
||||
clientId: string;
|
||||
clientKey: string;
|
||||
clientSecret: string;
|
||||
grantTypeList: string[];
|
||||
grantType: string;
|
||||
deviceType: string;
|
||||
activeTimeout: number;
|
||||
timeout: number;
|
||||
status: string;
|
||||
}
|
||||
78
Yi.Vben5.Vue3/apps/web-antd/src/api/system/config/index.ts
Normal file
78
Yi.Vben5.Vue3/apps/web-antd/src/api/system/config/index.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import type { SysConfig } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
configExport = '/config/export',
|
||||
configInfoByKey = '/config/config-key',
|
||||
configList = '/config/list',
|
||||
configRefreshCache = '/config/refreshCache',
|
||||
root = '/config',
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统参数分页列表
|
||||
* @param params 请求参数
|
||||
* @returns 列表
|
||||
*/
|
||||
export function configList(params?: PageQuery) {
|
||||
return requestClient.get<PageResult<SysConfig>>(Api.root, { params });
|
||||
}
|
||||
|
||||
export function configInfo(configId: ID) {
|
||||
return requestClient.get<SysConfig>(`${Api.root}/${configId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
* @param data 参数
|
||||
*/
|
||||
export function configExport(data: Partial<SysConfig>) {
|
||||
return commonExport(Api.configExport, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新缓存
|
||||
* @returns void
|
||||
*/
|
||||
export function configRefreshCache() {
|
||||
return requestClient.deleteWithMsg<void>(Api.configRefreshCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新系统配置
|
||||
* @param data 参数
|
||||
*/
|
||||
export function configUpdate(data: Partial<SysConfig>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统配置
|
||||
* @param data 参数
|
||||
*/
|
||||
export function configAdd(data: Partial<SysConfig>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配置
|
||||
* @param configIds ids
|
||||
*/
|
||||
export function configRemove(configIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: configIds.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配置信息
|
||||
* @param configKey configKey
|
||||
* @returns value
|
||||
*/
|
||||
export function configInfoByKey(configKey: string) {
|
||||
return requestClient.get<string>(`${Api.configInfoByKey}/${configKey}`);
|
||||
}
|
||||
14
Yi.Vben5.Vue3/apps/web-antd/src/api/system/config/model.d.ts
vendored
Normal file
14
Yi.Vben5.Vue3/apps/web-antd/src/api/system/config/model.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
export interface SysConfig {
|
||||
id: string;
|
||||
configName: string;
|
||||
configKey: string;
|
||||
configValue: string;
|
||||
configType: string | null;
|
||||
orderNum: number;
|
||||
remark: string | null;
|
||||
isDeleted: boolean;
|
||||
creationTime: string;
|
||||
creatorId: string | null;
|
||||
lastModifierId: string | null;
|
||||
lastModificationTime: string | null;
|
||||
}
|
||||
64
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dept/index.ts
Normal file
64
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dept/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { Dept } from './model';
|
||||
|
||||
import type { ID } from '#/api/common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
deptList = '/dept/list',
|
||||
deptNodeInfo = '/dept/list/exclude',
|
||||
root = '/dept',
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门列表
|
||||
* @returns list
|
||||
*/
|
||||
export function deptList(params?: { deptName?: string; status?: string }) {
|
||||
return requestClient.get<Dept[]>(Api.deptList, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门列表(排除节点)
|
||||
* @param deptId 部门ID
|
||||
* @returns void
|
||||
*/
|
||||
export function deptNodeList(deptId: ID) {
|
||||
return requestClient.get<Dept[]>(`${Api.deptNodeInfo}/${deptId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门详情
|
||||
* @param deptId 部门id
|
||||
* @returns 部门信息
|
||||
*/
|
||||
export function deptInfo(deptId: ID) {
|
||||
return requestClient.get<Dept>(`${Api.root}/${deptId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门新增
|
||||
* @param data 参数
|
||||
*/
|
||||
export function deptAdd(data: Partial<Dept>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门更新
|
||||
* @param data 参数
|
||||
*/
|
||||
export function deptUpdate(data: Partial<Dept>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注意这里只允许单删除
|
||||
* @param deptId ID
|
||||
* @returns void
|
||||
*/
|
||||
export function deptRemove(deptId: ID) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: deptId },
|
||||
});
|
||||
}
|
||||
14
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dept/model.d.ts
vendored
Normal file
14
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dept/model.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
export interface Dept {
|
||||
creationTime: string;
|
||||
creatorId?: string | null;
|
||||
state: boolean;
|
||||
deptName: string;
|
||||
deptCode?: string;
|
||||
leader?: string;
|
||||
leaderName?: string;
|
||||
parentId: string | null;
|
||||
remark?: string;
|
||||
orderNum: number;
|
||||
id: string;
|
||||
children?: Dept[];
|
||||
}
|
||||
17
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dict/dict-data-model.d.ts
vendored
Normal file
17
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dict/dict-data-model.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export interface DictData {
|
||||
id: string;
|
||||
isDeleted: boolean;
|
||||
orderNum: number;
|
||||
state: boolean;
|
||||
remark: string | null;
|
||||
listClass: string | null;
|
||||
cssClass: string | null;
|
||||
dictType: string;
|
||||
dictLabel: string | null;
|
||||
dictValue: string;
|
||||
isDefault: boolean;
|
||||
creationTime: string;
|
||||
creatorId: string | null;
|
||||
lastModifierId: string | null;
|
||||
lastModificationTime: string | null;
|
||||
}
|
||||
78
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dict/dict-data.ts
Normal file
78
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dict/dict-data.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import type { DictData } from './dict-data-model';
|
||||
|
||||
import type { ID, IDS, PageQuery } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
dictDataExport = '/dict/data/export',
|
||||
dictDataInfo = '/dictionary/dic-type',
|
||||
dictDataList = '/dict/data/list',
|
||||
root = '/dictionary',
|
||||
}
|
||||
|
||||
/**
|
||||
* 主要是DictTag组件使用
|
||||
* @param dictType 字典类型
|
||||
* @returns 字典数据
|
||||
*/
|
||||
export function dictDataInfo(dictType: string) {
|
||||
return requestClient.get<DictData[]>(`${Api.dictDataInfo}/${dictType}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典数据
|
||||
* @param params 查询参数
|
||||
* @returns 字典数据列表
|
||||
*/
|
||||
export function dictDataList(params?: PageQuery) {
|
||||
return requestClient.get<DictData[]>(Api.root, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出字典数据
|
||||
* @param data 表单参数
|
||||
* @returns blob
|
||||
*/
|
||||
export function dictDataExport(data: Partial<DictData>) {
|
||||
return commonExport(Api.dictDataExport, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param dictIds 字典ID Array
|
||||
* @returns void
|
||||
*/
|
||||
export function dictDataRemove(dictIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: dictIds.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param data 表单参数
|
||||
* @returns void
|
||||
*/
|
||||
export function dictDataAdd(data: Partial<DictData>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param data 表单参数
|
||||
* @returns void
|
||||
*/
|
||||
export function dictDataUpdate(data: Partial<DictData>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典数据详细
|
||||
* @param id 字典ID
|
||||
* @returns 字典数据
|
||||
*/
|
||||
export function dictDetailInfo(id: ID) {
|
||||
return requestClient.get<DictData>(`${Api.root}/${id}`);
|
||||
}
|
||||
13
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dict/dict-type-model.d.ts
vendored
Normal file
13
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dict/dict-type-model.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
export interface DictType {
|
||||
id: string;
|
||||
isDeleted: boolean;
|
||||
orderNum: number;
|
||||
state: boolean | null;
|
||||
dictName: string;
|
||||
dictType: string;
|
||||
remark: string | null;
|
||||
creationTime: string;
|
||||
creatorId: string | null;
|
||||
lastModifierId: string | null;
|
||||
lastModificationTime: string | null;
|
||||
}
|
||||
87
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dict/dict-type.ts
Normal file
87
Yi.Vben5.Vue3/apps/web-antd/src/api/system/dict/dict-type.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
import type { DictType } from './dict-type-model';
|
||||
|
||||
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
dictOptionSelectList = '/dictionary-type/select-data-list',
|
||||
dictTypeExport = '/dictionary-type/export',
|
||||
dictTypeList = '/dictionary-type/list',
|
||||
dictTypeRefreshCache = '/dictionary-type/refreshCache',
|
||||
root = '/dictionary-type',
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典类型列表
|
||||
* @param params 请求参数
|
||||
* @returns list
|
||||
*/
|
||||
export function dictTypeList(params?: PageQuery) {
|
||||
return requestClient.get<PageResult<DictType>>(Api.root, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出字典类型列表
|
||||
* @param data 表单参数
|
||||
* @returns blob
|
||||
*/
|
||||
export function dictTypeExport(data: Partial<DictType>) {
|
||||
return commonExport(Api.dictTypeExport, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典类型
|
||||
* @param dictIds 字典类型id数组
|
||||
* @returns void
|
||||
*/
|
||||
export function dictTypeRemove(dictIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: dictIds.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新字典缓存
|
||||
* @returns void
|
||||
*/
|
||||
export function refreshDictTypeCache() {
|
||||
return requestClient.deleteWithMsg<void>(Api.dictTypeRefreshCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param data 表单参数
|
||||
* @returns void
|
||||
*/
|
||||
export function dictTypeAdd(data: Partial<DictType>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param data 表单参数
|
||||
* @returns void
|
||||
*/
|
||||
export function dictTypeUpdate(data: Partial<DictType>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
* @param dictId 字典类型id
|
||||
* @returns 信息
|
||||
*/
|
||||
export function dictTypeInfo(dictId: ID) {
|
||||
return requestClient.get<DictType>(`${Api.root}/${dictId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 这个在ele用到 v5用不上
|
||||
* 下拉框 返回值和list一样
|
||||
* @returns options
|
||||
*/
|
||||
export function dictOptionSelectList() {
|
||||
return requestClient.get<DictType[]>(Api.dictOptionSelectList);
|
||||
}
|
||||
84
Yi.Vben5.Vue3/apps/web-antd/src/api/system/menu/index.ts
Normal file
84
Yi.Vben5.Vue3/apps/web-antd/src/api/system/menu/index.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
import type { Menu, MenuOption, MenuQuery, MenuResp } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
menuList = '/menu/list',
|
||||
menuTreeSelect = '/menu/tree',
|
||||
root = '/menu',
|
||||
tenantPackageMenuTreeselect = '/menu/tenantPackageMenuTreeselect',
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单列表
|
||||
* @param params 参数
|
||||
* @returns 列表
|
||||
*/
|
||||
export function menuList(params?: MenuQuery) {
|
||||
return requestClient.get<Menu[]>(Api.menuList, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单详情
|
||||
* @param menuId 菜单id
|
||||
* @returns 菜单详情
|
||||
*/
|
||||
export function menuInfo(menuId: ID) {
|
||||
return requestClient.get<Menu>(`${Api.root}/${menuId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单新增
|
||||
* @param data 参数
|
||||
*/
|
||||
export function menuAdd(data: Partial<Menu>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单更新
|
||||
* @param data 参数
|
||||
*/
|
||||
export function menuUpdate(data: Partial<Menu>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单删除
|
||||
* @param menuIds ids
|
||||
*/
|
||||
export function menuRemove(menuIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: menuIds.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框使用 返回所有的菜单
|
||||
* @returns []
|
||||
*/
|
||||
export function menuTreeSelect() {
|
||||
return requestClient.get<MenuOption[]>(Api.menuTreeSelect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户套餐使用
|
||||
* @param packageId packageId
|
||||
* @returns resp
|
||||
*/
|
||||
export function tenantPackageMenuTreeSelect(packageId: ID) {
|
||||
return requestClient.get<MenuResp>(
|
||||
`${Api.tenantPackageMenuTreeselect}/${packageId}`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除菜单
|
||||
* @param menuIds 菜单ids
|
||||
* @returns void
|
||||
*/
|
||||
export function menuCascadeRemove(menuIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`${Api.root}/cascade/${menuIds}`);
|
||||
}
|
||||
57
Yi.Vben5.Vue3/apps/web-antd/src/api/system/menu/model.d.ts
vendored
Normal file
57
Yi.Vben5.Vue3/apps/web-antd/src/api/system/menu/model.d.ts
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
export interface Menu {
|
||||
id: string;
|
||||
isDeleted: boolean;
|
||||
creationTime: string;
|
||||
creatorId: string | null;
|
||||
lastModifierId: string | null;
|
||||
lastModificationTime: string | null;
|
||||
orderNum: number;
|
||||
state: boolean;
|
||||
menuName: string;
|
||||
routerName?: string | null;
|
||||
menuType: string;
|
||||
permissionCode?: string | null;
|
||||
parentId: string;
|
||||
menuIcon?: string | null;
|
||||
router?: string | null;
|
||||
isLink: boolean;
|
||||
isCache: boolean;
|
||||
isShow: boolean;
|
||||
remark?: string | null;
|
||||
component?: string | null;
|
||||
query?: string | null;
|
||||
children?: Menu[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 菜单信息
|
||||
* @param menuName 菜单名称
|
||||
*/
|
||||
export interface MenuOption {
|
||||
id: string;
|
||||
parentId: string;
|
||||
orderNum: number;
|
||||
menuName: string;
|
||||
menuType: string;
|
||||
menuIcon?: string | null;
|
||||
children?: MenuOption[] | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 菜单返回
|
||||
* @param checkedKeys 选中的菜单id
|
||||
* @param menus 菜单信息
|
||||
*/
|
||||
export interface MenuResp {
|
||||
checkedKeys: string[];
|
||||
menus: MenuOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单表单查询
|
||||
*/
|
||||
export interface MenuQuery {
|
||||
menuName?: string;
|
||||
isShow?: boolean;
|
||||
state?: boolean;
|
||||
}
|
||||
53
Yi.Vben5.Vue3/apps/web-antd/src/api/system/notice/index.ts
Normal file
53
Yi.Vben5.Vue3/apps/web-antd/src/api/system/notice/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { Notice } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
root = '/notice',
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知公告分页
|
||||
* @param params 分页参数
|
||||
* @returns 分页结果
|
||||
*/
|
||||
export function noticeList(params?: PageQuery) {
|
||||
return requestClient.get<PageResult<Notice>>(Api.root, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知公告详情
|
||||
* @param id id
|
||||
* @returns 详情
|
||||
*/
|
||||
export function noticeInfo(id: ID) {
|
||||
return requestClient.get<Notice>(`${Api.root}/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知公告新增
|
||||
* @param data 参数
|
||||
*/
|
||||
export function noticeAdd(data: Partial<Notice>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知公告更新
|
||||
* @param data 参数
|
||||
*/
|
||||
export function noticeUpdate(data: any) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知公告删除
|
||||
* @param ids ids
|
||||
*/
|
||||
export function noticeRemove(ids: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: ids.join(',') },
|
||||
});
|
||||
}
|
||||
13
Yi.Vben5.Vue3/apps/web-antd/src/api/system/notice/model.d.ts
vendored
Normal file
13
Yi.Vben5.Vue3/apps/web-antd/src/api/system/notice/model.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
export interface Notice {
|
||||
id: string;
|
||||
title: string;
|
||||
type: string;
|
||||
content: string;
|
||||
state: boolean;
|
||||
isDeleted: boolean;
|
||||
creationTime: string;
|
||||
creatorId?: string | null;
|
||||
lastModifierId?: string | null;
|
||||
lastModificationTime?: string | null;
|
||||
orderNum: number;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import type { OssConfig } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery } from '#/api/common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
ossConfigChangeStatus = '/resource/oss/config/changeStatus',
|
||||
ossConfigList = '/resource/oss/config/list',
|
||||
root = '/resource/oss/config',
|
||||
}
|
||||
|
||||
// 获取OSS配置列表
|
||||
export function ossConfigList(params?: PageQuery) {
|
||||
return requestClient.get<OssConfig[]>(Api.ossConfigList, { params });
|
||||
}
|
||||
|
||||
// 获取OSS配置的信息
|
||||
export function ossConfigInfo(ossConfigId: ID) {
|
||||
return requestClient.get<OssConfig>(`${Api.root}/${ossConfigId}`);
|
||||
}
|
||||
|
||||
// 添加新的OSS配置
|
||||
export function ossConfigAdd(data: Partial<OssConfig>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
// 更新现有的OSS配置
|
||||
export function ossConfigUpdate(data: Partial<OssConfig>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
// 删除OSS配置
|
||||
export function ossConfigRemove(ossConfigIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: ossConfigIds.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
// 更改OSS配置的状态
|
||||
export function ossConfigChangeStatus(data: any) {
|
||||
const requestData: Partial<OssConfig> = {
|
||||
ossConfigId: data.ossConfigId,
|
||||
status: data.status,
|
||||
configKey: data.configKey,
|
||||
};
|
||||
return requestClient.putWithMsg(Api.ossConfigChangeStatus, requestData);
|
||||
}
|
||||
16
Yi.Vben5.Vue3/apps/web-antd/src/api/system/oss-config/model.d.ts
vendored
Normal file
16
Yi.Vben5.Vue3/apps/web-antd/src/api/system/oss-config/model.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
export interface OssConfig {
|
||||
ossConfigId: number;
|
||||
configKey: string;
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
bucketName: string;
|
||||
prefix: string;
|
||||
endpoint: string;
|
||||
domain: string;
|
||||
isHttps: string;
|
||||
region: string;
|
||||
status: string;
|
||||
ext1: string;
|
||||
remark: string;
|
||||
accessPolicy: string;
|
||||
}
|
||||
77
Yi.Vben5.Vue3/apps/web-antd/src/api/system/oss/index.ts
Normal file
77
Yi.Vben5.Vue3/apps/web-antd/src/api/system/oss/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import type { AxiosRequestConfig } from '@vben/request';
|
||||
|
||||
import type { OssFile } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
||||
|
||||
import { ContentTypeEnum } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
ossDownload = '/resource/oss/download',
|
||||
ossInfo = '/resource/oss/listByIds',
|
||||
ossList = '/resource/oss/list',
|
||||
ossUpload = '/resource/oss/upload',
|
||||
root = '/resource/oss',
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件list
|
||||
* @param params 参数
|
||||
* @returns 分页
|
||||
*/
|
||||
export function ossList(params?: PageQuery) {
|
||||
return requestClient.get<PageResult<OssFile>>(Api.ossList, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文件信息 返回为数组
|
||||
* @param ossIds id数组
|
||||
* @returns 信息数组
|
||||
*/
|
||||
export function ossInfo(ossIds: ID | IDS) {
|
||||
return requestClient.get<OssFile[]>(`${Api.ossInfo}/${ossIds}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 使用apps/web-antd/src/api/core/upload.ts uploadApi方法
|
||||
* @param file 文件
|
||||
* @returns void
|
||||
*/
|
||||
export function ossUpload(file: Blob | File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.postWithMsg(Api.ossUpload, formData, {
|
||||
headers: { 'Content-Type': ContentTypeEnum.FORM_DATA },
|
||||
timeout: 30 * 1000,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件 返回为二进制
|
||||
* @param ossId ossId
|
||||
* @param onDownloadProgress 下载进度(可选)
|
||||
* @returns blob
|
||||
*/
|
||||
export function ossDownload(
|
||||
ossId: ID,
|
||||
onDownloadProgress?: AxiosRequestConfig['onDownloadProgress'],
|
||||
) {
|
||||
return requestClient.get<Blob>(`${Api.ossDownload}/${ossId}`, {
|
||||
responseType: 'blob',
|
||||
timeout: 30 * 1000,
|
||||
isTransformResponse: false,
|
||||
onDownloadProgress,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
* @param ossIds id数组
|
||||
* @returns void
|
||||
*/
|
||||
export function ossRemove(ossIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: ossIds.join(',') },
|
||||
});
|
||||
}
|
||||
28
Yi.Vben5.Vue3/apps/web-antd/src/api/system/oss/model.d.ts
vendored
Normal file
28
Yi.Vben5.Vue3/apps/web-antd/src/api/system/oss/model.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
export interface OssFile {
|
||||
ossId: string;
|
||||
fileName: string;
|
||||
originalName: string;
|
||||
fileSuffix: string;
|
||||
url: string;
|
||||
createTime: string;
|
||||
createBy: number;
|
||||
createByName: string;
|
||||
service: string;
|
||||
}
|
||||
|
||||
export interface OssConfig {
|
||||
ossConfigId: number;
|
||||
configKey: string;
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
bucketName: string;
|
||||
prefix: string;
|
||||
endpoint: string;
|
||||
domain: string;
|
||||
isHttps: string;
|
||||
region: string;
|
||||
status: string;
|
||||
ext1: string;
|
||||
remark: string;
|
||||
accessPolicy: string;
|
||||
}
|
||||
77
Yi.Vben5.Vue3/apps/web-antd/src/api/system/post/index.ts
Normal file
77
Yi.Vben5.Vue3/apps/web-antd/src/api/system/post/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import type { Post } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
postExport = '/post/export',
|
||||
postList = '/post/list',
|
||||
postSelect = '/post/select-data-list',
|
||||
root = '/post',
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位列表
|
||||
* @param params 参数
|
||||
* @returns Post[]
|
||||
*/
|
||||
export function postList(params?: PageQuery) {
|
||||
return requestClient.get<Post[]>(Api.root, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出岗位信息
|
||||
* @param data 请求参数
|
||||
* @returns blob
|
||||
*/
|
||||
export function postExport(data: Partial<Post>) {
|
||||
return commonExport(Api.postExport, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询岗位信息
|
||||
* @param id 岗位id
|
||||
* @returns 岗位信息
|
||||
*/
|
||||
export function postInfo(id: ID) {
|
||||
return requestClient.get<Post>(`${Api.root}/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位新增
|
||||
* @param data 参数
|
||||
* @returns void
|
||||
*/
|
||||
export function postAdd(data: Partial<Post>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位更新
|
||||
* @param data 参数
|
||||
* @returns void
|
||||
*/
|
||||
export function postUpdate(data: Partial<Post>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位删除
|
||||
* @param postIds ids
|
||||
* @returns void
|
||||
*/
|
||||
export function postRemove(postIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: postIds.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位下拉列表
|
||||
* @returns 岗位
|
||||
*/
|
||||
export function postOptionSelect(deptId: string) {
|
||||
return requestClient.get<Post[]>(`${Api.postSelect}?keywords=${deptId}`);
|
||||
}
|
||||
17
Yi.Vben5.Vue3/apps/web-antd/src/api/system/post/model.d.ts
vendored
Normal file
17
Yi.Vben5.Vue3/apps/web-antd/src/api/system/post/model.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @description: Post interface
|
||||
*/
|
||||
export interface Post {
|
||||
id: string;
|
||||
isDeleted: boolean;
|
||||
creationTime: string;
|
||||
creatorId: string | null;
|
||||
lastModifierId: string | null;
|
||||
lastModificationTime: string | null;
|
||||
orderNum: number;
|
||||
state: boolean;
|
||||
postCode: string;
|
||||
postName: string;
|
||||
deptId: string;
|
||||
remark: string | null;
|
||||
}
|
||||
65
Yi.Vben5.Vue3/apps/web-antd/src/api/system/profile/index.ts
Normal file
65
Yi.Vben5.Vue3/apps/web-antd/src/api/system/profile/index.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { FileCallBack, UpdatePasswordParam, UserProfile } from './model';
|
||||
|
||||
import { buildUUID } from '@vben/utils';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
root = '/user/profile',
|
||||
updateAvatar = '/user/profile/avatar',
|
||||
updatePassword = '/user/profile/updatePwd',
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户个人主页信息
|
||||
* @returns userInformation
|
||||
*/
|
||||
export function userProfile() {
|
||||
return requestClient.get<UserProfile>(Api.root);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户个人主页信息
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function userProfileUpdate(data: any) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户修改密码 (需要加密)
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function userUpdatePassword(data: UpdatePasswordParam) {
|
||||
return requestClient.putWithMsg<void>(Api.updatePassword, data, {
|
||||
encrypt: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户更新个人头像
|
||||
* @param fileCallback data
|
||||
* @returns void
|
||||
*/
|
||||
export function userUpdateAvatar(fileCallback: FileCallBack) {
|
||||
/** 直接点击头像上传 filename为空 由于后台通过拓展名判断(默认文件名blob) 会上传失败 */
|
||||
let { file } = fileCallback;
|
||||
const { filename } = fileCallback;
|
||||
/**
|
||||
* Blob转File类型
|
||||
* 1. 在直接点击确认 filename为空 取uuid作为文件名
|
||||
* 2. 选择上传必须转为File类型 Blob类型上传后台获取文件名为空
|
||||
*/
|
||||
file = filename
|
||||
? new File([file], filename)
|
||||
: new File([file], `${buildUUID()}.png`);
|
||||
return requestClient.post(
|
||||
Api.updateAvatar,
|
||||
{
|
||||
avatarfile: file,
|
||||
},
|
||||
{ headers: { 'Content-Type': 'multipart/form-data' } },
|
||||
);
|
||||
}
|
||||
75
Yi.Vben5.Vue3/apps/web-antd/src/api/system/profile/model.d.ts
vendored
Normal file
75
Yi.Vben5.Vue3/apps/web-antd/src/api/system/profile/model.d.ts
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
export interface Dept {
|
||||
deptId: number;
|
||||
parentId: number;
|
||||
parentName?: any;
|
||||
ancestors: string;
|
||||
deptName: string;
|
||||
orderNum: number;
|
||||
leader: string;
|
||||
phone?: any;
|
||||
email: string;
|
||||
status: string;
|
||||
createTime?: any;
|
||||
}
|
||||
|
||||
export interface Role {
|
||||
roleId: number;
|
||||
roleName: string;
|
||||
roleKey: string;
|
||||
roleSort: number;
|
||||
dataScope: string;
|
||||
menuCheckStrictly?: any;
|
||||
deptCheckStrictly?: any;
|
||||
status: string;
|
||||
remark: string;
|
||||
createTime?: any;
|
||||
flag: boolean;
|
||||
superAdmin: boolean;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
userId: number;
|
||||
tenantId: string;
|
||||
deptId: number;
|
||||
userName: string;
|
||||
nickName: string;
|
||||
userType: string;
|
||||
email: string;
|
||||
phonenumber: string;
|
||||
sex: string;
|
||||
avatar: string;
|
||||
status: string;
|
||||
loginIp: string;
|
||||
loginDate: string;
|
||||
remark: string;
|
||||
createTime: string;
|
||||
dept: Dept;
|
||||
roles: Role[];
|
||||
roleIds?: string[];
|
||||
postIds?: string[];
|
||||
roleId: number;
|
||||
deptName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户个人主页信息
|
||||
* @param user 用户信息
|
||||
* @param roleGroup 角色名称
|
||||
* @param postGroup 岗位名称
|
||||
*/
|
||||
export interface UserProfile {
|
||||
user: User;
|
||||
roleGroup: string;
|
||||
postGroup: string;
|
||||
}
|
||||
|
||||
export interface UpdatePasswordParam {
|
||||
oldPassword: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
interface FileCallBack {
|
||||
name: string;
|
||||
file: Blob;
|
||||
filename: string;
|
||||
}
|
||||
161
Yi.Vben5.Vue3/apps/web-antd/src/api/system/role/index.ts
Normal file
161
Yi.Vben5.Vue3/apps/web-antd/src/api/system/role/index.ts
Normal file
@@ -0,0 +1,161 @@
|
||||
import type { MenuResp } from '../menu/model';
|
||||
import type { User } from '../user/model';
|
||||
import type { DeptResp, Role } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
roleAuthUser = '/role/auth-user',
|
||||
roleDataScope = '/role/data-scope',
|
||||
roleDeptTree = '/role/dept-tree',
|
||||
roleExport = '/role/export',
|
||||
roleList = '/role/list',
|
||||
roleMenuTree = '/role/menu-tree',
|
||||
roleOptionSelect = '/role/select-data-list',
|
||||
root = '/role',
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色分页列表
|
||||
* @param params 搜索条件
|
||||
* @returns 分页列表
|
||||
*/
|
||||
export function roleList(params?: PageQuery) {
|
||||
return requestClient.get<PageResult<Role>>(Api.root, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出角色信息
|
||||
* @param data 查询参数
|
||||
* @returns blob
|
||||
*/
|
||||
export function roleExport(data: Partial<Role>) {
|
||||
return commonExport(Api.roleExport, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色信息
|
||||
* @param roleId 角色id
|
||||
* @returns 角色信息
|
||||
*/
|
||||
export function roleInfo(roleId: ID) {
|
||||
return requestClient.get<Role>(`${Api.root}/${roleId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色新增
|
||||
* @param data 参数
|
||||
* @returns void
|
||||
*/
|
||||
export function roleAdd(data: Partial<Role>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色更新
|
||||
* @param data 参数
|
||||
* @returns void
|
||||
*/
|
||||
export function roleUpdate(data: Partial<Role>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色删除
|
||||
* @param roleIds ids
|
||||
* @returns void
|
||||
*/
|
||||
export function roleRemove(roleIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: roleIds.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新数据权限
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function roleDataScope(data: any) {
|
||||
return requestClient.putWithMsg<void>(Api.roleDataScope, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 全局并没有用到这个方法
|
||||
*/
|
||||
export function roleOptionSelect(params?: any) {
|
||||
return requestClient.get(Api.roleOptionSelect, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 已分配角色的用户分页
|
||||
* @param params 请求参数
|
||||
* @returns 分页
|
||||
*/
|
||||
export function roleAllocatedList(roleId: ID, params?: PageQuery) {
|
||||
return requestClient.get<PageResult<User>>(`${Api.roleAuthUser}/${roleId}/true`, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 未授权的用户
|
||||
* @param params
|
||||
* @returns void
|
||||
*/
|
||||
export function roleUnallocatedList(roleId: ID, params?: PageQuery) {
|
||||
return requestClient.get<PageResult<User>>(`${Api.roleAuthUser}/${roleId}/false`, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量取消授权
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 用户ID集合
|
||||
* @returns void
|
||||
*/
|
||||
export function roleAuthCancelAll(roleId: ID, userIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(
|
||||
`${Api.roleAuthUser}`,
|
||||
{
|
||||
data: {
|
||||
roleId,
|
||||
userIds,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量授权用户
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 用户ID集合
|
||||
* @returns void
|
||||
*/
|
||||
export function roleSelectAll(roleId: ID, userIds: IDS) {
|
||||
return requestClient.postWithMsg<void>(
|
||||
`${Api.roleAuthUser}`,
|
||||
{
|
||||
roleId,
|
||||
userIds,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色id获取部门树
|
||||
* @param roleId 角色id
|
||||
* @returns DeptResp
|
||||
*/
|
||||
export function roleDeptTree(roleId: ID) {
|
||||
return requestClient.get<DeptResp>(`${Api.roleDeptTree}/${roleId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回对应角色的菜单
|
||||
* @param roleId id
|
||||
* @returns resp
|
||||
*/
|
||||
export function roleMenuTreeSelect(roleId: ID) {
|
||||
return requestClient.get<MenuResp>(`${Api.roleMenuTree}/${roleId}`);
|
||||
}
|
||||
30
Yi.Vben5.Vue3/apps/web-antd/src/api/system/role/model.d.ts
vendored
Normal file
30
Yi.Vben5.Vue3/apps/web-antd/src/api/system/role/model.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
export interface Role {
|
||||
id: string;
|
||||
creationTime: string;
|
||||
creatorId?: string | null;
|
||||
lastModifierId?: string | null;
|
||||
lastModificationTime?: string | null;
|
||||
isDeleted?: boolean;
|
||||
orderNum: number;
|
||||
state: boolean;
|
||||
roleName: string;
|
||||
roleCode: string;
|
||||
remark?: string | null;
|
||||
dataScope: string;
|
||||
menuIds?: string[];
|
||||
deptIds?: string[];
|
||||
}
|
||||
|
||||
export interface DeptOption {
|
||||
id: string;
|
||||
parentId: string | null;
|
||||
orderNum: number;
|
||||
deptName: string;
|
||||
state: boolean;
|
||||
children?: DeptOption[] | null;
|
||||
}
|
||||
|
||||
export interface DeptResp {
|
||||
checkedKeys: string[];
|
||||
depts: DeptOption[];
|
||||
}
|
||||
25
Yi.Vben5.Vue3/apps/web-antd/src/api/system/social/index.ts
Normal file
25
Yi.Vben5.Vue3/apps/web-antd/src/api/system/social/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { SocialInfo } from './model';
|
||||
|
||||
import type { ID } from '#/api/common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
root = '/social',
|
||||
socialList = '/social/list',
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取绑定的社交信息列表
|
||||
* @returns info
|
||||
*/
|
||||
export function socialList() {
|
||||
return requestClient.get<SocialInfo[]>(Api.socialList);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 并没有用到这个方法
|
||||
*/
|
||||
export function socialInfo(id: ID) {
|
||||
return requestClient.get(`${Api.root}/${id}`);
|
||||
}
|
||||
26
Yi.Vben5.Vue3/apps/web-antd/src/api/system/social/model.d.ts
vendored
Normal file
26
Yi.Vben5.Vue3/apps/web-antd/src/api/system/social/model.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
export interface SocialInfo {
|
||||
id: string;
|
||||
userId: number;
|
||||
tenantId: string;
|
||||
authId: string;
|
||||
source: string;
|
||||
accessToken: string;
|
||||
expireIn: number;
|
||||
refreshToken: string;
|
||||
openId: string;
|
||||
userName: string;
|
||||
nickName: string;
|
||||
email: string;
|
||||
avatar: string;
|
||||
accessCode?: any;
|
||||
unionId?: any;
|
||||
scope: string;
|
||||
tokenType: string;
|
||||
idToken?: any;
|
||||
macAlgorithm?: any;
|
||||
macKey?: any;
|
||||
code?: any;
|
||||
oauthToken?: any;
|
||||
oauthTokenSecret?: any;
|
||||
createTime: string;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import type { TenantPackage } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
packageChangeStatus = '/tenant/package/changeStatus',
|
||||
packageExport = '/tenant/package/export',
|
||||
packageList = '/tenant/package/list',
|
||||
packageSelectList = '/tenant/package/selectList',
|
||||
root = '/tenant/package',
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户套餐分页列表
|
||||
* @param params 请求参数
|
||||
* @returns 分页列表
|
||||
*/
|
||||
export function packageList(params?: PageQuery) {
|
||||
return requestClient.get<PageResult<TenantPackage>>(Api.packageList, {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户套餐下拉框
|
||||
* @returns 下拉框
|
||||
*/
|
||||
export function packageSelectList() {
|
||||
return requestClient.get<TenantPackage[]>(Api.packageSelectList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户套餐导出
|
||||
* @param data 参数
|
||||
* @returns blob
|
||||
*/
|
||||
export function packageExport(data: Partial<TenantPackage>) {
|
||||
return commonExport(Api.packageExport, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户套餐信息
|
||||
* @param id id
|
||||
* @returns 信息
|
||||
*/
|
||||
export function packageInfo(id: ID) {
|
||||
return requestClient.get<TenantPackage>(`${Api.root}/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户套餐新增
|
||||
* @param data data
|
||||
* @returns void
|
||||
*/
|
||||
export function packageAdd(data: Partial<TenantPackage>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户套餐更新
|
||||
* @param data data
|
||||
* @returns void
|
||||
*/
|
||||
export function packageUpdate(data: Partial<TenantPackage>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户套餐状态变更
|
||||
* @param data data
|
||||
* @returns void
|
||||
*/
|
||||
export function packageChangeStatus(data: Partial<TenantPackage>) {
|
||||
const packageId = {
|
||||
packageId: data.packageId,
|
||||
status: data.status,
|
||||
};
|
||||
return requestClient.putWithMsg<void>(Api.packageChangeStatus, packageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户套餐移除
|
||||
* @param ids ids
|
||||
* @returns void
|
||||
*/
|
||||
export function packageRemove(ids: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: ids.join(',') },
|
||||
});
|
||||
}
|
||||
17
Yi.Vben5.Vue3/apps/web-antd/src/api/system/tenant-package/model.d.ts
vendored
Normal file
17
Yi.Vben5.Vue3/apps/web-antd/src/api/system/tenant-package/model.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @description 租户套餐
|
||||
* @param packageId id
|
||||
* @param packageName 名称
|
||||
* @param menuIds 菜单id 格式为[1,2,3] 返回为string 提交为数组
|
||||
* @param remark 备注
|
||||
* @param menuCheckStrictly 是否关联父节点
|
||||
* @param status 状态
|
||||
*/
|
||||
export interface TenantPackage {
|
||||
packageId: string;
|
||||
packageName: string;
|
||||
menuIds: number[] | string;
|
||||
remark: string;
|
||||
menuCheckStrictly: boolean;
|
||||
status: string;
|
||||
}
|
||||
113
Yi.Vben5.Vue3/apps/web-antd/src/api/system/tenant/index.ts
Normal file
113
Yi.Vben5.Vue3/apps/web-antd/src/api/system/tenant/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import type { Tenant } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
dictSync = '/tenant/syncTenantDict',
|
||||
root = '/tenant',
|
||||
tenantDynamic = '/tenant/dynamic',
|
||||
tenantDynamicClear = '/tenant/dynamic/clear',
|
||||
tenantExport = '/tenant/export',
|
||||
tenantSyncPackage = '/tenant/syncTenantPackage',
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户分页列表
|
||||
* @param params 参数
|
||||
* @returns 分页
|
||||
*/
|
||||
export function tenantList(params?: PageQuery) {
|
||||
return requestClient.get<Tenant[]>(Api.root, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户导出
|
||||
* @param data data
|
||||
* @returns void
|
||||
*/
|
||||
export function tenantExport(data: Partial<Tenant>) {
|
||||
return commonExport(Api.tenantExport, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户信息
|
||||
* @param id id
|
||||
* @returns 租户信息
|
||||
*/
|
||||
export function tenantInfo(id: ID) {
|
||||
return requestClient.get<Tenant>(`${Api.root}/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户 必须开启加密
|
||||
* @param data data
|
||||
* @returns void
|
||||
*/
|
||||
export function tenantAdd(data: Partial<Tenant>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data, { encrypt: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户更新
|
||||
* @param data data
|
||||
* @returns void
|
||||
*/
|
||||
export function tenantUpdate(data: Partial<Tenant>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户删除
|
||||
* @param ids ids
|
||||
* @returns void
|
||||
*/
|
||||
export function tenantRemove(ids: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: ids.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态切换租户
|
||||
* @param tenantId 租户ID
|
||||
* @returns void
|
||||
*/
|
||||
export function tenantDynamicToggle(tenantId: string) {
|
||||
return requestClient.get<void>(`${Api.tenantDynamic}/${tenantId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除 动态切换租户
|
||||
* @returns void
|
||||
*/
|
||||
export function tenantDynamicClear() {
|
||||
return requestClient.get<void>(Api.tenantDynamicClear);
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户套餐同步
|
||||
* @param tenantId 租户id
|
||||
* @param packageId 套餐id
|
||||
* @returns void
|
||||
*/
|
||||
export function tenantSyncPackage(tenantId: string, packageId: string) {
|
||||
return requestClient.get<void>(Api.tenantSyncPackage, {
|
||||
params: { packageId, tenantId },
|
||||
successMessageMode: 'message',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步租户字典
|
||||
* @param tenantId 租户ID
|
||||
* @returns void
|
||||
*/
|
||||
export function dictSyncTenant(tenantId?: string) {
|
||||
return requestClient.get<void>(Api.dictSync, {
|
||||
params: { tenantId },
|
||||
successMessageMode: 'message',
|
||||
});
|
||||
}
|
||||
26
Yi.Vben5.Vue3/apps/web-antd/src/api/system/tenant/model.d.ts
vendored
Normal file
26
Yi.Vben5.Vue3/apps/web-antd/src/api/system/tenant/model.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
export interface Tenant {
|
||||
id: string;
|
||||
name: string;
|
||||
entityVersion: number;
|
||||
tenantConnectionString: string;
|
||||
dbType: number;
|
||||
isDeleted: boolean;
|
||||
creationTime: string;
|
||||
creatorId: string | null;
|
||||
lastModifierId: string | null;
|
||||
lastModificationTime: string | null;
|
||||
// 以下字段可能来自 ExtraProperties 或后端扩展
|
||||
accountCount?: number;
|
||||
address?: string;
|
||||
companyName?: string;
|
||||
contactPhone?: string;
|
||||
contactUserName?: string;
|
||||
domain?: string;
|
||||
expireTime?: string;
|
||||
intro?: string;
|
||||
licenseNumber?: any;
|
||||
packageId?: string;
|
||||
remark?: string;
|
||||
status?: string | boolean;
|
||||
tenantId?: string;
|
||||
}
|
||||
156
Yi.Vben5.Vue3/apps/web-antd/src/api/system/user/index.ts
Normal file
156
Yi.Vben5.Vue3/apps/web-antd/src/api/system/user/index.ts
Normal file
@@ -0,0 +1,156 @@
|
||||
import type {
|
||||
DeptTreeData,
|
||||
ResetPwdParam,
|
||||
User,
|
||||
UserImportParam,
|
||||
} from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport, ContentTypeEnum } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
deptTree = '/dept/tree',
|
||||
listDeptUsers = '/user/dept',
|
||||
root = '/user',
|
||||
userAuthRole = '/user/authRole',
|
||||
userExport = '/user/export',
|
||||
userImport = '/user/importData',
|
||||
userImportTemplate = '/user/importTemplate',
|
||||
userResetPassword = '/account/rest-password',
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
* @param params
|
||||
* @returns User
|
||||
*/
|
||||
export function userList(params?: PageQuery) {
|
||||
return requestClient.get<PageResult<User>>(Api.root, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
* @param data data
|
||||
* @returns blob
|
||||
*/
|
||||
export function userExport(data: Partial<User>) {
|
||||
return commonExport(Api.userExport, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从excel导入用户
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function userImportData(data: UserImportParam) {
|
||||
return requestClient.post<{ code: number; msg: string }>(
|
||||
Api.userImport,
|
||||
data,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': ContentTypeEnum.FORM_DATA,
|
||||
},
|
||||
isTransformResponse: false,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载用户导入模板
|
||||
* @returns blob
|
||||
*/
|
||||
export function downloadImportTemplate() {
|
||||
return requestClient.post<Blob>(
|
||||
Api.userImportTemplate,
|
||||
{},
|
||||
{
|
||||
isTransformResponse: false,
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 可以不传ID 返回部门和角色options 需要获得原始数据
|
||||
* 不传ID时一定要带最后的/
|
||||
* @param userId 用户ID
|
||||
* @returns 用户信息
|
||||
*/
|
||||
export function findUserInfo(userId: ID) {
|
||||
return requestClient.get<User>(`${Api.root}/${userId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
* @param data data
|
||||
* @returns void
|
||||
*/
|
||||
export function userAdd(data: Partial<User>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
* @param data data
|
||||
* @returns void
|
||||
*/
|
||||
export function userUpdate(data: Partial<User>) {
|
||||
return requestClient.putWithMsg<void>(`${Api.root}/${data.id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
* @param userIds 用户ID数组
|
||||
* @returns void
|
||||
*/
|
||||
export function userRemove(userIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(Api.root, {
|
||||
params: { ids: userIds.join(',') },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置用户密码 需要加密
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function userResetPassword(data: ResetPwdParam) {
|
||||
return requestClient.putWithMsg<void>(`${Api.userResetPassword}/${data.id}`, data, {
|
||||
encrypt: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 这个方法未调用过
|
||||
* @param userId
|
||||
* @returns void
|
||||
*/
|
||||
export function getUserAuthRole(userId: ID) {
|
||||
return requestClient.get(`${Api.userAuthRole}/${userId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 这个方法未调用过
|
||||
* @param userId
|
||||
* @returns void
|
||||
*/
|
||||
export function userAuthRoleUpdate(userId: ID, roleIds: number[]) {
|
||||
return requestClient.putWithMsg(Api.userAuthRole, { roleIds, userId });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门树
|
||||
* @returns 部门树数组
|
||||
*/
|
||||
export function getDeptTree() {
|
||||
return requestClient.get<DeptTreeData[]>(Api.deptTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门下的所有用户信息
|
||||
*/
|
||||
export function listUserByDeptId(deptId: ID) {
|
||||
return requestClient.get<User[]>(`${Api.listDeptUsers}/${deptId}`);
|
||||
}
|
||||
100
Yi.Vben5.Vue3/apps/web-antd/src/api/system/user/model.d.ts
vendored
Normal file
100
Yi.Vben5.Vue3/apps/web-antd/src/api/system/user/model.d.ts
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
import type { Dept } from '../dept/model';
|
||||
|
||||
/**
|
||||
* @description: 用户导入
|
||||
* @param updateSupport 是否覆盖数据
|
||||
* @param file excel文件
|
||||
*/
|
||||
export interface UserImportParam {
|
||||
updateSupport: boolean;
|
||||
file: Blob | File;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 重置密码
|
||||
*/
|
||||
export interface ResetPwdParam {
|
||||
id: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface Role {
|
||||
roleId: string;
|
||||
roleName: string;
|
||||
roleKey: string;
|
||||
roleSort: number;
|
||||
dataScope: string;
|
||||
menuCheckStrictly?: boolean;
|
||||
deptCheckStrictly?: boolean;
|
||||
status: string;
|
||||
remark: string;
|
||||
createTime?: string;
|
||||
flag: boolean;
|
||||
superAdmin: boolean;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
isDeleted: boolean;
|
||||
name?: string | null;
|
||||
age?: number | null;
|
||||
userName: string;
|
||||
icon?: string | null;
|
||||
nick?: string | null;
|
||||
email?: string | null;
|
||||
ip?: string | null;
|
||||
address?: string | null;
|
||||
phone?: number | null;
|
||||
introduction?: string | null;
|
||||
remark?: string | null;
|
||||
sex: string; // SexEnum
|
||||
deptId?: string | null;
|
||||
creationTime: string;
|
||||
creatorId?: string | null;
|
||||
lastModifierId?: string | null;
|
||||
lastModificationTime?: string | null;
|
||||
orderNum: number;
|
||||
state: boolean;
|
||||
deptName?: string | null;
|
||||
posts?: Post[];
|
||||
roles?: Role[];
|
||||
dept?: Dept | null;
|
||||
}
|
||||
|
||||
export interface Post {
|
||||
postId: number;
|
||||
postCode: string;
|
||||
postName: string;
|
||||
postSort: number;
|
||||
status: string;
|
||||
remark: string;
|
||||
createTime: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 用户信息
|
||||
* @param user 用户个人信息
|
||||
* @param roleIds 角色IDS 不传id为空
|
||||
* @param roles 所有的角色
|
||||
* @param postIds 岗位IDS 不传id为空
|
||||
* @param posts 所有的岗位
|
||||
*/
|
||||
export interface UserInfoResponse {
|
||||
user?: User;
|
||||
roleIds?: string[];
|
||||
roles: Role[];
|
||||
postIds?: number[];
|
||||
posts?: Post[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 部门树
|
||||
*/
|
||||
export interface DeptTreeData {
|
||||
id: string;
|
||||
parentId: string;
|
||||
orderNum: number;
|
||||
deptName: string;
|
||||
state: boolean;
|
||||
children?: DeptTreeData[] | null;
|
||||
}
|
||||
Reference in New Issue
Block a user