mirror of
https://gitee.com/JavaLionLi/plus-ui.git
synced 2026-09-14 16:17:31 +08:00
[新增功能-前端提交]1、新增linkflow新租户管理页面 2、配额页面新增
This commit is contained in:
parent
06bd77bc60
commit
34082c57db
102
src/api/linkflow/org/index.ts
Normal file
102
src/api/linkflow/org/index.ts
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { TenantDetailVO, TenantDetailQuery, TenantDetailForm } from './types';
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
|
||||||
|
// 查询LinkFlow租户列表
|
||||||
|
export function listLinkflowTenant(query: TenantDetailQuery): AxiosPromise<TenantDetailVO[]> {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询租户详情
|
||||||
|
export function getLinkflowTenant(tenantId: string | number): AxiosPromise<TenantDetailVO> {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant/' + tenantId,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增租户
|
||||||
|
export function addLinkflowTenant(data: TenantDetailForm) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改租户
|
||||||
|
export function updateLinkflowTenant(data: TenantDetailForm) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 切换业务状态
|
||||||
|
export function changeOrgStatus(tenantId: string, orgStatus: string) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant/changeOrgStatus',
|
||||||
|
method: 'put',
|
||||||
|
data: { tenantId, orgStatus }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除租户
|
||||||
|
export function delLinkflowTenant(ids: string | number | Array<string | number>) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant/' + ids,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出租户
|
||||||
|
export function exportLinkflowTenant(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant/export',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== 通知相关 ==========
|
||||||
|
|
||||||
|
// 查询通知列表(tenantId 可选,后端自动兜底)
|
||||||
|
export function listNotifications(tenantId?: string) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant/notifications',
|
||||||
|
method: 'get',
|
||||||
|
params: tenantId ? { tenantId } : {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 标记已读
|
||||||
|
export function markNotificationRead(id: number | string) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant/notifications/' + id + '/read',
|
||||||
|
method: 'put'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 全部已读
|
||||||
|
export function markAllNotificationsRead(tenantId?: string) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant/notifications/readAll',
|
||||||
|
method: 'put',
|
||||||
|
params: tenantId ? { tenantId } : {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 未读数量
|
||||||
|
export function getUnreadCount(tenantId?: string) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/tenant/notifications/unreadCount',
|
||||||
|
method: 'get',
|
||||||
|
params: tenantId ? { tenantId } : {}
|
||||||
|
});
|
||||||
|
}
|
||||||
64
src/api/linkflow/org/types.ts
Normal file
64
src/api/linkflow/org/types.ts
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
export interface TenantDetailVO extends BaseEntity {
|
||||||
|
id: number | string;
|
||||||
|
tenantId: string;
|
||||||
|
companyName: string;
|
||||||
|
contactUserName: string;
|
||||||
|
contactPhone: string;
|
||||||
|
domain: string;
|
||||||
|
packageId: number | string;
|
||||||
|
packageName: string;
|
||||||
|
expireTime: string;
|
||||||
|
accountCount: number;
|
||||||
|
status: string;
|
||||||
|
// lf_tenant_ext 字段
|
||||||
|
extId: number | string;
|
||||||
|
monthlyQuota: number;
|
||||||
|
usedQuota: number;
|
||||||
|
platformCount: number;
|
||||||
|
orgStatus: string;
|
||||||
|
remark: string;
|
||||||
|
// 管理员信息
|
||||||
|
phonenumber: string;
|
||||||
|
// 计算字段
|
||||||
|
quotaUsageRate: number;
|
||||||
|
daysToExpire: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TenantDetailQuery extends PageQuery {
|
||||||
|
companyName?: string;
|
||||||
|
contactUserName?: string;
|
||||||
|
orgStatus?: string;
|
||||||
|
packageId?: number | string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TenantDetailForm {
|
||||||
|
id?: number | string | undefined;
|
||||||
|
tenantId?: string | undefined;
|
||||||
|
companyName: string;
|
||||||
|
contactUserName: string;
|
||||||
|
contactPhone: string;
|
||||||
|
domain?: string;
|
||||||
|
packageId: number | string;
|
||||||
|
expireTime: string;
|
||||||
|
accountCount: number;
|
||||||
|
// 新增租户时需要(RuoYi 创建租户同时创建管理员用户)
|
||||||
|
username?: string;
|
||||||
|
password?: string;
|
||||||
|
phonenumber?: string;
|
||||||
|
// lf_tenant_ext
|
||||||
|
extId?: number | string | undefined;
|
||||||
|
monthlyQuota: number;
|
||||||
|
platformCount: number;
|
||||||
|
remark?: string;
|
||||||
|
orgStatus?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NotificationVO {
|
||||||
|
id: number | string;
|
||||||
|
tenantId: string;
|
||||||
|
type: string;
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
isRead: string;
|
||||||
|
createTime: string;
|
||||||
|
}
|
||||||
39
src/api/linkflow/quota/index.ts
Normal file
39
src/api/linkflow/quota/index.ts
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { QuotaVO, QuotaQuery } from './types';
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
|
||||||
|
// 查询配额列表
|
||||||
|
export function listQuota(query: QuotaQuery): AxiosPromise<QuotaVO[]> {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/quota/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询单个租户配额
|
||||||
|
export function getQuota(tenantId: string | number): AxiosPromise<QuotaVO> {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/quota/' + tenantId,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调整配额
|
||||||
|
export function adjustQuota(tenantId: string, newMonthlyQuota: number) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/quota/adjust',
|
||||||
|
method: 'put',
|
||||||
|
params: { tenantId, newMonthlyQuota }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出配额
|
||||||
|
export function exportQuota(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/linkflow/quota/export',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
});
|
||||||
|
}
|
||||||
2
src/api/linkflow/quota/types.ts
Normal file
2
src/api/linkflow/quota/types.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// 配额 VO 复用 TenantDetailVO(包含配额使用率等计算字段)
|
||||||
|
export type { TenantDetailVO as QuotaVO, TenantDetailQuery as QuotaQuery } from '../org/types';
|
||||||
@ -47,6 +47,8 @@
|
|||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
<!-- LinkFlow 系统通知 -->
|
||||||
|
<lf-notification />
|
||||||
<el-tooltip content="Github" effect="dark" placement="bottom">
|
<el-tooltip content="Github" effect="dark" placement="bottom">
|
||||||
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@ -102,6 +104,7 @@ import { getTenantList } from '@/api/login';
|
|||||||
import { dynamicClear, dynamicTenant } from '@/api/system/tenant';
|
import { dynamicClear, dynamicTenant } from '@/api/system/tenant';
|
||||||
import { TenantVO } from '@/api/types';
|
import { TenantVO } from '@/api/types';
|
||||||
import notice from './notice/index.vue';
|
import notice from './notice/index.vue';
|
||||||
|
import LfNotification from '@/components/LfNotification/index.vue';
|
||||||
import router from '@/router';
|
import router from '@/router';
|
||||||
import { ElMessageBoxOptions } from 'element-plus/es/components/message-box/src/message-box.type';
|
import { ElMessageBoxOptions } from 'element-plus/es/components/message-box/src/message-box.type';
|
||||||
import { NavTypeEnum } from '@/enums/NavTypeEnum';
|
import { NavTypeEnum } from '@/enums/NavTypeEnum';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user